Systemd, network shares and mount -a [Solved]

Issues Related to Networking (Wired and Wireless)

Moderator: Moderators

Systemd, network shares and mount -a [Solved]

Postby tollgate » Wed Mar 12, 2014 9:18

Just switched to systemd a few days ago.

Previously with openRC, my network shares listed in fstab would never mount on boot. I always assumed this was because fstab was read before the network was started. Once boooted, "mount -a" would mount everything listed in fstab.

Now, with systemd, my network shares still do not mount on boot, which I expected, but "mount -a" no longer seems to do anything. To mount my network shares i now have to issue the command:

Code: Select all
systemctl start home-steve-vista-Temp.mount


or similar for each and every network share.

Is this normal behaviour?
Last edited by tollgate on Wed Mar 12, 2014 15:00, edited 1 time in total.
tollgate
Growing Hen
 
Posts: 105
Joined: Thu May 31, 2012 3:57
Location: Jomtien, Thailand

Re: Systemd, network shares and mount -a

Postby belcocco » Wed Mar 12, 2014 10:32

1)Info Sabayon wiki: https://wiki.sabayon.org/index.php?titl ... tem_mounts
2)Please output:
#systemctl | grep auto
Ciao
belcocco
Old Dear Hen
 
Posts: 452
Joined: Sat Nov 29, 2008 18:53
Location: Milan, Italy

Re: Systemd, network shares and mount -a

Postby tollgate » Wed Mar 12, 2014 10:44

Code: Select all
sabayon-work steve # systemctl | grep auto
proc-sys-fs-binfmt_misc.automount                                                                                       loaded active waiting   Arbitrary Executable File Formats File System Automount Point
tollgate
Growing Hen
 
Posts: 105
Joined: Thu May 31, 2012 3:57
Location: Jomtien, Thailand

Re: Systemd, network shares and mount -a

Postby belcocco » Wed Mar 12, 2014 12:28

On my system proc-sys-fs-binfmt_misc.automount is "loaded active running"
From here http://www.freedesktop.org/wiki/Softwar ... leSystems/ read:
The systemd service systemd-remount-fs.service is responsible for applying mount parameters from /etc/fstab to the actual mounts.

Please output:
#cat /etc/fstab
#systemctl | grep mount
Ciao
belcocco
Old Dear Hen
 
Posts: 452
Joined: Sat Nov 29, 2008 18:53
Location: Milan, Italy

Re: Systemd, network shares and mount -a

Postby tollgate » Wed Mar 12, 2014 12:45

Code: Select all
sabayon-work steve # cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Aug 19 02:28:03 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=09032e45-3926-427a-9b4f-83f14a8c9d99 /                       ext4    defaults        1 1
/dev/sda2 /home                   ext4    defaults,user_xattr        1 2
UUID=1d7eccae-8703-4660-9102-076abf4e2be7 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

//192.168.0.1/temp /home/steve/vista/Temp cifs user,username=xxxxx,password=xxxxx,auto,rw,uid=1000,gid=1000 0 0

//192.168.0.1/Dropbox /home/steve/vista/dropbox cifs user,username=xxxx,password=xxxxx,auto,rw,uid=1000,gid=1000 0 0



Code: Select all
sabayon-work steve # systemctl | grep mount
proc-sys-fs-binfmt_misc.automount                                                                                       loaded active waiting   Arbitrary Executable File Formats File System Automount Point
-.mount                                                                                                                 loaded active mounted   /
dev-hugepages.mount                                                                                                     loaded active mounted   Huge Pages File System
dev-mqueue.mount                                                                                                        loaded active mounted   POSIX Message Queue File System
home-steve-vista-dropbox.mount                                                                                          loaded active mounted   /home/steve/vista/dropbox
home-steve-vista-Temp.mount                                                                                             loaded active mounted   /home/steve/vista/Temp
home.mount                                                                                                              loaded active mounted   /home
run-media-steve-backupUSB.mount                                                                                         loaded active mounted   /run/media/steve/backupUSB
run-media-steve-TOSHIBA\x20EXT.mount                                                                                    loaded active mounted   /run/media/steve/TOSHIBA EXT
run-user-1000-gvfs.mount                                                                                                loaded active mounted   /run/user/1000/gvfs
sys-fs-fuse-connections.mount                                                                                           loaded active mounted   FUSE Control File System
sys-kernel-debug.mount                                                                                                  loaded active mounted   Debug File System
tmp.mount                                                                                                               loaded active mounted   Temporary Directory
systemd-remount-fs.service                                                                                              loaded active exited    Remount Root and Kernel File Systems
tollgate
Growing Hen
 
Posts: 105
Joined: Thu May 31, 2012 3:57
Location: Jomtien, Thailand

Re: Systemd, network shares and mount -a

Postby belcocco » Wed Mar 12, 2014 14:39

Try to edit your file /etc/fstab and add this options on the line of the remote filesystems:
noauto, x-systemd.automount

The file should become so:
Code: Select all
#
# /etc/fstab
# Created by anaconda on Sun Aug 19 02:28:03 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=09032e45-3926-427a-9b4f-83f14a8c9d99 /                       ext4    defaults        1 1
/dev/sda2 /home                   ext4    defaults,user_xattr        1 2
UUID=1d7eccae-8703-4660-9102-076abf4e2be7 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

//192.168.0.1/temp /home/steve/vista/Temp cifs user,username=xxxxx,password=xxxxx,noauto, x-systemd.automount,rw,uid=1000,gid=1000 0 0

//192.168.0.1/Dropbox /home/steve/vista/dropbox cifs user,username=xxxx,password=xxxxx,noauto, x-systemd.automount,rw,uid=1000,gid=1000 0 0

Good luck :D
Ciao
belcocco
Old Dear Hen
 
Posts: 452
Joined: Sat Nov 29, 2008 18:53
Location: Milan, Italy

Re: Systemd, network shares and mount -a [Solved]

Postby tollgate » Wed Mar 12, 2014 15:01

belcocco - thank you so much. That fixed it. First time my cifs shares have mounted on boot since .... well I cannot remember.
tollgate
Growing Hen
 
Posts: 105
Joined: Thu May 31, 2012 3:57
Location: Jomtien, Thailand


Return to Networking and Wireless

Who is online

Users browsing this forum: No registered users and 1 guest