Handbook:AMD64/Blocks/Disks/fr

Tables de partition
Bien qu’il soit théoriquement possible d’utiliser un disque brut et non partitionné pour héberger un système Linux (lors de la création d’un RAID btrfs par exemple), cela n’est réellement jamais fait. Les périphériques de bloc de disque sont scindés en blocs plus petits, plus faciles à gérer. Pour l’architecture, on appelle ces blocs des partitions. Deux technologies de partitionnement standard sont actuellement disponibles : MBR et GPT.

GPT
La configuration GPT (GUID Partition Table) utilise des identifiants 64 bits pour les partitions. L'emplacement dans lequel elle stocke les informations de partition est beaucoup plus grand que les 512 octets d'un MBR, ce qui signifie qu'il n'y a pratiquement aucune limite sur le nombre de partitions d'un disque GPT. De plus, la taille d'une partition est limitée par une limite beaucoup plus grande (presque 8 Zo - oui, zettaoctets).

Lorsque l'interface logicielle entre le système d'exploitation et le micrologiciel est UEFI (au lieu du BIOS), GPT est presque obligatoire car des problèmes de compatibilité surviennent avec MBR.

GPT profite également de l'utilisation de la somme de contrôle et de la redondance. Il utilise les sommes de contrôle CRC32 pour détecter les erreurs dans les tables d'en-tête et de partition et dispose d'une sauvegarde GPT en fin de disque. Cette table de sauvegarde peut être utilisée pour réparer les dommages subis par le GPT principal situé au début du disque.

MBR
La configuration MBR (Master Boot Record) utilise des identifiants 32 bits pour le secteur de démarrage et la longueur des partitions et prend en charge trois types de partitions : primaire, étendue et logique. Les partitions primaires stockent leurs informations directement dans le MBR - un très petit emplacement (généralement 512 octets) au tout début d’un disque. En raison de cet espace restreint, seules quatre partitions primaires sont prises en charge (par exemple, à ).

Pour prendre en charge davantage de partitions, l’une des partitions primaire peut être marquée en tant que partition étendue. Cette partition peut alors contenir des partitions logiques (des partitions dans une partition).

Les auteurs de ce manuel suggèrent d'utiliser GPT autant que possible pour les installations de Gentoo.

Stockage avancé
Le CD d'installation supporte la gestion par volumes logiques (Logical Volume Manager - LVM). LVM augmente la flexibilité offerte par la configuration du partitionnement. Les instructions d'installation ci-dessous se concentrent sur des partitions normales, mais il est bon de savoir que LVM est pris en charge si cette route est souhaitée. Visitez l'article LVM/fr pour plus de détails. Les nouveaux utilisateurs doivent se méfier : bien que LVM soit entièrement pris en charge, son utilisation n’entre pas dans le cadre de ce manuel.

Schéma de partitionnement par défaut
Throughout the remainder of the handbook, we will discuss and explain two cases: 1) GPT partition table and UEFI boot, and 2) MBR partition table and legacy BIOS boot. While it is possible to mix and match, that goes beyond the scope of this manual. As already stated above, installations on modern hardware should use GPT partition table and UEFI boot; as an exception from this rule, MBR and BIOS boot is still frequently used in virtualized (cloud) environments.

Le schéma de partitionnement suivant sera utilisé comme exemple simple :

Si cela est suffisant et que le lecteur emprunte la route GPT, il peut immédiatement passer à Défaut : utiliser Parted pour partitionner le disque. Ceux qui sont toujours intéressés par l'utilisation de MBR et qui utilisent l'exemple de paritionnement peuvent aller à Alternative : utiliser fdisk pour partitionner le disque.

Both and  are partitioning utilities. is well known, stable, and recommended for the MBR partition layout. was one of the first Linux block device management utilities to support GPT partitions, and provides an alternative. Here, is used since it has a better text-based user interface.

Before going to the creation instructions, the first set of sections will describe in more detail how partitioning schemes can be created and mention some common pitfalls.

Utiliser UEFI
Lors de l'installation de Gentoo sur un système utilisant UEFI pour démarrer le système d'exploitation (au lieu de BIOS), il est important de créer une Partition Système EFI (ESP). Les instructions pour ci-dessous contiennent les indication nécessaires à la bonne réalisation de cette opération.

L'ESP doit être une variante FAT (parfois indiquée par vfat sur les systèmes Linux). La spécification UEFI (EN) officielle indique que les systèmes de fichiers FAT12, 16 ou 32 seront reconnus par le microprogramme UEFI, bien que FAT32 soit recommandé pour l'ESP. Procédez au formatage de l'ESP en FAT32 :

