<< Back to man.ChinaUnix.net

2.2. Creating a New Partition

In order to build a new Linux system, space is required in the form of an empty disk partition. If the computer does not have a free partition or room on any of the hard disks to make one, LFS can be built on the same partition where the current distribution is installed.

[Note]

Note

This advanced procedure is not recommended for your first LFS installation, but if you are short on disk space the following document can be helpful: http://www.linuxfromscratch.org/hints/downloads/files/lfs_next_to_existing_systems.txt.

A minimal system requires a partition of around 1.3 gigabytes (GB). This is enough to store all the source tarballs and compile the packages. However, if the LFS system is intended to be the primary Linux system, additional software will probably be installed which will require additional space (2 or 3 GB). The LFS system itself will not take up this much space. A large portion of this required amount of space is to provide sufficient free temporary space. Compiling packages can require a lot of disk space which will be reclaimed after the package is installed.

Because there is not always enough Random Access Memory (RAM) available for compilation processes, it is a good idea to use a small disk partition as swap space. This space is used by the kernel to store seldom-used data to make room in memory for active processes. The swap partition for an LFS system can be the same as the one used by the host system, so another swap partition will not need to be created if your host system already has one setup.

Start a disk partitioning program such as cfdisk or fdisk with a command line option naming the hard disk on which the new partition will be created—for example /dev/hda for the primary Integrated Drive Electronics (IDE) disk. Create a Linux native partition and a swap partition, if needed. Please refer to the man pages of cfdisk or fdisk if you do not yet know how to use the programs.

Remember the designation of the new partition (e.g., hda5). This book will refer to this as the LFS partition. Also remember the designation of the swap partition. These names will be needed later for the /etc/fstab file.