Page 1 of 1

install raspbian on an nfs share

Posted: Fri Feb 15, 2019 3:06 pm
by lucian
Hello all,

Is it possible to install raspbian on an nfs share and boot from the sd card? Let me clarify:

I have a raspberry pi which I want to protect against power cuts by installing the os on an NFS share on a server I have in the attic which is backed by UPS. The boot partition could reside on the sd card. I know this setup is possible because I have tried it on a second raspberry pi running OSMC and they provide an NFS install option.

Is it possible to do the same for raspbian?

Re: install raspbian on an nfs share

Posted: Fri Feb 15, 2019 6:55 pm
by rpdom
Yes.

It has been possible since almost the first version. I did run one for a while.

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 10:33 am
by lucian
Thank you for your response. Can you please point me towards some documentation about how to achieve this?

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 12:11 pm
by incognitum
lucian wrote:
Mon Feb 18, 2019 10:33 am
Can you please point me towards some documentation about how to achieve this?
Writable root on NFS: https://www.raspberrypi.org/documentati ... utorial.md
Do note that it is only safe to do so in a private home network to which nobody else but you has access.
As anyone connected to the network will have full write access to the NFS share without any authentication whatsoever.

Read-only root on NFS, writable home folder using SSHFS: https://www.raspberrypi.org/blog/piserver/
Does is secure. But to get writable storage a user must be logged-in to the Raspberry, so only suitable for desktop use and not for server.

Using iSCSI instead of NFS: https://www.berryterminal.com/doku.php/ ... sing_iscsi
Secure, as access to the iSCSI storage is protected by password stored on SD card.
Does require that you either use Berryboot or some other initramfs construct to get the connection setup, as Linux kernel alone cannot do this without help.

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 2:00 pm
by lucian
@incognitum Thank you very much for your message! I will give the first method a go since this will take place on my own local network withouth any input from the outside. One question thow: is this applicable to a Raspberry Pi of the first generation?

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 2:28 pm
by incognitum
lucian wrote:
Mon Feb 18, 2019 2:00 pm
@incognitum Thank you very much for your message! I will give the first method a go since this will take place on my own local network withouth any input from the outside. One question thow: is this applicable to a Raspberry Pi of the first generation?
You have two options:

- Putting just bootcode.bin ( https://github.com/raspberrypi/firmware ... otcode.bin ) on SD card and no other files.
That will make even older Pi perform a PXE network boot.

- Having all boot files (firmware files and Linux kernel) on SD card, and editing cmdline.txt to use NFS for the root file system.
In that case do follow the instructions for setting up nfs, but do not do the dnsmasq and tftp stuff.

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 2:31 pm
by lucian
Cool stuff! I will try this tonight! Thank you so much for your help! The information is exactly what I needed!

Re: install raspbian on an nfs share

Posted: Mon Feb 18, 2019 2:33 pm
by B.Goode
is this applicable to a Raspberry Pi of the first generation?

Via factory-fresh hardware alone, No.


But for a workaround involving a microSD card that is only used at the very earliest stages of the boot process, see the Raspberry Pi Foundation documentation here: https://www.raspberrypi.org/documentati ... /README.md

Specifically, the section headed "Special bootcode.bin-only boot mode "


Edit: already mentioned in a reply as I typed this, but left here as it includes reference to the background explanation not just the 'magic' fix.