CIFS mount through fstab not mounting at boot











up vote
15
down vote

favorite
4












I have a CIFS share on my NAS that I want to have mounted at boot - it's used by my MythTV server as the main media store. I added an entry into fstab to have it mount but it doesn't. It appears that, after looking through my system logs, fstab is being read before my network interfaces are coming online. Is there any edit I can make to the fstab entry that would alter this?



The fstab entry for mounting the share is:



\192.168.0.26mythtvmedia  /media/mybooklive  cifs  username=user,password=pass,umask=002,uid=136,gid=144,iocharset=utf8   0       0


It mounts fine after boot when I issue sudo mount -a and there are no other issues with it.



Thanks!










share|improve this question


















  • 2




    If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
    – Panther
    Jan 3 '14 at 21:01










  • @bodhi.zazen It may have had the / when I entered it, but it now reads out with the
    – douggro
    Jan 3 '14 at 22:42










  • Check the syntax ( / vs ) in fstab
    – Panther
    Jan 3 '14 at 22:43










  • @bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
    – douggro
    Jan 4 '14 at 1:00






  • 1




    @bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
    – douggro
    Jan 4 '14 at 9:12















up vote
15
down vote

favorite
4












I have a CIFS share on my NAS that I want to have mounted at boot - it's used by my MythTV server as the main media store. I added an entry into fstab to have it mount but it doesn't. It appears that, after looking through my system logs, fstab is being read before my network interfaces are coming online. Is there any edit I can make to the fstab entry that would alter this?



The fstab entry for mounting the share is:



\192.168.0.26mythtvmedia  /media/mybooklive  cifs  username=user,password=pass,umask=002,uid=136,gid=144,iocharset=utf8   0       0


It mounts fine after boot when I issue sudo mount -a and there are no other issues with it.



Thanks!










share|improve this question


















  • 2




    If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
    – Panther
    Jan 3 '14 at 21:01










  • @bodhi.zazen It may have had the / when I entered it, but it now reads out with the
    – douggro
    Jan 3 '14 at 22:42










  • Check the syntax ( / vs ) in fstab
    – Panther
    Jan 3 '14 at 22:43










  • @bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
    – douggro
    Jan 4 '14 at 1:00






  • 1




    @bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
    – douggro
    Jan 4 '14 at 9:12













up vote
15
down vote

favorite
4









up vote
15
down vote

favorite
4






4





I have a CIFS share on my NAS that I want to have mounted at boot - it's used by my MythTV server as the main media store. I added an entry into fstab to have it mount but it doesn't. It appears that, after looking through my system logs, fstab is being read before my network interfaces are coming online. Is there any edit I can make to the fstab entry that would alter this?



The fstab entry for mounting the share is:



\192.168.0.26mythtvmedia  /media/mybooklive  cifs  username=user,password=pass,umask=002,uid=136,gid=144,iocharset=utf8   0       0


It mounts fine after boot when I issue sudo mount -a and there are no other issues with it.



Thanks!










share|improve this question













I have a CIFS share on my NAS that I want to have mounted at boot - it's used by my MythTV server as the main media store. I added an entry into fstab to have it mount but it doesn't. It appears that, after looking through my system logs, fstab is being read before my network interfaces are coming online. Is there any edit I can make to the fstab entry that would alter this?



The fstab entry for mounting the share is:



\192.168.0.26mythtvmedia  /media/mybooklive  cifs  username=user,password=pass,umask=002,uid=136,gid=144,iocharset=utf8   0       0


It mounts fine after boot when I issue sudo mount -a and there are no other issues with it.



Thanks!







fstab automount






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 3 '14 at 19:05









douggro

2,07631222




2,07631222








  • 2




    If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
    – Panther
    Jan 3 '14 at 21:01










  • @bodhi.zazen It may have had the / when I entered it, but it now reads out with the
    – douggro
    Jan 3 '14 at 22:42










  • Check the syntax ( / vs ) in fstab
    – Panther
    Jan 3 '14 at 22:43










  • @bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
    – douggro
    Jan 4 '14 at 1:00






  • 1




    @bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
    – douggro
    Jan 4 '14 at 9:12














  • 2




    If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
    – Panther
    Jan 3 '14 at 21:01










  • @bodhi.zazen It may have had the / when I entered it, but it now reads out with the
    – douggro
    Jan 3 '14 at 22:42










  • Check the syntax ( / vs ) in fstab
    – Panther
    Jan 3 '14 at 22:43










  • @bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
    – douggro
    Jan 4 '14 at 1:00






  • 1




    @bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
    – douggro
    Jan 4 '14 at 9:12








