NFS-Root Information

From Wiki

Jump to: navigation, search

An NFS root is simply when your root filesystem (/) is mounted over NFS. For this to work under Linux, several kernel configuration options are necessary.

Contents

General Information

When the kernel is first executed, it knows nothing, except that it resides in RAM. It does not know where it came from, so if the kernel was obtained over PXE, it has no clue that the computer currently has an IP. Seeing as NFS is a Network File System, we need network connectivity before it can be mounted as /. If you have an initrd that'll obtain an IP address and mount /, you don't need any kernel-level options to be set. However, in the case where you don't want to mess with an initrd, the kernel can handle all of that for you.

General Requirements

Note: All of these must be compiled into the kernel, and not as a module, otherwise you must use an initrd to load them, which defeats the point.

  • Support for your network card
  • Support for NFS
  • Support for a root file system over NFS
  • Support for DHCP in-kernel

2.6 Kernel

.config options

(Found under File Systems --> Network File Systems)
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
(Note: may or may not be needed depending on your setup)
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y

(Found under Device Drivers --> Network Support --> Networking Options --> TCP/IP networking)
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y

Kernel options

root=/dev/nfs nfsroot=192.168.0.1:/srv/diskless ip=auto

Notes

When the root is set to /dev/nfs, take note that this is a pseudo-device, and not an actual device node. All that this does is tell the kernel that the root filesystem is on an NFS mount. The nfsroot parameter tells the kernel to mount 192.168.0.1:/srv/diskless as /. DNS is not available here, so an IP must be used, and domain name cannot. Finally, "ip=auto" tells the kernel to automatically obtain an IP before it mounts / and continues on with the boot process.

2.4 Kernel

TODO!

2.2 Kernel

TODO!

Personal tools
user accounts