Creating a file system on the new partition

Now that we have a blank partition, we can create a file system on it. Most widely used in the Linux world is the second extended file system (ext2), but with the high-capacity hard disks of today the so-called journaling file systems are becoming increasingly popular. Here we will create an ext2 file system, but build instructions for other file systems can be found at http://www.linuxfromscratch.org/blfs/view/stable/postlfs/filesystems.html.

To create an ext2 file system on the LFS partition run the following:

mke2fs /dev/xxx

Replace xxx with the name of the LFS partition (something like hda5).

If you created a (new) swap partition you need to initialize it as a swap partition too (also known as formatting, like you did above with mke2fs) by running:

mkswap /dev/yyy

Replace yyy with the name of the swap partition.