Skip to main content
Topic: Use netmount-runit to automount samba shares/cifs/nfs at boot (Read 177 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Use netmount-runit to automount samba shares/cifs/nfs at boot

netmount-runit from the AUR will automatically mount your samba shares listed in fstab

Add a samba share to your fstab
Ideally, use a protected credentials file too
An example based on what I use, make sure you customize these options for your use case (About uid/gid/filemode) (About CIFS-specific options)
Code: [Select]
/etc/fstab:
//127.0.0.10/Sharename /mnt/sharepath cifs _netdev,nofail,user,uid=1000,gid=1001,file_mode=0700,dir_mode=0700,credentials=/etc/samba/credentials/share,rw,vers=3.0 0 0

Enable the service:

Code: [Select]
ln -s /etc/runit/sv/netmount /run/runit/service

Upon boot, any network share is mounted after waiting for a connection.
The package itself is very simple and has options to specify a network manager, target filesystems, and gateway IP in /etc/runit/sv/netmount/conf. Works out of the box for me though.