2.5. Création d'un système de fichiers sur la partition

A partition is just a range of sectors on a disk drive, delimited by boundaries set in a partition table. Before the operating system can use a partition to store any files, the partition must be formatted to contain a file system, typically consisting of a label, directory blocks, data blocks, and an indexing scheme to locate a particular file on demand. The file system also helps the OS keep track of free space on the partition, reserve the needed sectors when a new file is created or an existing file is extended, and recycle the free data segments created when files are deleted. It may also provide support for data redundancy, and for error recovery.

LFS can use any file system recognized by the Linux kernel, but the most common types are ext3 and ext4. The choice of the right file system can be complex; it depends on the characteristics of the files and the size of the partition. For example:

ext2

convient aux petites partitions rarement renouvelées, telles que /boot.

ext3

est une mise à jour du type ext2 qui comprend un journal aidant à récupérer l'état de la partition en cas d'arrêt brutal. Ce type est communément employé dans une perspective généraliste.

ext4

is the latest version of the ext family of file systems. It provides several new capabilities including nano-second timestamps, creation and use of very large files (up to 16 TB), and speed improvements.

Other file systems, including FAT32, NTFS, ReiserFS, JFS, and XFS are useful for specialized purposes. More information about these file systems, and many others, can be found at https://en.wikipedia.org/wiki/Comparison_of_file_systems.

LFS assumes that the root file system (/) is of type ext4. To create an ext4 file system on the LFS partition, issue the following command:

mkfs -v -t ext4 /dev/<xxx>

Remplacez <xxx> par le nom de la partition LFS.

Si vous utilisez une partition de swap déjà existante, il n'est pas nécessaire de la formater. Afin d'utiliser une partition swap qui vient d'être créée, il sera nécessaire de l'initialiser à l'aide de la commande suivante :

mkswap /dev/<yyy>

Remplacez <yyy> par le nom de votre partition de swap.