Using devfs

If you are using devfs, you must perform some additional steps after making the NFS-mounted filesystem your new root filesystem to ensure that the embedded system recognizes the devices available to it. These steps include explicitly remounting /proc in order to track process, device, and system status.

Mounting /dev Using devfs

Linux devices are typically accessed through files in the /dev directory. These files are known as device-special files; they tell the kernel how to contact each device attached to the system. The downside of using /dev is that each Linux system needs to have an entry in /dev for every device with which it could ever possibly communicate. Such a scheme is confusing, is inflexible in terms of adding new devices to your Linux system, and wastes disk space.

Many embedded systems, especially those based on the 2.4 Linux kernel, use devfs, which is designed to eliminate the need for static entries in the /dev directory. When using devfs, /dev is mounted like any other filesystem, and is automatically populated at that point. This typically takes place during the Linux boot process, but it can be done at any time.

If your kernel is configured to use devfs and you use the chroot utility to change the RFS, the /dev directory is not automatically repopulated. Instead, you must manually populate the directory by explicitly mounting the /dev directory, as shown in the following example:

# mount -t devfs /dev /dev 

Mounting /proc Using devfs

Just as Linux accesses devices through entries in the /dev directory, it uses a filesystem known as /proc to track process, device, and system status. Like /dev, /proc is automatically created (in memory rather than on disk) as part of the Linux initialization process, and it is mounted on the physical directory /proc during system startup.

Likewise, if your kernel is configured to use devfs and you use the chroot utility to change the RFS, the mounted version of /proc is no longer valid, because it is associated with an inode that no longer exists. Therefore, you must explicitly remount the /proc filesystem after changing the root filesystem. This ensures that new and existing processes are logging to and interacting with the same /proc filesystem. To explicitly remount the /proc filesystem, issue the following command:

# mount -t proc /proc /proc