Creating a new partition

It is possible to build LFS on only one partition - the partition in which your original distribution is installed. While this is not recommended for your first LFS installation, it may be useful if you are short on disk space. If you feel brave, take a look at the Install LFS next to existing systems on the same partition hint at http://hints.linuxfromscratch.org/hints/lfs_next_to_existing_systems.txt.

Before we can build our new Linux system, we need an empty Linux partition where we can build it. We recommend a partition size of at least 1 GB. This provides enough space to store the tarballs and compile all of the packages. You will probably need more space if you intend to install additional software and use the LFS system as your primary Linux system. If a Linux native partition is already available, this subsection can be skipped.

Since your system memory can only hold a limited amount of data at one time, we recommend that disk space be set aside for swap files. A swap file is a place where items in memory may be stored until they are called for. This disk space may be shared between your host system and your LFS system. If you already have a swap partition, then you probably don't need to create another one. Otherwise, you should create a swap partition via an fdisk program. Regardless, you need to remember the designation of the swap partition (such as hda2) as it will be needed when we create the /etc/fstab file.

The cfdisk program (or another fdisk-like program) should be started with the appropriate hard disk as the argument (like /dev/hda if a new partition is to be created on the primary master IDE disk). Using this program, create a Linux native partition. Please refer to the documentation of your fdisk program (the man pages are often a good place to start) for information about creating Linux native partitions and writing partition tables.

The designation of your new partition should be remembered. It might be something similar to hda11. This newly created partition will be referred to as the LFS partition in this book.