5.1. Creating a linux Filesystem

[Note]

Note

The commands in the remainder of this book must be performed while logged in as user root

The rest of this chapter assumes you already installed needed packages. If it's not the case, you should go to squashfs 4.2 You should also have configured your kernel properly, as described in Section 3.1, “Reconfiguring the Kernel”

Now it's time to assemble our live system.

First let's define the name of our system, this name will be given to our media: cd/dvd/usbkey/usbdrive.

The cd/dvd choice will be further mentioned as the ISO live system, the usbkey, usbdrive or usbstick will be mentioned as the usb live system

export the name of our system:

export LFSLIVE=lfslive

create and export the mount point:

export LFSMOUNT=/mnt/LFS
mkdir -pv $LFSMOUNT

If you plan to create an ISO live system, create some space to store the complete system plus some extra space. App. 1,5 times the size of the system will do, after you reserved some space, create a link to the folder:

mount --bind <path to LFSspace> $LFSMOUNT

Or if you use a dedicated partition mount it:

mount /dev/<device> $LFSMOUNT

you can now continue with Section 8.1, “Building the ISO live system”

For use of the usb live system, it's time to create some free space on it and create partitions, just like we do in the LFS book; Make an ext2 or ext3 file system on it and a small swap partition.

First, open the key with your favorite partitioning program, eg. cfdisk or fdisk or some other, and remove any partition already existing on it. Then, create one primary partition on the usb stick.

You will then have to create ext2/ext3 filesystem on the partition you created, using:

mke2fs -j -L $LFSLIVE /dev/<sd?1>

Where sd?1 is the flash drive partition for the livekey

And mount it:

mount /dev/<device> $LFSMOUNT

Now that the filesystem has been set up on the usb-media, go to Section 6.1, “Building the USB live system”