bookedirl
Posts: 15
Joined: Sat Sep 05, 2015 3:25 am

Auto mount network drive Issue - Jessie

Sun Oct 18, 2015 3:06 pm

I'm having some trouble with mounting my network drive on boot. I did a fresh install of jessie and this was the first thing I tried doing. Once I reboot I can see my usb drive being mounted then after that when it says:

Code: Select all

Oct 18 03:40:41 raspberrypi systemd[1]: Starting ifup for eth0...
Oct 18 03:40:41 raspberrypi systemd[1]: Started ifup for eth0.
Oct 18 03:40:41 raspberrypi systemd[1]: Starting Network.
Oct 18 03:40:41 raspberrypi systemd[1]: Reached target Network.
Oct 18 03:40:41 raspberrypi systemd[1]: Starting Network is Online.
Oct 18 03:40:41 raspberrypi ifup[418]: /sbin/ifup: interface eth0 already configured
Oct 18 03:40:41 raspberrypi systemd[1]: Reached target Network is Online.
Oct 18 03:40:41 raspberrypi systemd[1]: Mounting /mnt/media...
Oct 18 03:40:41 raspberrypi mount[420]: mount error(101): Network is unreachable
Oct 18 03:40:41 raspberrypi mount[420]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Oct 18 03:40:41 raspberrypi systemd[1]: mnt-media.mount mount process exited, code=exited status=32
Oct 18 03:40:41 raspberrypi systemd[1]: Failed to mount /mnt/media.
Oct 18 03:40:41 raspberrypi systemd[1]: Dependency failed for Remote File Systems.
Oct 18 03:40:41 raspberrypi systemd[1]: Unit mnt-media.mount entered failed state.
Here's my fstab (<name> and <pass> contain correct name and pass)
//192.168.1.38/Media /mnt/media cifs username=<name>,password=<pass>,uid=1000,gid=1000,_netdev 0 0

If I do a mount -a when logged in it works so I'm not sure whats going on here. Anyone have any ideas?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand

Re: Auto mount network drive Issue - Jessie

Mon Oct 19, 2015 5:43 am

it means that also with JESSIE the "cifs" mount problem is still not solved.
as work around you could put the command line
sudo mount -a in a login startup ..
i try to keep all that settings together in one file like in nano .bash_aliases

if you search the forum you will find many remarks not use "cifs", better NFS

User avatar
DougieLawson
Posts: 42483
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Auto mount network drive Issue - Jessie

Mon Oct 19, 2015 7:43 am

bookedirl wrote: //192.168.1.38/Media /mnt/media cifs username=<name>,password=<pass>,uid=1000,gid=1000,_netdev 0 0
... Anyone have any ideas?
Add

Code: Select all

,x-systemd.automount
after

Code: Select all

_netdev
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

bookedirl
Posts: 15
Joined: Sat Sep 05, 2015 3:25 am

Re: Auto mount network drive Issue - Jessie

Mon Oct 19, 2015 7:26 pm

DougieLawson wrote:
bookedirl wrote:
Add

Code: Select all

,x-systemd.automount
after

Code: Select all

_netdev

I tried this but it did not work for cifs apparently

Code: Select all

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Auto mount network drive Issue - Jessie

Mon Oct 19, 2015 7:54 pm

It works for cifs. I use it to mount a share on a FreeNAS box. When I upgraded to Jessie it no longer mounted at boot, but now it's ready before I am. You must have a typo somewhere in the line, or something out of place. Here is the line I'm using in fstab

Code: Select all

//192.168.0.98/NetworkFolder /home/jimmy/network-folder cifs credentials=/home/jimmy/.smbcredentials,uid=jimmy,gid=jimmy,_netdev,x-systemd.automount 0 0

bookedirl
Posts: 15
Joined: Sat Sep 05, 2015 3:25 am

Re: Auto mount network drive Issue - Jessie

Mon Oct 19, 2015 8:10 pm

Ok, I apologize I have 2 pis/puttys open one has wheezy other has jessie.. when I call this code it doesn't throw any errors. However, when I reboot the pi and see if it mounts properly it gives the same error as in post 1.

Code: Select all

//192.168.1.38/Media /mnt/media cifs username=name,password=pass,uid=1000,gid=1000,_netdev,x-systemd.automount 0 0
I feel like this should just work with the _netdev option based on what I read up on it.. I don't want to do a work-a-round if I don't need to but I guess I will if I can't figure out what's causing not to mount on boot. Could any other settings be effecting this?

kaosrq
Posts: 1
Joined: Wed Nov 18, 2015 3:30 am

Re: Auto mount network drive Issue - Jessie

Wed Nov 18, 2015 3:37 am

in my case, solve it by editing the network interface, to automatically start with dhcp,

edit:

Code: Select all

sudo nano /etc/network/interfaces

add as applicable:

Code: Select all

auto eth0
iface eth0 net dhcp


auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

User avatar
Gedarius
Posts: 2
Joined: Sun Jul 10, 2016 8:57 pm
Location: são paulo

Re: Auto mount network drive Issue - Jessie

Sun Jul 10, 2016 9:28 pm

Hello,

sorry to late reply, but i had the same problem and this is how i solve it:

first give permission to your mount point:

Code: Select all

sudo chown -R pi:pi /mnt/HD1
sudo chmod -R 775 /mnt/HD1
sudo setfacl -Rdm g:pi:rwx /mnt/HD1
sudo setfacl -Rm g:pi:rwx /mnt/HD1
then, write the line below in the fstab:

Code: Select all

//192.168.0.111/myNetworkFolder     /mnt/HD1   cifs username=MyUsr,password=MyPass,sec=ntlm,uid=pi,gid=pi,_netdev,xsystemd.automount 0 0
username and password parameters are credentials of you network drive, in my case, its a FTP from my router (a USB pendrive)

pay attention on the sec=ntlm parameter, this make all the difference for me

this is it, reboot your raspberry and see it works =]

CraziFuzzy
Posts: 1
Joined: Tue Aug 02, 2016 7:03 am

Re: Auto mount network drive Issue - Jessie

Tue Aug 02, 2016 7:06 am

Gedarius wrote:Hello,

sorry to late reply, but i had the same problem and this is how i solve it:

first give permission to your mount point:

Code: Select all

sudo chown -R pi:pi /mnt/HD1
sudo chmod -R 775 /mnt/HD1
sudo setfacl -Rdm g:pi:rwx /mnt/HD1
sudo setfacl -Rm g:pi:rwx /mnt/HD1
then, write the line below in the fstab:

Code: Select all

//192.168.0.111/myNetworkFolder     /mnt/HD1   cifs username=MyUsr,password=MyPass,sec=ntlm,uid=pi,gid=pi,_netdev,xsystemd.automount 0 0
username and password parameters are credentials of you network drive, in my case, its a FTP from my router (a USB pendrive)

pay attention on the sec=ntlm parameter, this make all the difference for me

this is it, reboot your raspberry and see it works =]
xsystemd.automount causes the mount to choke with an Invalid argument - it won't even work with a 'sudo mount -a'. removing it and at least sudo mount -a works.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Auto mount network drive Issue - Jessie

Wed Aug 03, 2016 9:46 am

That's probably because it should be "x-systemd.automount", rather than "xsystemd.automount".

Return to “Beginners”