minghia
Posts: 5
Joined: Fri May 18, 2018 11:31 am

nfs mount /usr at boot time

Thu May 31, 2018 9:44 am

I'm trying to boot my Raspberry Pi 3B via NFS. I have got the system booting if I have everything under the one directory and use that in my cmdline.txt file. However since I plan to have 20 such system booting over nfs I also want to have a common /usr directory. I have found a few suggestions online but none of them work. If I do what you traditionally did by having a line in your /etc/fstab , the system hangs on boot. If I move the usr directory under the root share then it boots just fine. I am not that familiar with systemd but surely this is possible to have /usr mounted from a NFS server?

ejolson
Posts: 5373
Joined: Tue Mar 18, 2014 11:47 am

Re: nfs mount /usr at boot time

Fri Jun 01, 2018 4:59 am

minghia wrote:
Thu May 31, 2018 9:44 am
I'm trying to boot my Raspberry Pi 3B via NFS. I have got the system booting if I have everything under the one directory and use that in my cmdline.txt file. However since I plan to have 20 such system booting over nfs I also want to have a common /usr directory. I have found a few suggestions online but none of them work. If I do what you traditionally did by having a line in your /etc/fstab , the system hangs on boot. If I move the usr directory under the root share then it boots just fine. I am not that familiar with systemd but surely this is possible to have /usr mounted from a NFS server?
This sort of thing used to work, but the line has been blurred between /usr/bin and /bin as well as between /usr/sbin and /sbin by thousands of people who only considered the usage scenario of local storage with one partition.

My solution is to use BTRFS on the NFS server. Each client mounts a complete root filesystem from the server and copy-on-write semantics with deduplication ensures that the files which are identical between each of the root filesystems don't take additional space. When adding another diskless (cardless) system all that is needed is to create a writable snapshot of an existing root filesystem, which compared to copying the files is instantaneous. More information how to do this is contained in this post which is part of my thread on setting up a super-cheap cluster.

Return to “Advanced users”