User avatar
jiapei100
Posts: 56
Joined: Sun Mar 04, 2012 10:16 am
Location: Surrey, BC, Canada
Contact: Website

Re: NFS root - totes worth it

Sat Sep 08, 2012 6:49 pm

How to solve this problem pls....
mount.nfs: access denied by server while mounting

Best Regards
Pei
Welcome to Vision Open
http://www.visionopen.com

User avatar
jiapei100
Posts: 56
Joined: Sun Mar 04, 2012 10:16 am
Location: Surrey, BC, Canada
Contact: Website

Re: NFS root - totes worth it

Sat Sep 08, 2012 8:28 pm

Ok, seems solved.
You have to modify your /etc/exports
from
/nfs 192.168.1.*(rw,sync,no_root_squash)
to
/nfs *(rw,sync,no_root_squash)
, even if your computer is of an IP address 192.168.1.* ....

Weird....
Can anybody help to explain?


Cheers
Pei
Welcome to Vision Open
http://www.visionopen.com

Howard
Posts: 64
Joined: Sun Mar 04, 2012 7:38 pm
Contact: Website

Re: NFS root - totes worth it

Wed Sep 26, 2012 3:19 am

Easy question:

How long does your Pi take to boot over nfs?

Not so easy question:

Any idea what would be required to share the export with several Pis? Apart from a complete clone per Pi.

This sounds like a good way to avoid the SD card corruption problems.

User avatar
jiapei100
Posts: 56
Joined: Sun Mar 04, 2012 10:16 am
Location: Surrey, BC, Canada
Contact: Website

Re: NFS root - totes worth it

Wed Sep 26, 2012 4:02 am

Hi, Howard:

Since my Pi is booted remotely but in a LAN, the boot is pretty fast IMO, maybe seconds??

Sorry I didn't get you about the 2nd question. I guess it should be ok to share the exports with several Pis... But, are you talking about
downloading first 50% from server 1
and downloading the other half from server 2
and then boot the Pi?
Cheers
Pei



Howard wrote:Easy question:

How long does your Pi take to boot over nfs?

Not so easy question:

Any idea what would be required to share the export with several Pis? Apart from a complete clone per Pi.

This sounds like a good way to avoid the SD card corruption problems.
Welcome to Vision Open
http://www.visionopen.com

Howard
Posts: 64
Joined: Sun Mar 04, 2012 7:38 pm
Contact: Website

Re: NFS root - totes worth it

Wed Sep 26, 2012 5:05 am

So I guess you are saying the Pi will boot just as quick over the network as it does from an SD card? Or at least not much slower.
Sorry I didn't get you about the 2nd question.
I meant clone one root partition from SD card to NAS. Then configure <more than one> Pi to point to the SAME root partition at the same time!
I guess if the root partition is read-only there should be no problem.
Naturally each one might want its own home directory and perhaps one or two others.
Could be perfect for classrooms if it works.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: NFS root - totes worth it

Sun Dec 30, 2012 12:05 pm

raspbmc supports nfs root out of box with a slick installer

http://www.raspbmc.com/2012/12/xbmc-rel ... -and-more/

Do read this as well

http://forum.stmlabs.com/showthread.php?tid=5496

Howard
Posts: 64
Joined: Sun Mar 04, 2012 7:38 pm
Contact: Website

Re: NFS root - totes worth it

Sun Dec 30, 2012 7:18 pm

Having now run two RasPis on a read-only root partition I consider that there only two files that give any problem if you want to share a single NFS read-only image as root. So to answer my own second question:

1: /etc/hostname

I guess you'd need an extra start-up script to create /etc/hostname from the boards MAC address using a simple lookup table. Not difficult.

2: /etc/network/interfaces

This file needs the numeric form of ip address. Its a shame it can't take the hostname to be mapped from /etc/hosts. So it needs to be updated by the same script as above.

These are the only two files I have to deal with when cloning a read-only root partition card from one Pi to another so I guess you could have a whole network of them running identical images from a read-only NFS source. I'd insert symbolic links for these two files to push them to somewhere read-write like a per-Pi partition, or to a ramdisk in /tmp (which can also be used as a home directory).

jemos
Posts: 1
Joined: Tue Jan 22, 2013 12:19 am

Re: NFS root - totes worth it

Tue Jan 22, 2013 12:25 am

"This sounds like a good way to avoid the SD card corruption problems." exactly what I thought also..

Perhaps this link is of your interest, I've decided to make a small guide for this...didn't knew there was a thread already about it.... my bad.

http://jemos.net/geekstuff/booting_rasp ... _root.html

Have fun :p

digidax
Posts: 1
Joined: Mon Apr 08, 2013 8:13 am

Re: NFS root - totes worth it

Mon Apr 08, 2013 8:15 am

Nice thread for inspiration, but the link jemos.net/geekstuff/booting_raspberry_pi_from_a_nfs_root.html is down. Can you please check this?

best regards
Frank

dimonic
Posts: 39
Joined: Fri Jun 08, 2012 9:08 pm

Re: NFS root - totes worth it

Fri Oct 11, 2013 7:50 pm

rachel wrote: No we don't, this is an educational tool to teach people how to use, program and develop "real" computers. If you want an idiot guide then please donate your Pi to a school and go and buy a windows machine.

JMHO
What I really need is a "Plus 1" tool here.

rav99
Posts: 2
Joined: Fri Jul 18, 2014 5:08 am

Re: NFS root - totes worth it

Fri Jul 18, 2014 5:17 am

I have set DHCP server on another machine and I replace ip=ip_client:ip_server parameter with ip=dhcp and reboot ,it returns back with kdb session with error "kernel stack corrupted".
And after recovering from error, when I pass entries as per given instructions it loads remote file system from NFS server.
MY question is what's the point of using DHCP server if I have to pass static ip entries.
moreover I mounted the file system in read/write mode but when I try to delete a file from rpi it said read only filesystem can't delete.
Please help me out

gearhead
Posts: 26
Joined: Tue Sep 11, 2012 1:45 pm

Re: NFS root - totes worth it

Thu Feb 19, 2015 9:53 pm

I had a Raspbian installation and am more familiar with debian based things, but now have a couple Arch installs. I have been able to get the thing to boot with root over NFS, but it is a bit flaky at times and really has trouble rebooting. I have to unplug it/replug it to get it to boot. I have read about how you remove the /etc/networking reference to eth0 in Raspbian and wonder if this is the cause Arch uses netctl and not networking service. How do I do the same thing as what is prescribed for Raspbian? Do I just delete the eth0 file in the /etc/netctl directory?

peteforde
Posts: 11
Joined: Mon Jun 09, 2014 3:33 am

Re: NFS root - totes worth it

Sat Aug 08, 2015 12:21 am

Just came across this thread three years later.

It doesn't seem like NFS netbooting is a "thing" for many/most people. Obviously SD cards are fault prone but I wonder what kind of benchmarks you guys are getting that motivates so much extra mucking.

I have an array of 70 Pis that I would be curious about. Seems like turning on 70 devices and slamming nfs with simultaneous requests for the boot partition data is a recipe for sadness.

However, I can't shake my curiosity about the approach.

In conclusion:

1. Why are you guys trying to do this? Is it a demonstrable speed bump, a reliability thing, a "look what I did" thing, a centralized boot image thing?

2. Is it something that would work well for 1-2 Pis but explode a network of 70 devices booting at the same time?

User avatar
PeterO
Posts: 4164
Joined: Sun Jul 22, 2012 4:14 pm

Re: NFS root - totes worth it

Sat Aug 08, 2015 5:51 am

I would suggest that your try it and see :-) It's a pretty simple change to make and can easily be backed out if it doesn't perform.

