lucian
Posts: 17
Joined: Wed May 08, 2013 10:33 am

install raspbian on an nfs share

Fri Feb 15, 2019 3:06 pm

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?

User avatar
rpdom
Posts: 17170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: install raspbian on an nfs share

Fri Feb 15, 2019 6:55 pm

Yes.

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

lucian
Posts: 17
Joined: Wed May 08, 2013 10:33 am

Re: install raspbian on an nfs share

Mon Feb 18, 2019 10:33 am

Thank you for your response. Can you please point me towards some documentation about how to achieve this?

incognitum
Posts: 495
Joined: Tue Oct 30, 2018 3:34 pm

Re: install raspbian on an nfs share

Mon Feb 18, 2019 12:11 pm

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.

lucian
Posts: 17
Joined: Wed May 08, 2013 10:33 am

Re: install raspbian on an nfs share

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?

incognitum
Posts: 495
Joined: Tue Oct 30, 2018 3:34 pm

Re: install raspbian on an nfs share

Mon Feb 18, 2019 2:28 pm

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.

lucian
Posts: 17
Joined: Wed May 08, 2013 10:33 am

Re: install raspbian on an nfs share

Mon Feb 18, 2019 2:31 pm

Cool stuff! I will try this tonight! Thank you so much for your help! The information is exactly what I needed!

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: install raspbian on an nfs share

Mon Feb 18, 2019 2:33 pm

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.

Return to “General discussion”