Networking - Bug in initramfs nfs script

jhansonxi - 07.09.2012, 04:14 Uhr
Titel: Bug in initramfs nfs script
Kanotix Linux Tag 2012 Hellraiser 32 mini
Attempting to netboot the LiveCD over pxe/tftp and mount the squasfs over NFS from a loopback-mounted ISO on a server. This is supprted in Debian (the Debian Live images all boot properly) and Kanotix shares at least some of the capabilities and uses the same boot parameters.

Initially the kernel would panic whenever I attempted to boot with it because it couldn't find the root filesystem. On IRC kano gave me some suggestions and confirmed that the boot parameters were compatible with Debian. However, nothing seemed to work.

In spite of other pressing concerns, I didn't give up and finally found that the initrd line in the confuration had a typo and the initrd image wasn't being found. This allowed it to at least boot but then it couldn't connect the NFS server. The error reported was "nfsmount: need a path" which looped until the script timed out and dropped to an initramfs prompt.

I set break=mountroot to stop the boot just before the mount attempt. I can easily mount the NFS share with nfsmount but after exiting initramfs it still attempted to mount it again then returned to the initramfs prompt when it couldn't load the image. It may be relying on the nfsmount exit status instead of checking for the presence of the mount.

From what I can tell, the nfs script (/scripts/nfs) isn't supplying the root path parameter for the nfsmount command line, only the server: part. In my configuration the NFS root path is specified through the pxe/syslinux boot configuration, not the DHCP server because I have many netboot images with different directory structures. An old Debian bug suggested changing the nfs script to use mount instead of nfsmount:

Easy to do but changing the script in the running initramfs environment didn't change its execution (still used nfsmount when I exited initramfs) so it may have been already executing when the break occurred. I don't have time to build a custom initrd image.

I tried different variations of the boot command line but always received the same error. My pxe/syslinux config:

label kanotixlt2012hf32mini
menu label Kanotix
kernel /isomnt/KANOTIX-LinuxTag2012-Hellfire32-mini/live/vmlinuz
initrd /isomnt/KANOTIX-LinuxTag2012-Hellfire32-mini/live/initrd.img
append ip=dhcp boot=live config netboot=nfs nfsdir=

jhansonxi - 08.09.2012, 02:43 Uhr
I managed to get Kanotix to boot over NFS with some workarounds.

1. Set "break=mountroot" in the PXE/syslinux config:
append ip=dhcp boot=live config netboot=nfs nfsdir= lang=us keyboard=us xkeyboard=us break=mountroot

2. When the boot process halts at initramfs prompt, enter:
ipconfig eth0
nfsmount -o nolock -o ro /live/image
cp /bin/true /bin/nfsmount

3. Then <Ctrl-d> to exit initramfs and resume booting. The ipconfig command will be executed again by the nfs script but this is harmless. The fake nfsmount will return an exit status of 0 making the script behave as if the mount succeeded. It may stall out when it attempts to mount the image with aufs:
nfs: server not responding, still trying

It will time out and retry after a few minutes then resume booting to the KDE desktop.
Kano - 08.09.2012, 18:33 Uhr
Did you try httpfs? You only need to extract kernel+initrd, you can use the iso image directly for httpfs.
jhansonxi - 08.09.2012, 21:52 Uhr
Not yet. I wanted to make sure the NFS bug was reported so nobody else has to waste time trying to get it working.
Kano - 09.09.2012, 00:17 Uhr
Well i do not change debian live packages.
jhansonxi - 09.09.2012, 02:15 Uhr
Since Debian Live 6.0.4 images boot perfectly, I changed the boot parameters to match and it worked.

label kanotixlt2012hf32mini
menu label Kanotix Hellfire 2012-05 32-bit LiveCD (KDE)
kernel /isomnt/KANOTIX-LinuxTag2012-Hellfire32-mini/live/vmlinuz
initrd /isomnt/KANOTIX-LinuxTag2012-Hellfire32-mini/live/initrd.img
append ip=dhcp boot=live config netboot=nfs nfsroot= lang=us keyboard=us xkeyboard=us

It looks like the nfsdir= parameter was the problem. Using nfsroot= worked. I'm not sure where nfsdir came from. From the PXE menu it boots in about 75 seconds over 100-BaseT.
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007