The NFS server performance will be important. It will need enough RAM to cache all the files that the PIs access during boot and application startup. I would try a desktop PC running Linux.

However don't forget that while you may improve reliability due to reduced SD card problems, it is an "all your eggs in one basket" solution with the NFS server being a single point of failure. If reliability is critical then you could maintain a spare server ready to go, or have a dual NFS server setup with some sort of load balancing and fall back to a single server.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
r3d4
Posts: 925
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: NFS root - totes worth it

Sat Aug 08, 2015 10:02 am

peteforde wrote: I have an array of 70 Pis that I would be curious about. Seems like turning on 70 devices and slamming nfs with simultaneous requests for the boot partition data is a recipe for sadness.
Tinycorelinux/the intramfs=root methods it uses might be worth a look ,
that is if you have not allready got your own buildroot or similar setup!

Kn0man
Posts: 18
Joined: Fri Jul 10, 2015 9:36 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 4:28 pm

rachel wrote:I may be speaking out of turn here, and expect to be flamed, but I'm mature enough not to care,
by grumpyoldgit » Wed May 16, 2012 10:07 am
All Greek to me. What we need is an idiot guide.
No we don't, this is an educational tool to teach people how to use, program and develop "real" computers. If you want an idiot guide then please donate your Pi to a school and go and buy a windows machine.

JMHO
I disagree rachel , to me the pi is a piece of hardware with a small enough form factor and enough power to perform adequately in a project I have planned. An Idiots guide {BTW there is one for the Pi ISBN: 1615647783 } [not a plug I haven't read it yet] can be quite helpful for those that have neither the inclination nor time to learn every aspect of the Pi ! (horses for courses! ;-) )

AND I can relate to Grumpyoldgit, there a DAYS I spent typing in thousands of lines of basic from a magazine just to make my first computer do something, only to have it crash from a typo or misprint! :o
"The avalanche has already started; it is too late for the pebbles to vote."-Kosh Naranek

User avatar
PeterO
Posts: 4164
Joined: Sun Jul 22, 2012 4:14 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 4:32 pm

Kn0man wrote:
I disagree rachel ,:o
Why are you replying to comments made on Jun 03, 2012 from someone who hasn't been on the forum in the last 18 months ?
Please look at the dates of posts before replying.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Heater
Posts: 9218
Joined: Tue Jul 17, 2012 3:02 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 5:15 pm

Ha! I was just about to reply to that post by rachel as well. I don't check dates on posts all that much.

Why would one not reply to an ancient post? If a question needs answering then it needs answering no matter how old it is, people searching for that answer tomorrow might find it here, even if the orginal poster is long gone. In this case, if a thing needs refuting it needs refuting no matter how old it is.

Any way, Hi rachel, I hope you have reconsidered that arrogant, narrow minded, and unhelpful attitude.

User avatar
PeterO
Posts: 4164
Joined: Sun Jul 22, 2012 4:14 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 5:48 pm

I know it's hot today, but that's no excuse !
if a thing needs refuting it needs refuting no matter how old it is.
No one paid any attention to it at the time, and it died the death it deserved there and then.


Rachels statisitics....

Code: Select all

Joined:
    Sun Jun 03, 2012 3:59 pm
Last visited:
    Mon Feb 24, 2014 3:25 pm
Total posts:
    2 | Search user’s posts
There is No point at all in answering posts from someone who only made two posts on a thread in 2012, and hasn't said anythign since and hasn't even been on the forum for 18 months.
There are plenty of current threads from people waiting for help with there problems !

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Heater
Posts: 9218
Joined: Tue Jul 17, 2012 3:02 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 6:00 pm

PeterO,

In this case I agree with you. rachel's post contained no statement of fact whether right or wrong. Only stated an opinion that, on refelction, probably deserved ignoring even at the time.

It's not actually hot at my location but I can be tetchy when seeing views I disagree with at any temperature :)

On the other hand...

If a post makes an assertion that is factually incorrect, or has become so as things change over time, I see no reason why it should not be replied to with a correction or update. It does no harm and may save someone from being misled if they happen to stumble across the thread, no matter how many years later.

If a question goes unanswered why not answer it. For the similar reasons.

Heck if mathematicians did not answer ancient problems or if physicists did not expand on old theories, because they are old and somehow "timed out", we would make no progress.

mikerr
Posts: 2662
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: NFS root - totes worth it

Sun Aug 09, 2015 6:22 pm

peteforde wrote: It doesn't seem like NFS netbooting is a "thing" for many/most people. Obviously SD cards are fault prone but I wonder what kind of benchmarks you guys are getting that motivates so much extra mucking.
SD card performance and reliability may have been worse in 2012.

Even now though, USB root with a flashdrive is quite noticeably faster than SD on Pi.
so I'd look at that if you want a speedup on Pi's.

NFS root with 70 pi might be useful for central admin, but not performance
-even on 1 pi it's limited by the 100Mbps ethernet port
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Heater
Posts: 9218
Joined: Tue Jul 17, 2012 3:02 pm

Re: NFS root - totes worth it

Sun Aug 09, 2015 6:40 pm

peteforde,
Why are you guys trying to do this? Is it a demonstrable speed bump..
A while back I was compiling the Qt5 GUI libraries from source code on the Pi itself. This takes a very long time, like days. I forget exactly now. Anyway, putting all the sources on an NFS share on my PC and having the build workspace in that share reduced the build time by a factor of two or so.

I did however keep my rootfs on SD card.

Booting 70 Pi off NFS at the same time sounds like an interesting experiment :)