2




2




If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
– Panther
Jan 3 '14 at 21:01




If the server is running Ubuntu, it is likely you need a / rather then a - "//192.168.0.26/mythtv/media " See wiki.ubuntu.com/MountWindowsSharesPermanently
– Panther
Jan 3 '14 at 21:01












@bodhi.zazen It may have had the / when I entered it, but it now reads out with the
– douggro
Jan 3 '14 at 22:42




@bodhi.zazen It may have had the / when I entered it, but it now reads out with the
– douggro
Jan 3 '14 at 22:42












Check the syntax ( / vs ) in fstab
– Panther
Jan 3 '14 at 22:43




Check the syntax ( / vs ) in fstab
– Panther
Jan 3 '14 at 22:43












@bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
– douggro
Jan 4 '14 at 1:00




@bodhi.zazen I'm pretty sure that the wiki article is what I followed when setting it up. I'll check syntax later when I get time to sit with my server.
– douggro
Jan 4 '14 at 1:00




1




1




@bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
– douggro
Jan 4 '14 at 9:12




@bodhi.zazen Please convert your comment to an answer - changing the to / solved it.
– douggro
Jan 4 '14 at 9:12










5 Answers
5






active

oldest

votes

















up vote
7
down vote



accepted










It is a syntax error, I think you need a "/" rather then a "", like this



//192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8  0 0


See : https://wiki.ubuntu.com/MountWindowsSharesPermanently for additional information.






