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.
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.
To access the newly created filesystem, you have to mount it. For this create a /mnt/hda? directory and type at shell prompt:
mkdir /mnt/hda?
mount $EMBPART /mnt/hda?
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.
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 are made by using the mkdir
fonction in the new mounted filesystem.
Directory stub required by the proc filesystem.
System configuration file
Critical System binaries
Basic binaries considered part of the system
Shared Libraries to provide run time support
Mount point for maintenance
Additional utilities and applications
cd /mnt/hda?
mkdir bin dev home proc sbin usr boot etc liv mnt root tmp var
mkdir -p usr/bin usr/sbin usr/share usr/lib
mkdir -p etc/config etc/default etc/init.d etc/rc.boot
mkdir -p etc/rc0.d etc/rc1.d etc/rc2.d etc/rc3.d etc/rc4.d etc/rc5.d etc/rc6.d etc/rcS.d
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?