My Tech notes: NFS Based ROOTFS Mounting From NFS

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Sunday, December 21, 2008

NFS Based ROOTFS Mounting From NFS

How to boot from NFS?
Network File System (NFS) is a Network file system protocol allowing a user on a client computer to access files over a network as easily as if the network devices were attached to its local disks. All kernels after 2.2 support NFS over TCP.

Mounting the root file system from NFS steps.

1) Go to kernel source directory and type "make menuconfig".
2) In order to configure root NFS support in the kernel, it is first necessary to enable "IP Autoconfiguration". This setting is accessed by selecting "Network" and then "Networking Options" in the menu. On the Network options screen select "IP: kernel level autoconfiguration". type / to search config options from make menucnfig.
3) Main menu select "File Systems" select "Network File Systems". On the Network File Systems page select the "NFS file system support" as built-in (select as *). Then scroll down and select "Root File system on NFS".
4) Now give the boot options to the kernel so that it mounts the NFS directory. From the main menu of kernel configuration select "Boot Options" and select "Default kernel command string". Here give something like the following:
root=/dev/nfs rw nfsroot=192.168.xx.xx:/home/xyz/fs_image ip=192.168.yy.yy:192.168.xx.xx::::eth0:off mem=32M@0x0 console=ttyMCS

Where 192.168.xx.xx is the server IP i.e where the actual Root File system exists. And 192.168.yy.yy is the Board's IP address.

5) Save the kernel configuration. Go to the "dev" folder inside the "fs_image" and create a device entry for ttyMCS by giving "mknod ttyMCS c 204 32". Also create a soft link ttyS0. "ln -s ttyMCS ttyS0". If it is not there. You need to be in root to do this.

6) Now create a kernel image with modified configuration.
7) Next, Setup the NFS server side. Open the /etc/exports file and add the following line
/home/xyz/fs_image/ 192.168.2.yy.yy (rw,no_root_squash)

Save and exit the file.
8) Restart the two services in the server PC.
# service portmap restart
# service nfs restart
9) On the board, from the bootloader Remove the Bootargs, since by having this will override kernel command line arguments. Just give "setenv bootargs" to unset.
10) Next step is to just do TFTP of the kernel image and run "bootmf".

Any question and doubts put comments.

No comments:

Post a Comment