HOMEPAGE FORUMS NEWS DOCUMENTATION SCREENSHOTS
SystemRescueCd forums
View unanswered posts | View active topics It is currently 01 Oct 2014, 16:15



Post new topic Reply to topic  [ 14 posts ] 
 PXE boot using NFS 
Author Message

Joined: 11 Nov 2008, 15:55
Posts: 2
Post PXE boot using NFS
Hi,

I'm having an issue trying to add the SystemRescue cd to our PXE. Im using an NFS share, and the entry in the default file is as follows:

Code:
label sysrescue
kernel release/sysrescuecd/rescuecd
append initrd=release/sysrescuecd/initram.igz root=/dev/ram0 init=/linuxrc video=ofonly vga=0 looptype=squashfs loop=sysrescuecd/sysrcd.dat setkmap=uk cdroot splash=silent nfsroot=192.168.0.70:/tftpboot/sysrescuecd real_root=/dev/nfs softlevel=pxe


It fails giving the following error:
'Device /dev/nfs is not a valid root device...
Running a mini shell (cannot complete the boot process)

Can anyone help with this? Im using the latest version (1.1.1)

Thanks :)


11 Nov 2008, 16:04
Profile
Site Admin

Joined: 17 Jul 2003, 09:44
Posts: 2700
Post 
NFS has never been supported. You have to use HTTP or TFTP as described in the handbook.


12 Nov 2008, 08:02
Profile

Joined: 11 Nov 2008, 15:55
Posts: 2
Post 
Thanks for the reply, gave up on NFS, using http now and alls working well :)


14 Nov 2008, 16:23
Profile

Joined: 28 Dec 2008, 20:35
Posts: 4
Post 
Not Supported dos not mean it can be done.

Downloading the large sysrcd.dat to the computers memory (tmpfs) is not always the luxury available on all those sick computers.

Iif you looking for a non-supported feature like share sysrcd.dat though nfs and you have some time to spare there is a way ......


What you need is the nfs kernel modules (nfs.ko nfs_acl.ko,lockd.ko sunrpc.ko ) the portmap binary must be added to the initram.igz (these can found in the squashfs-ed sysrcd.dat)
some lines of code in the init script for loading these modules and mount the nfs share where the sysrcd.dat file is located, next the script continues like sysrcd.dat was downloaded
only 800Kb memory usage on kernel modules en portmap process

the code I used is not very portable, but start looking at the sysreccd_bootstrap_net routine
you will see that is not hard to add a extra type of url....

I don't know if there is more to squeeze on memory consumption. but this was for me the trick. o yah tmpfs default size is half the memory.. -o size=32m is more frendly.

still not convinced? for example started with a healthy 1Gb machine there was only 150Mb of active pages while X is running..... leaving 850MB....


Code:
root@sysresccd /root % uname -a
Linux sysresccd 2.6.27.07-std113 #1 SMP Sat Dec 6 00:19:24 UTC 2008 i686 Intel(R) Pentium(R) 4 CPU 3.40GHz GenuineIntel GNU/Linux
root@sysresccd /root % df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                    32768     26148      6620  80% /
nfs-server:/var/install/rescue
                      64657408   4714304  56658624   8% /mnt/cdrom
/dev/loop0              204288    204288         0 100% /mnt/livecd
tmpfs                    32768     26148      6620  80% /mnt/memory
udev                     10240       172     10068   2% /dev



There was only one trick: add a loopback adapter before start the portmaper like this

ifconfig lo 127.0.0.1 netmask 255.0.0.0 up


28 Dec 2008, 21:42
Profile
Site Admin

Joined: 17 Jul 2003, 09:44
Posts: 2700
Post 
Yes it is possible to implement a boot using NFS. I did not because NFS is quite complex.

We could also do the same sort of thing using NBD (Network block device).


31 Dec 2008, 22:14
Profile

Joined: 17 Jun 2008, 08:05
Posts: 25
Location: Cagnes-sur-Mer, France
Post Re: PXE boot using NFS
Hi admin,

You've advanced for isoloop and nfs solution but have you progressed for nbd's boot or have you a track to follow ?

best regards,


30 Jan 2010, 21:25
Profile WWW
Site Admin

Joined: 17 Jul 2003, 09:44
Posts: 2700
Post Re: PXE boot using NFS
No NBD has not been implemented yet, but you can customize the "init" script in the initramfs if you have time.


12 Feb 2010, 12:28
Profile

Joined: 17 Jun 2008, 08:05
Posts: 25
Location: Cagnes-sur-Mer, France
Post Re: PXE boot using NBD
Hi,

I'd advance for NBD boot, so I would propose my contrib.

