OpenSUSE Leap 42.3: How to mount a CIFS file share at boot when the network won't start?












0















I am using OpenSUSE Leap 42.3



I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.



However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.



By this time the mount attempt at boot time has already failed because no Wifi connection was active.



How do I make sure there is an active Wifi connection before the cifs file share is mounted?










share|improve this question























  • ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

    – guiverc
    Dec 22 '17 at 13:48











  • If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

    – ridgy
    Dec 22 '17 at 16:38
















0















I am using OpenSUSE Leap 42.3



I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.



However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.



By this time the mount attempt at boot time has already failed because no Wifi connection was active.



How do I make sure there is an active Wifi connection before the cifs file share is mounted?










share|improve this question























  • ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

    – guiverc
    Dec 22 '17 at 13:48











  • If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

    – ridgy
    Dec 22 '17 at 16:38














0












0








0








I am using OpenSUSE Leap 42.3



I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.



However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.



By this time the mount attempt at boot time has already failed because no Wifi connection was active.



How do I make sure there is an active Wifi connection before the cifs file share is mounted?










share|improve this question














I am using OpenSUSE Leap 42.3



I have a CIFS mount entry in my /etc/fstab which mounts a Samba share from a fileshare server.



However my network connection is through Wifi which only activates when I log in to the desktop via Network Manager.



By this time the mount attempt at boot time has already failed because no Wifi connection was active.



How do I make sure there is an active Wifi connection before the cifs file share is mounted?







opensuse networkmanager






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 22 '17 at 13:29









Aditya KAditya K

789821




789821













  • ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

    – guiverc
    Dec 22 '17 at 13:48











  • If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

    – ridgy
    Dec 22 '17 at 16:38



















  • ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

    – guiverc
    Dec 22 '17 at 13:48











  • If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

    – ridgy
    Dec 22 '17 at 16:38

















ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

– guiverc
Dec 22 '17 at 13:48





ages back (opensuse 10 or 11) I had a shell script called on login (.bash_profile probably) that (a) checked not already mounted, and (b) pinged my file.server (nas using samba). If (a)not_mounted && (b)server.up (ie. connected to correct network & server responded) it then mounted the share. it was a 'hack' but worked.

– guiverc
Dec 22 '17 at 13:48













If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

– ridgy
Dec 22 '17 at 16:38





If you add the options nofail,user to the fstab entry, the mount should not fail at boot if there is no network connection to the server. After you logged in, you may manually mount the drive (or have the mount command in some ifupscript).

– ridgy
Dec 22 '17 at 16:38










1 Answer
1






active

oldest

votes


















0














Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d



You can create a script of the kind:



===== 50-smb-mount =====
#! /bin/sh

case "$2" in
up)
mount -a -t cifs
;;
down)
umount -a -t cifs
;;
esac

========================


Do not forget to chmod +x it.



In addition you may add 'user,nofail' options in your fstab cifs entries.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412508%2fopensuse-leap-42-3-how-to-mount-a-cifs-file-share-at-boot-when-the-network-won%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d



    You can create a script of the kind:



    ===== 50-smb-mount =====
    #! /bin/sh

    case "$2" in
    up)
    mount -a -t cifs
    ;;
    down)
    umount -a -t cifs
    ;;
    esac

    ========================


    Do not forget to chmod +x it.



    In addition you may add 'user,nofail' options in your fstab cifs entries.






    share|improve this answer




























      0














      Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d



      You can create a script of the kind:



      ===== 50-smb-mount =====
      #! /bin/sh

      case "$2" in
      up)
      mount -a -t cifs
      ;;
      down)
      umount -a -t cifs
      ;;
      esac

      ========================


      Do not forget to chmod +x it.



      In addition you may add 'user,nofail' options in your fstab cifs entries.






      share|improve this answer


























        0












        0








        0







        Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d



        You can create a script of the kind:



        ===== 50-smb-mount =====
        #! /bin/sh

        case "$2" in
        up)
        mount -a -t cifs
        ;;
        down)
        umount -a -t cifs
        ;;
        esac

        ========================


        Do not forget to chmod +x it.



        In addition you may add 'user,nofail' options in your fstab cifs entries.






        share|improve this answer













        Network manager should have it's own dispatcher hooks running on a state change. They are located in the /etc/NetworkManager/dispatcher.d



        You can create a script of the kind:



        ===== 50-smb-mount =====
        #! /bin/sh

        case "$2" in
        up)
        mount -a -t cifs
        ;;
        down)
        umount -a -t cifs
        ;;
        esac

        ========================


        Do not forget to chmod +x it.



        In addition you may add 'user,nofail' options in your fstab cifs entries.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 24 at 17:54









        Autumn FoxAutumn Fox

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412508%2fopensuse-leap-42-3-how-to-mount-a-cifs-file-share-at-boot-when-the-network-won%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