CIFS mount through fstab not mounting at boot
up vote
15
down vote
favorite
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
|
show 2 more comments
up vote
15
down vote
favorite
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
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
|
show 2 more comments
up vote
15
down vote
favorite
up vote
15
down vote
favorite
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
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
fstab automount
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
|
show 2 more comments
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
|
show 2 more comments
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.
add a comment |
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.
Can you add context to where that would be placed in thefstab
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
|
show 2 more comments
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
thank you, this worked for me in 18.04 LTS
– Chief
Jul 19 at 23:44
add a comment |
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.
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
add a comment |
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
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. Executingsudo 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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 4 '14 at 15:35
Panther
77.1k12155258
77.1k12155258
add a comment |
add a comment |
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.
Can you add context to where that would be placed in thefstab
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
|
show 2 more comments
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.
Can you add context to where that would be placed in thefstab
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
|
show 2 more comments
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.
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.
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 thefstab
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
|
show 2 more comments
Can you add context to where that would be placed in thefstab
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
|
show 2 more comments
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
thank you, this worked for me in 18.04 LTS
– Chief
Jul 19 at 23:44
add a comment |
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
thank you, this worked for me in 18.04 LTS
– Chief
Jul 19 at 23:44
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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
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. Executingsudo 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
add a comment |
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
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. Executingsudo 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
add a comment |
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
-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
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. Executingsudo 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
add a comment |
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. Executingsudo 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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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