I've modified the init file in the initram.igz archive :
Code:
455a456,464
> # connect the NBD device
> sysresccd_nbdboot()
> {
>         good_msg 'Executing nbd-client /dev/nbd0 to access nbd root'
>       NBD_SERVER=$(echo "${NBD_ROOT}" | sed 's/:.*//')
>       NBD_PORT=$(echo "${NBD_ROOT}" | sed 's/.*://')
>       /usr/sbin/nbd-client "${NBD_SERVER}" "${NBD_PORT}" /dev/nbd0 -persist
> }
>
489a499
> NBD_ROOT=''
574a585,590
>               nbdroot\=*)
>                       NBD_ROOT=`parse_opt "${x}"`
>                       REAL_ROOT="/dev/nbd0"
>                       LOADNET='1'
>                       CDROOT='0'
>               ;;
758a775,780
> # ---- don't load the nbd modules which is time consuming if nbd not involved
> if [ -z "${NBD_ROOT}" ]
> then
>       rm -f /etc/modules/nbd
> fi
>
786c808
< if [ -n "${NETBOOT}" ]
---
> if [ -n "${NETBOOT}" ] || [ -n "${NBD_ROOT}" ]
1130a1156,1161
> # create the nbd device on demand
> if [ -x /usr/sbin/nbd-client ] && [ -n "${NBD_ROOT}" ]
> then
>       sysresccd_nbdboot # boot with nbd device
> fi
>


I add nbd-client binary in /usr/sbin/ directory and nbd.ko module in /lib/modules/... directory.

The nbd file in /etc/modules directory contain only "nbd" and I add "nbd" to the MY_HWOPTS variable in the /etc/initrd.defaults file, but my thin client didn't boot because the startup script checkroot want to mount the rootfs in read/write mode.

I'm stopped...


19 Feb 2010, 22:32
Profile WWW

Joined: 17 Jun 2008, 08:05
Posts: 25
Location: Cagnes-sur-Mer, France
Post Re: PXE boot using NFS
Ok, it works fine I post in contrib directory...


20 Feb 2010, 16:14
Profile WWW
Site Admin

Joined: 17 Jul 2003, 09:44
Posts: 2700
Post Re: PXE boot using NFS
Boot from NFS has been added to the official distribution, as well as boot from NBD, and it's available in SystemRescueCd-1.4.0 and more recent.
http://www.sysresccd.org/Sysresccd-manu ... NFS_or_NBD


28 Feb 2010, 18:03
Profile

Joined: 01 Apr 2010, 14:38
Posts: 2
Post Re: PXE boot using NFS
I'm trying to boot Sysrescd 1.5.1 using NFS but it isn't working:
the NFS share is succesfully mounted as the boot logs says...but loading of sysrcd.dat doesn't start.

The boot just stop forever on NFS share succesfully mounted....

(Obviously inside my nfs share there is sysrcd.dat and sysrcd.md5 with permissions for everyone 777).

Could you please check and fix it? (HTTP in RAM is not an option here)

Thank you in advance.
Ciaoooo


01 Apr 2010, 14:43
Profile

Joined: 20 Apr 2010, 15:22
Posts: 1
Post Re: PXE boot using NFS
RyLoS,

Is it actually frozen, or is it taking awhile to calculate the MD5 checksum?


20 Apr 2010, 15:34
Profile

Joined: 01 Apr 2010, 14:38
Posts: 2
Post Re: PXE boot using NFS
It is actually frozen. It stay in this state forever.


24 Apr 2010, 12:11
Profile
Site Admin

Joined: 17 Jul 2003, 09:44
Posts: 2700
Post Re: PXE boot using NFS
There is no support for NFS4 so please check you are using NFS3 on your server.

You can try with the following syntax:
Code:
rescuecd ethx=192.168.1.2 netboot=nfs://192.168.1.1:/tftpboot

The nfs:// prefix is interpreted by the main boot script and only the text which comes after that prefix is passed to the mount command. This way all protocols can be used with the netboot options. It's a replacement for all protocol specific boot options.

I suggest that you run the nfs mount command by hand from the minimal environment to see what happens.

1) Boot with "rescuecd minishell"
2) Run ifconfig by hand to configure the network (and /etc/resolv.conf + route if necessary)
3) Run "mount -t nfs" manually to see what happens

You can create a temp directory and see if you can mount it:
Code:
mkdir /nfstest
mount -t nfs -o intr,nolock 192.168.1.1:/tftpboot /nfstest


FYI: here is the original code that is executed
Code:
sysresccd_stage1_nfs()
{
        nfsurl=$(echo ${NFSBOOT} | sed -e 's!nfs://!!g')

        good_msg "Mouting the NFS filesystem from ${NFSBOOT}"
        cmd="mount -t nfs -o intr,nolock ${nfsurl} ${BOOTPATH}"
        if ! ${cmd}
        then
                sysresccd_panic "Cannot mount NFS: ${cmd}"
        fi
        good_msg "Successfully mounted the NFS filesystem"

        if [ ! -f "${BOOTPATH}/${SUBDIR}/${LOOPDAT}" ]
        then
                sysresccd_panic "Cannot find the \"${SUBDIR}/${LOOPDAT}\" boot file."
        fi

        md5now=$(/bin/busybox md5sum ${BOOTPATH}/${SUBDIR}/${LOOPDAT} | cut -d ' ' -f1)
        md5orig=$(cat ${BOOTPATH}/${SUBDIR}/${LOOPMD5} | cut -d ' ' -f1)
        if [ "$md5now" = "$md5orig" ]
        then
                good_msg "Successfully checked md5 sum of ${BOOTPATH}/${LOOPDAT}"
        else
                sysresccd_panic "md5sum checksum is invalid on the root filesystem image"
        fi
}


28 Apr 2010, 10:56
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.