qiuye 发表于 2013-1-29 23:11:19

Building a root filesystem

Building a root filesystem

Creating the root filesystem involves selecting files necessary for thesystem to run.In this section we describe how to build acompressed root filesystem.A less common option is tobuild an uncompressed filesystem on a diskette that is directly mounted asroot; this alternative is described in Section 9.1.
<div class="SECT2">4.1. Overview

A root filesystem must contain everything needed to support a full Linuxsystem.To be able to do this, the disk must include the minimum requirementsfor a Linux system:



[*]The basic file system structure,
[*]Minimum set of directories: /dev,/proc, /bin, /etc, /lib, /usr, /tmp,
[*]Basic set of utilities: sh, ls, cp,mv, etc.,
[*]Minimum set of config files: rc, inittab, fstab, etc.,
[*]Devices: /dev/hd*, /dev/tty*, /dev/fd0, etc.,
[*]Runtime library to provide basic functions used by utilities.
Of course, any system only becomes useful when you can run somethingon it, and a root diskette usually only becomes useful when youcan do something like:



[*]Check a file system on another drive, for example to check your root filesystem on your hard drive, you need to be able to boot Linux from anotherdrive, as you can with a root diskette system.Then you can runfsck on your original root drive while it is notmounted.
[*] Restore all or part of your original root drive from backup usingarchive and compression utilities such as cpio,tar, gzip andftape.
We describe how to build a compressed filesystem, socalled because it is compressed on disk and, when booted, is uncompressed ontoa ramdisk.With a compressed filesystem you can fit many files (approximatelysix megabytes) onto a standard 1440K diskette.Because the filesystem is muchlarger than a diskette, it cannot be built on the diskette.We have to buildit elsewhere, compress it, then copy it to the diskette.
页: [1]
查看完整版本: Building a root filesystem