Depending on what you are wanting to do I would keep the root fs on the Pi but mounted as read only so as to be sure it will never get corrupted. Put any data on the NFS.

mikerr
Posts: 2662
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: NFS root - totes worth it

Mon Aug 10, 2015 4:00 pm

For fun I just tried the lazy (idiotic?) way by exporting the pi's own running root filesystem live over NFS to another pi

- it'll never work I hear you cry ! but onward we go... :)

apt-get install nfs-kernel-server

/etc/hosts.allow:

Code: Select all

192.168
/etc/exports:

Code: Select all

/  *(ro,sync,no_root_squash)
then booted another pi with an SD card containing just the fat32 files, and cmdline.txt:

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline rootwait root=/dev/nfs ip=dhcp nfsroot=192.168.0.45:/ 
Almost worked, but X11 wouldn't start and complained of readonly files, so edited /etc/fstab (on main Pi) to add a few readwrite ram mountpoints:

Code: Select all

/dev/mmcblk0p1 /boot vfat defaults 0 2
tmpfs /tmp tmpfs defaults
tmpfs /var/log tmpfs defaults
tmpfs /home/pi tmpfs defaults
tmpfs /var/lib/xkb tmpfs defaults
Success ! It Works, ableit slowly (about a minute to boot vs 20secs on SD).
Last edited by mikerr on Tue Aug 18, 2015 1:35 pm, edited 1 time in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
PeterO
Posts: 4164
Joined: Sun Jul 22, 2012 4:14 pm

Re: NFS root - totes worth it

Mon Aug 10, 2015 4:12 pm

mikerr wrote: Success ! It Works, ableit slowly (about a minute to boot vs 20secs on SD).
Can you try copying the sd card root filesystem onto a desktop Linux machine and runing an NFS server on there ? Should make a big difference I think.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

mikerr
Posts: 2662
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: NFS root - totes worth it

Mon Aug 10, 2015 4:17 pm

PeterO wrote:Can you try copying the sd card root filesystem onto a desktop Linux machine and runing an NFS server on there ? Should make a big difference I think.
Undoubtedly - that's the "proper way", but I was just messing about with a quick all-pi setup.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Return to “General discussion”

Who is online

Users browsing this forum: Ald0, fbe, jjbpi, Raspberry Paul and 59 guests