Next Previous Contents

4. Creating a root file system

4.1 Creating a new partition

Quoted from the LFS-HOWTO at http://huizen.dds.nl/~glb/

Before we can build our new Linux system, we need to have an empty Linux partition on which we can build our new system. If you already have a Linux Native partition available, you can skip this subsection and the following one.

Start the fdisk program (or cfdisk if you prefer that program) with the appropriate hard disk as the option (like /dev/hda if you want to create a new partition on the primary master IDE disk). Create a Linux Native partition, write the partition table and exit the (c)fdisk program. If you get the message that you need to reboot your system to ensure that that partition table is updated, then please reboot your system now before continuing.

4.2 Creating an ext2 file system on the new partition

Quoted from the LFS-HOWTO at http://huizen.dds.nl/~glb/

To create a new ext2 file system we use the mke2fs command. Give $LFS as the only option and the file system will be created.

From now on I'll refer to this newly created partition as $EMBPART. $EMBPART should be substituted with the partition you have created.

4.3 Mounting the partition

To access the newly created filesystem, you have to mount it. For this create a /mnt/hda? directory and type at shell prompt:

If you created your partition on /dev/hda4, and you mounted it on /mnt/hda4, when this document will tell you to copy a file to $dollar;EMBPART/usr/bin then you will need to copy that file to /mnt/hda4/usr/bin.

4.4 Populating the filesystem

The root filesystem must contain everything needed to support a full Linux system. We will build a directory structure not that far from the File Hierarchy Standard

Directories

Directories are made by using the mkdir fonction in the new mounted filesystem.

/proc

Directory stub required by the proc filesystem.

/etc

System configuration file

/sbin

Critical System binaries

/bin

Basic binaries considered part of the system

/lib

Shared Libraries to provide run time support

/mnt

Mount point for maintenance

/usr

Additional utilities and applications

the /dev directory

The dev directory is the stub required to perform devices input / output. Each file in this directory may be created using the mknod function. You may avoid losing time by directly copying the required dev entries from your desktop Linux.

cp -av /dev/???? /mnt/hda?


Next Previous Contents