What is the BIOS boot partition?
A BIOS boot partition is only needed when combining a GPT partition layout with GRUB2 in BIOS/Legacy boot mode. It is not required when booting in EFI/UEFI mode, and also not required when using a MBR table. It is a very small (1 to 2 MB) partition in which boot loaders like GRUB2 can put additional data that doesn't fit in the allocated storage. It will not be used in this guide.

Alternative : utiliser fdisk pour partitionner le disque.

The following parts explain how to create the example partition layout for a GPT / UEFI boot installation using. The example partition layout was mentioned earlier:

Change the partition layout according to personal preference.

Viewing the current partition layout
is a popular and powerful tool to split a disk into partitions. Fire up against the disk (in our example, we use ):

Use the key to display the disk's current partition configuration:

This particular disk was configured to house two Linux filesystems (each with a corresponding partition listed as "Linux") as well as a swap partition (listed as "Linux swap").

Creating a new disklabel / removing all partitions
Type to create a new GPT disklabel on the disk; this will remove all existing partitions.

For an existing GPT disklabel (see the output of above), alternatively consider removing the existing partitions one by one from the disk. Type to delete a partition. For instance, to delete an existing :

The partition has now been scheduled for deletion. It will no longer show up when printing the list of partitions (, but it will not be erased until the changes have been saved. This allows users to abort the operation if a mistake was made - in that case, type immediately and hit  and the partition will not be deleted.

Repeatedly type to print out a partition listing and then type  and the number of the partition to delete it. Eventually, the partition table will be empty:

Now that the in-memory partition table is empty, we're ready to create the partitions.

Creating the EFI system partition (ESP)
First create a small EFI system partition, which will also be mounted as /boot. Type to create a new partition, followed by  to select the first partition. When prompted for the first sector, make sure it starts from 2048 (which may be needed for the boot loader) and hit. When prompted for the last sector, type +256M to create a partition 256 Mbyte in size:

Mark the partition as EFI system partition:

Creating the swap partition
Next, to create the swap partition, type to create a new partition, then type  to create the second partition,. When prompted for the first sector, hit. When prompted for the last sector, type +4G (or any other size needed for the swap space) to create a partition 4GB in size.

After all this is done, type to set the partition type,  to select the partition just created and then type in 19 to set the partition type to "Linux Swap".

Creating the root partition
Finally, to create the root partition, type to create a new partition. Then type to create the third partition,. When prompted for the first sector, hit. When prompted for the last sector, hit to create a partition that takes up the rest of the remaining space on the disk. After completing these steps, typing should display a partition table that looks similar to this:

Saving the partition layout
To save the partition layout and exit, type.

With the partitions created, it is now time to put filesystems on them.

Partitioning the disk with MBR for BIOS / legacy boot
The following explains how to create the example partition layout for a MBR / BIOS legacy boot installation. The example partition layout mentioned earlier is now:

Change the partition layout according to personal preference.

Viewing the current partition layout
Fire up against the disk (in our example, we use ):

Use the key to display the disk's current partition configuration:

This particular disk was until now configured to house two Linux filesystems (each with a corresponding partition listed as "Linux") as well as a swap partition (listed as "Linux swap"), using a GPT table.

Creating a new disklabel / removing all partitions
Type to create a new MBR disklabel (here also named DOS disklabel) on the disk; this will remove all existing partitions.

For an existing DOS disklabel (see the output of above), alternatively consider removing the existing partitions one by one from the disk. Type to delete a partition. For instance, to delete an existing :

The partition has now been scheduled for deletion. It will no longer show up when printing the list of partitions (, but it will not be erased until the changes have been saved. This allows users to abort the operation if a mistake was made - in that case, type immediately and hit  and the partition will not be deleted.

Repeatedly type to print out a partition listing and then type  and the number of the partition to delete it. Eventually, the partition table will be empty:

Now we're ready to create the partitions.

Creating the boot partition
First, create a small partition which will be mounted as /boot. Type to create a new partition, followed by  for a primary partition and  to select the first primary partition. When prompted for the first sector, make sure it starts from 2048 (which may be needed for the boot loader) and hit. When prompted for the last sector, type +256M to create a partition 256 Mbyte in size:

Creating the swap partition
Next, to create the swap partition, type to create a new partition, then, then type  to create the second primary partition,. When prompted for the first sector, hit. When prompted for the last sector, type +4G (or any other size needed for the swap space) to create a partition 4GB in size.

After all this is done, type to set the partition type,  to select the partition just created and then type in 82 to set the partition type to "Linux Swap".

Creating the root partition
Finally, to create the root partition, type to create a new partition. Then type and  to create the third primary partition,. When prompted for the first sector, hit. When prompted for the last sector, hit to create a partition that takes up the rest of the remaining space on the disk. After completing these steps, typing should display a partition table that looks similar to this:

Saving the partition layout
To save the partition layout and exit, type.

Now it is time to put filesystems on the partitions.