share|improve this answer




























    up vote
    19
    down vote













    Have you tried adding the option _netdev to your fstab entry? You would add it with the other options in your string like so



    //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8   0       0


    _netdev is supposed to delay the mount until after the network connects.






    share|improve this answer























    • Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
      – douggro
      Jan 3 '14 at 20:33










    • Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
      – douggro
      Jan 4 '14 at 9:13






    • 1




      This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
      – Katu
      Apr 25 '16 at 14:46






    • 1




      Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
      – jb510
      Jun 5 '16 at 2:59






    • 1




      I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
      – djmadscribbler
      Aug 1 '16 at 18:01


















    up vote
    9
    down vote













    if _netdev doesn't work, try the option:




    x-systemd.automount




    instead. It works by mounting the drive at first access.



    To test the automount, unmount your share if it's currently mounted:



    $ sudo umount /media/mybooklive


    And then restart the remote-fs systemd unit:



    $ sudo systemctl daemon-reload
    $ sudo systemctl restart remote-fs.target





    share|improve this answer























    • thank you, this worked for me in 18.04 LTS
      – Chief
      Jul 19 at 23:44


















    up vote
    4
    down vote













    I am using the Raspbian-Stretch build dated 2017-09-07 and experienced the same issue. However, I was able to overcome this by going into raspi-config and under the Boot Options menu, I enabled the "Wait for network at boot" option.






    share|improve this answer





















    • This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
      – Alfred Espinosa
      May 7 at 19:29


















    up vote
    2
    down vote













    -Using forward slashes (/) did NOT fix it for me.

    -Also, adding the option _netdev to my /etc/fstab entry did NOT fix it for me.



    What I have done to fix this problem (on my Pi3) is modify /etc/rc.local to sleep 20 seconds (by calling sleep 20) and then call mount -a. This way, even though the network is NOT connected yet when the system first reads the fstab file, so the mount fails then, I force the system to wait 20 seconds here (giving the network time to connect) then I force it to call mount -a again to mount all drives in the fstab file.



    Here is what my /etc/rc.local file now looks like:



    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.

    # Print the IP address
    #GS notes: a *minimum* of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
    sleep 20
    _IP=$(hostname -I) || true
    if [ "$_IP" ]; then
    printf "My IP address is %sn" "$_IP"
    mount -a #GS: mount all drives in /etc/fstab
    fi

    exit 0


    Done! It now works perfectly for me!



    References:




    • https://raspberrypi.stackexchange.com/a/63690/49091

    • https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

    • http://elinux.org/RPi_Email_IP_On_Boot_Debian






    share|improve this answer























    • Are you connecting via wifi?
      – cbcoutinho
      Nov 17 '17 at 22:27










    • Yes, I'm using WiFi instead of ethernet.
      – Gabriel Staples
      Nov 21 '17 at 13:41










    • That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
      – cbcoutinho
      Nov 21 '17 at 13:58











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f399643%2fcifs-mount-through-fstab-not-mounting-at-boot%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    7
    down vote



    accepted










    It is a syntax error, I think you need a "/" rather then a "", like this



    //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8  0 0


    See : https://wiki.ubuntu.com/MountWindowsSharesPermanently for additional information.






    share|improve this answer

























      up vote
      7
      down vote



      accepted










      It is a syntax error, I think you need a "/" rather then a "", like this



      //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8  0 0


      See : https://wiki.ubuntu.com/MountWindowsSharesPermanently for additional information.






      share|improve this answer























        up vote
        7
        down vote



        accepted







        up vote
        7
        down vote



        accepted






        It is a syntax error, I think you need a "/" rather then a "", like this



        //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8  0 0


        See : https://wiki.ubuntu.com/MountWindowsSharesPermanently for additional information.






        share|improve this answer












        It is a syntax error, I think you need a "/" rather then a "", like this



        //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8  0 0


        See : https://wiki.ubuntu.com/MountWindowsSharesPermanently for additional information.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 4 '14 at 15:35









        Panther

        77.1k12155258




        77.1k12155258
























            up vote
            19
            down vote













            Have you tried adding the option _netdev to your fstab entry? You would add it with the other options in your string like so



            //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8   0       0


            _netdev is supposed to delay the mount until after the network connects.






            share|improve this answer























            • Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
              – douggro
              Jan 3 '14 at 20:33










            • Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
              – douggro
              Jan 4 '14 at 9:13






            • 1




              This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
              – Katu
              Apr 25 '16 at 14:46






            • 1




              Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
              – jb510
              Jun 5 '16 at 2:59






            • 1




              I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
              – djmadscribbler
              Aug 1 '16 at 18:01















            up vote
            19
            down vote













            Have you tried adding the option _netdev to your fstab entry? You would add it with the other options in your string like so



            //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8   0       0


            _netdev is supposed to delay the mount until after the network connects.






            share|improve this answer























            • Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
              – douggro
              Jan 3 '14 at 20:33










            • Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
              – douggro
              Jan 4 '14 at 9:13






            • 1




              This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
              – Katu
              Apr 25 '16 at 14:46






            • 1




              Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
              – jb510
              Jun 5 '16 at 2:59






            • 1




              I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
              – djmadscribbler
              Aug 1 '16 at 18:01













            up vote
            19
            down vote










            up vote
            19
            down vote









            Have you tried adding the option _netdev to your fstab entry? You would add it with the other options in your string like so



            //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8   0       0


            _netdev is supposed to delay the mount until after the network connects.






            share|improve this answer














            Have you tried adding the option _netdev to your fstab entry? You would add it with the other options in your string like so



            //192.168.0.26/mythtv/media  /media/mybooklive  cifs  username=user,password=pass,_netdev,umask=002,uid=136,gid=144,iocharset=utf8   0       0


            _netdev is supposed to delay the mount until after the network connects.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 29 '16 at 17:32

























            answered Jan 3 '14 at 19:22









            djmadscribbler

            356210




            356210












            • Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
              – douggro
              Jan 3 '14 at 20:33










            • Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
              – douggro
              Jan 4 '14 at 9:13






            • 1




              This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
              – Katu
              Apr 25 '16 at 14:46






            • 1




              Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
              – jb510
              Jun 5 '16 at 2:59






            • 1




              I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
              – djmadscribbler
              Aug 1 '16 at 18:01


















            • Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
              – douggro
              Jan 3 '14 at 20:33










            • Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
              – douggro
              Jan 4 '14 at 9:13






            • 1




              This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
              – Katu
              Apr 25 '16 at 14:46






            • 1




              Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
              – jb510
              Jun 5 '16 at 2:59






            • 1




              I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
              – djmadscribbler
              Aug 1 '16 at 18:01
















            Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
            – douggro
            Jan 3 '14 at 20:33




            Can you add context to where that would be placed in the fstab line? With that, and a period where I can reboot the server when it's not being used, I will give it a try. Thanks for answering.
            – douggro
            Jan 3 '14 at 20:33












            Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
            – douggro
            Jan 4 '14 at 9:13




            Turns out bodhi.zazen had the right track with his comment. I did give you an upvote for your help. Thanks!
            – douggro
            Jan 4 '14 at 9:13




            1




            1




            This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
            – Katu
            Apr 25 '16 at 14:46




            This worked for me in Ubuntu 12.04 but not in Ubuntu 16.04. Has this changed in the latest version?
            – Katu
            Apr 25 '16 at 14:46




            1




            1




            Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
            – jb510
            Jun 5 '16 at 2:59




            Note: I think _netdev actually works in 16.04, however credentials=/home/user/.smbcreds does no longer works. At least for me when I use user=, pass=, _netdev it works, when I use credentials=,_netdev it does not. Both work via sudo mount-a from the command line after booting.
            – jb510
            Jun 5 '16 at 2:59




            1




            1




            I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
            – djmadscribbler
            Aug 1 '16 at 18:01




            I actually think this might have more to do with the permission changes that were made to the media folder. At some point, Ubuntu started mounting things to /media/username/folder name rather than /media/folder name. If don't mount to the "username" location then you have to have sudo level permissions for access. If you change your path to use the /media/username path I think it should still work.
            – djmadscribbler
            Aug 1 '16 at 18:01










            up vote
            9
            down vote













            if _netdev doesn't work, try the option:




            x-systemd.automount




            instead. It works by mounting the drive at first access.



            To test the automount, unmount your share if it's currently mounted:



            $ sudo umount /media/mybooklive


            And then restart the remote-fs systemd unit:



            $ sudo systemctl daemon-reload
            $ sudo systemctl restart remote-fs.target





            share|improve this answer























            • thank you, this worked for me in 18.04 LTS
              – Chief
              Jul 19 at 23:44















            up vote
            9
            down vote













            if _netdev doesn't work, try the option:




            x-systemd.automount




            instead. It works by mounting the drive at first access.



            To test the automount, unmount your share if it's currently mounted:



            $ sudo umount /media/mybooklive


            And then restart the remote-fs systemd unit:



            $ sudo systemctl daemon-reload
            $ sudo systemctl restart remote-fs.target





            share|improve this answer























            • thank you, this worked for me in 18.04 LTS
              – Chief
              Jul 19 at 23:44













            up vote
            9
            down vote










            up vote
            9
            down vote









            if _netdev doesn't work, try the option:




            x-systemd.automount




            instead. It works by mounting the drive at first access.



            To test the automount, unmount your share if it's currently mounted:



            $ sudo umount /media/mybooklive


            And then restart the remote-fs systemd unit:



            $ sudo systemctl daemon-reload
            $ sudo systemctl restart remote-fs.target





            share|improve this answer














            if _netdev doesn't work, try the option:




            x-systemd.automount




            instead. It works by mounting the drive at first access.



            To test the automount, unmount your share if it's currently mounted:



            $ sudo umount /media/mybooklive


            And then restart the remote-fs systemd unit:



            $ sudo systemctl daemon-reload
            $ sudo systemctl restart remote-fs.target






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 15 at 17:16









            bonh

            1035




            1035










            answered Sep 9 '16 at 19:06









            t-dome

            9111




            9111












            • thank you, this worked for me in 18.04 LTS
              – Chief
              Jul 19 at 23:44


















            • thank you, this worked for me in 18.04 LTS
              – Chief
              Jul 19 at 23:44
















            thank you, this worked for me in 18.04 LTS
            – Chief
            Jul 19 at 23:44




            thank you, this worked for me in 18.04 LTS
            – Chief
            Jul 19 at 23:44










            up vote
            4
            down vote













            I am using the Raspbian-Stretch build dated 2017-09-07 and experienced the same issue. However, I was able to overcome this by going into raspi-config and under the Boot Options menu, I enabled the "Wait for network at boot" option.






            share|improve this answer





















            • This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
              – Alfred Espinosa
              May 7 at 19:29















            up vote
            4
            down vote













            I am using the Raspbian-Stretch build dated 2017-09-07 and experienced the same issue. However, I was able to overcome this by going into raspi-config and under the Boot Options menu, I enabled the "Wait for network at boot" option.






            share|improve this answer





















            • This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
              – Alfred Espinosa
              May 7 at 19:29













            up vote
            4
            down vote










            up vote
            4
            down vote









            I am using the Raspbian-Stretch build dated 2017-09-07 and experienced the same issue. However, I was able to overcome this by going into raspi-config and under the Boot Options menu, I enabled the "Wait for network at boot" option.






            share|improve this answer












            I am using the Raspbian-Stretch build dated 2017-09-07 and experienced the same issue. However, I was able to overcome this by going into raspi-config and under the Boot Options menu, I enabled the "Wait for network at boot" option.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 26 '17 at 11:22









            Chris

            411




            411












            • This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
              – Alfred Espinosa
              May 7 at 19:29


















            • This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
              – Alfred Espinosa
              May 7 at 19:29
















            This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
            – Alfred Espinosa
            May 7 at 19:29




            This is actually VERY helpful, i had problems that even if boot said everything OK it did just not mounted it or display folders
            – Alfred Espinosa
            May 7 at 19:29










            up vote
            2
            down vote













            -Using forward slashes (/) did NOT fix it for me.

            -Also, adding the option _netdev to my /etc/fstab entry did NOT fix it for me.



            What I have done to fix this problem (on my Pi3) is modify /etc/rc.local to sleep 20 seconds (by calling sleep 20) and then call mount -a. This way, even though the network is NOT connected yet when the system first reads the fstab file, so the mount fails then, I force the system to wait 20 seconds here (giving the network time to connect) then I force it to call mount -a again to mount all drives in the fstab file.



            Here is what my /etc/rc.local file now looks like:



            #!/bin/sh -e
            #
            # rc.local
            #
            # This script is executed at the end of each multiuser runlevel.
            # Make sure that the script will "exit 0" on success or any other
            # value on error.
            #
            # In order to enable or disable this script just change the execution
            # bits.
            #
            # By default this script does nothing.

            # Print the IP address
            #GS notes: a *minimum* of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
            sleep 20
            _IP=$(hostname -I) || true
            if [ "$_IP" ]; then
            printf "My IP address is %sn" "$_IP"
            mount -a #GS: mount all drives in /etc/fstab
            fi

            exit 0


            Done! It now works perfectly for me!



            References:




            • https://raspberrypi.stackexchange.com/a/63690/49091

            • https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

            • http://elinux.org/RPi_Email_IP_On_Boot_Debian






            share|improve this answer























            • Are you connecting via wifi?
              – cbcoutinho
              Nov 17 '17 at 22:27










            • Yes, I'm using WiFi instead of ethernet.
              – Gabriel Staples
              Nov 21 '17 at 13:41










            • That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
              – cbcoutinho
              Nov 21 '17 at 13:58















            up vote
            2
            down vote













            -Using forward slashes (/) did NOT fix it for me.

            -Also, adding the option _netdev to my /etc/fstab entry did NOT fix it for me.



            What I have done to fix this problem (on my Pi3) is modify /etc/rc.local to sleep 20 seconds (by calling sleep 20) and then call mount -a. This way, even though the network is NOT connected yet when the system first reads the fstab file, so the mount fails then, I force the system to wait 20 seconds here (giving the network time to connect) then I force it to call mount -a again to mount all drives in the fstab file.



            Here is what my /etc/rc.local file now looks like:



            #!/bin/sh -e
            #
            # rc.local
            #
            # This script is executed at the end of each multiuser runlevel.
            # Make sure that the script will "exit 0" on success or any other
            # value on error.
            #
            # In order to enable or disable this script just change the execution
            # bits.
            #
            # By default this script does nothing.

            # Print the IP address
            #GS notes: a *minimum* of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
            sleep 20
            _IP=$(hostname -I) || true
            if [ "$_IP" ]; then
            printf "My IP address is %sn" "$_IP"
            mount -a #GS: mount all drives in /etc/fstab
            fi

            exit 0


            Done! It now works perfectly for me!



            References:




            • https://raspberrypi.stackexchange.com/a/63690/49091

            • https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

            • http://elinux.org/RPi_Email_IP_On_Boot_Debian






            share|improve this answer























            • Are you connecting via wifi?
              – cbcoutinho
              Nov 17 '17 at 22:27










            • Yes, I'm using WiFi instead of ethernet.
              – Gabriel Staples
              Nov 21 '17 at 13:41










            • That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
              – cbcoutinho
              Nov 21 '17 at 13:58













            up vote
            2
            down vote










            up vote
            2
            down vote









            -Using forward slashes (/) did NOT fix it for me.

            -Also, adding the option _netdev to my /etc/fstab entry did NOT fix it for me.



            What I have done to fix this problem (on my Pi3) is modify /etc/rc.local to sleep 20 seconds (by calling sleep 20) and then call mount -a. This way, even though the network is NOT connected yet when the system first reads the fstab file, so the mount fails then, I force the system to wait 20 seconds here (giving the network time to connect) then I force it to call mount -a again to mount all drives in the fstab file.



            Here is what my /etc/rc.local file now looks like:



            #!/bin/sh -e
            #
            # rc.local
            #
            # This script is executed at the end of each multiuser runlevel.
            # Make sure that the script will "exit 0" on success or any other
            # value on error.
            #
            # In order to enable or disable this script just change the execution
            # bits.
            #
            # By default this script does nothing.

            # Print the IP address
            #GS notes: a *minimum* of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
            sleep 20
            _IP=$(hostname -I) || true
            if [ "$_IP" ]; then
            printf "My IP address is %sn" "$_IP"
            mount -a #GS: mount all drives in /etc/fstab
            fi

            exit 0


            Done! It now works perfectly for me!



            References:




            • https://raspberrypi.stackexchange.com/a/63690/49091

            • https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

            • http://elinux.org/RPi_Email_IP_On_Boot_Debian






            share|improve this answer














            -Using forward slashes (/) did NOT fix it for me.

            -Also, adding the option _netdev to my /etc/fstab entry did NOT fix it for me.



            What I have done to fix this problem (on my Pi3) is modify /etc/rc.local to sleep 20 seconds (by calling sleep 20) and then call mount -a. This way, even though the network is NOT connected yet when the system first reads the fstab file, so the mount fails then, I force the system to wait 20 seconds here (giving the network time to connect) then I force it to call mount -a again to mount all drives in the fstab file.



            Here is what my /etc/rc.local file now looks like:



            #!/bin/sh -e
            #
            # rc.local
            #
            # This script is executed at the end of each multiuser runlevel.
            # Make sure that the script will "exit 0" on success or any other
            # value on error.
            #
            # In order to enable or disable this script just change the execution
            # bits.
            #
            # By default this script does nothing.

            # Print the IP address
            #GS notes: a *minimum* of sleep 10 is required for the mount below to work on the Pi 3; it failed with sleep 5, but worked with sleep 10, sleep 15, and sleep 30
            sleep 20
            _IP=$(hostname -I) || true
            if [ "$_IP" ]; then
            printf "My IP address is %sn" "$_IP"
            mount -a #GS: mount all drives in /etc/fstab
            fi

            exit 0


            Done! It now works perfectly for me!



            References:




            • https://raspberrypi.stackexchange.com/a/63690/49091

            • https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

            • http://elinux.org/RPi_Email_IP_On_Boot_Debian







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:56









            Community

            1




            1










            answered Mar 21 '17 at 3:09









            Gabriel Staples

            581620




            581620












            • Are you connecting via wifi?
              – cbcoutinho
              Nov 17 '17 at 22:27










            • Yes, I'm using WiFi instead of ethernet.
              – Gabriel Staples
              Nov 21 '17 at 13:41










            • That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
              – cbcoutinho
              Nov 21 '17 at 13:58


















            • Are you connecting via wifi?
              – cbcoutinho
              Nov 17 '17 at 22:27










            • Yes, I'm using WiFi instead of ethernet.
              – Gabriel Staples
              Nov 21 '17 at 13:41










            • That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
              – cbcoutinho
              Nov 21 '17 at 13:58
















            Are you connecting via wifi?
            – cbcoutinho
            Nov 17 '17 at 22:27




            Are you connecting via wifi?
            – cbcoutinho
            Nov 17 '17 at 22:27












            Yes, I'm using WiFi instead of ethernet.
            – Gabriel Staples
            Nov 21 '17 at 13:41




            Yes, I'm using WiFi instead of ethernet.
            – Gabriel Staples
            Nov 21 '17 at 13:41












            That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
            – cbcoutinho
            Nov 21 '17 at 13:58




            That's indeed very strange, but probably not related to my issue. I have three network drives I'm trying to connect through an ethernet cable - no wifi. One of the drives' names has a special character in it, and that causes it to not be connected after a fresh boot. Executing sudo mount -a solves the issue, but I'm curious why it doesn't work while booting up. I'll try your solution and see if that helps.
            – cbcoutinho
            Nov 21 '17 at 13:58


















             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f399643%2fcifs-mount-through-fstab-not-mounting-at-boot%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

            Quarter-circle Tiles

            build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

            Mont Emei