[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

NFS Diskless Boot



Hello All,

I have been experimenting with a diskless boot system for Debian
Linux. I am sharing the details with this mailing list in case
there are any new ideas to certain problems that I may have overlooked.

Anyway, I have written a perl script that copies files from a working
debian system to the NFS mount directory according to a list of
rules. I can provide more details on this if anyone desires. I believe
this to be similar to the nfsroot package, but with added functionality.
(what happened to nfsroot? I can no longer find it...)

I have got most things going, including X-Windows.

The first major problem I encountered (latest slink, 2.1.103, 2.1.108,
and 2.1.109 kernel),
was that file-locking seemed to be mandatory on the root file system.
At first I couldn't work out how to turn off file locking. If I
remounted the root filesystem with the "nolock" parameter, the
parameter would show up in the output of "mount" but file locking
was still enabled. I think there is a bug somewhere, I am not sure
where (perhaps the kernel).

I have only identified two programs that have problems with file locking
on the root filesystem (so far): /usr/bin/savelog and /usr/bin/maildir2mbox.
(the first one from sysvinit, and the second from qmail). This first
one was the most irratating, and the easiest to fix. In /usr/bin/savelog,
I changed:

> OLD:
>                         ln -f "$filename" "$newname.0"
>                         mv "$filename.new" "$filename"
> 
> NEW:
>                         mv "$filename" "$newname.0"
>                         mv "$filename.new" "$filename"

I am thinking of filing this is a wishlist change, against sysvinit,
because of the simplicity, and IMHO makes the code more readable.

With respect to the file-locking, I found that including "nolock" in
the root entry in /etc/fstab doesn't help. In fact, I fixed
the problem by modifying /etc/init.d/checkroot.sh:

OLD:
mount -n -o remount,rw /
rm -f /etc/mtab~ /etc/nologin
: > /etc/mtab
mount -o remount,rw /
mount /proc

NEW:
mount -n -o remount,rw /
rm -f /etc/mtab~ /etc/nologin
: > /etc/mtab
mount -o remount,rw,nolock /
mount /proc

This works, but the nolock option is repeated two times in the mount
output (also I feel the correct solution should be to put "nolock" in
/etc/fstab):

snoopy:/tftpboot/192.168.87.133 on / type nfs (rw,nolock,nolock,addr=202.12.87.129)

I can check if file locking is installed by running a command that
keeps a file open, eg:
while true; echo hi; sleep 1; done > file

and in another window:
mv file.new file

If file locking is installed, the mv command will not work.

Other problems encountered:
- portmap is killed on entry to single user mode and not restarted.

- portmap is killed on shutdown, I suspect (but not am not entirely sure),
	that this causes extra error messages to appear, as root is
	still mounted. I have no idea of how to satisfactorily solve
	this problem. Then again, I have heard the portmap is only
	needed if file locking is used - I always get errors regardless.
- I often get messages like "NFS: can't silly-delete run/.nfs52013b6e00000007",
(especially on system shutdown, but also when exiting dosemu),
and "RPC: task timed out".

- More serious: "server 192.168.87.129 not responding, still
trying", and immediately after (same timestamp in log file)
"nfs: server 192.168.87.129 OK". Once when this occured, all ssh
sessions to and from the NFS server died. I have no idea what is going on.
Network overload? NFS timeout period too short? The message was displayed
simultanously (I think) on both diskless computers that where running at
the time.

- qmail can't read from its message queue, despite the fact all the
permissions are the same as on a working system. The error is
"access denied". However, qmail will work fine if setup to forward
to another SMTP host. 

I am doing this on a 10Mbps coaxial Ethernet network.

Any suggestions?

Thanks in advance,

Brian May <bam@snoopy.apana.org.au>


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: