Handbuch:SPARC/Installation/Festplatten
Einführung in blockorientierte Geräte
Blockorientierte Geräte
Schauen wir uns die Festplatten-spezifischen Aspekte von Gentoo Linux und Linux im Allgemeinen an - insbesondere blockorientierte Geräte (Block Devices), Partitionen und Linux Dateisysteme. Wenn Sie die Vor- und Nachteile von Festplatten verstanden haben, können Sie Partitionen und Dateisysteme für die Installation erstellen.
Zu Beginn schauen wir uns blockorientierte Geräte an. SCSI- und SATA-Laufwerke haben Device-Namen wie: /dev/sda, /dev/sdb, /dev/sdc usw. Modernere Rechner können PCI-Express basierte NVMe Solid-State-Disks haben, die Device-Namen haben wie: /dev/nvme0n1, /dev/nvme0n2 usw.
Die folgende Tabelle soll Lesern dabei helfen herauszufinden, wo bestimmte Arten von blockorientierten Geräten zu finden sind:
Device-Typ | Standard Device-Name | Anmerkungen |
---|---|---|
SATA, SAS, SCSI, or USB flash | /dev/sda | Diese Device-Typen werden auf Hardware ab 2007 verwendet - und sind vermutlich die am häufigsten genutzten Device-Namen unter Linux. Diese Geräte werden als blockorientierter Speicher angeschlossen über den SATA bus, über SCSI und über USB. Beispielsweise wird die erste Partition des ersten SATA-Devices /dev/sda1 genannt. |
NVM Express (NVMe) | /dev/nvme0n1 | The latest in solid state technology, NVMe drives are connected to the PCI Express bus and have the fastest transfer block speeds on the market. Systems from around 2014 and newer may have support for NVMe hardware. The first partition on the first NVMe device is called /dev/nvme0n1p1. |
MMC, eMMC, and SD | /dev/mmcblk0 | embedded MMC devices, SD cards, and other types of memory cards can be useful for data storage. That said, many systems may not permit booting from these types of devices. It is suggested to not use these devices for active Linux installations; rather consider using them to transfer files, which is their design goal. Alternatively they could be useful for short-term backups. |
Die oben genannten blockorientierten Geräte repräsentieren eine abstrakte Schnittstelle zur Festplatte. Benutzerprogramme können diese Block Devices nutzen, um mit der Festplatte zu interagieren, ohne sich darum sorgen zu müssen, ob die Festplatten über SATA, SCSI oder etwas anderem angebunden sind. Das Programm kann den Speicher auf der Festplatte einfach als eine Anhäufung zusammenhängender 4096-Byte (4k) Blöcke mit wahlfreiem Zugriff ansprechen.
Partition tables
Although it is theoretically possible to use a raw, unpartitioned disk to house a Linux system (when creating a btrfs RAID for example), this is almost never done in practice. Instead, disk block devices are split up into smaller, more manageable block devices. On sparc systems, these are called partitions. There are currently two standard partitioning technologies in use: Sun and GPT; the latter is supported only on more recent systems with a sufficiently recent firmware.
GUID Partition Table (GPT)
The GUID Partition Table (GPT) setup (also called GPT disklabel) uses 64-bit identifiers for the partitions. The location in which it stores the partition information is much bigger than the 512 bytes of the MBR partition table (DOS disklabel), which means there is practically no limit on the amount of partitions for a GPT disk. Also the size of a partition is bounded by a much greater limit (almost 8 ZiB - yes, zebibytes).
GPT also takes advantage of checksumming and redundancy. It carries CRC32 checksums to detect errors in the header and partition tables and has a backup GPT at the end of the disk. This backup table can be used to recover damage of the primary GPT near the beginning of the disk.
GPT is only supported on Oracle SPARC machines of the T4 generation or newer. Additionally, only certain more recent firmware includes GPT support. There are several methods to check whether GPT support is available.
From the OBP prompt, execute:
{0} ok
cd /packages/disk-label
{0} ok
.properties
supported-labels gpt
sun mbrname disk-label
If gpt is included in the output, then GPT support is available. Alternatively, this can be determined from the installation media without entering OBP. Use the prtconf command from sys-apps/sparc-utils to access this information from userspace:
root #
prtconf -pv | grep -c gpt
Or, check if the file /sys/firmware/devicetree/base/packages/disk-label/gpt exists. If none of these methods succeeds, then a firmware update is required in order to support GPT.
Sun partition table
Systems not manufactured by Oracle, T3 or earlier systems, or systems running an earlier firmware must use the Sun partition table type.
The third partition on Sun systems is set aside as a special "whole disk" slice. This partition must not contain a file system.
Users who are used to the DOS partitioning scheme should note that Sun partition tables do not have "primary" and "extended" partitions. Instead, up to eight partitions are available per drive, with the third of these being reserved.
The Handbook authors suggest using GPT whenever possible for Gentoo installations.
Default partitioning scheme
Due to the differences in required partition layout between GPT and Sun partition tables, a single partitioning scheme is not sufficient to support all possible system requirements. Some example schemes are provided below.
GPT partition scheme
The following partitioning scheme will be used as an example for GPT-formatted disks:
Partition | Filesystem | Size | Mount Point | Description |
---|---|---|---|---|
/dev/sda1 | (none) | 2M | none | BIOS boot partition |
/dev/sda2 | (swap) | RAM size * 2 | none | Swap partition |
/dev/sda3 | ext4 | Rest of the disk | / | Root partition |
Sun formatted partition scheme
The following partitioning scheme will be used as an example for Sun-formatted disks:
Partition | Filesystem | Size | Mount Point | Description |
---|---|---|---|---|
/dev/sda1 | ext4 | Disk size minus swap | / | Root partition |
/dev/sda2 | (swap) | RAM size * 2 | none | Swap partition |
/dev/sda3 | (none) | Whole disk | none | Whole disk partition.
Required on disks using the Sun partition table. |
SPARC systems using OBP version 3 or older have additional restrictions on their partitioning scheme. The root partition must be the first partition on the disk, and it may be no larger than 2 GiB. For this reason, such systems will require additional sufficiently-sized partitions for top-level directories, such as /usr, /var, /home, and other directories which would likely cause the root partition to exceed this limit. These systems are also likely to require the Sun partition table type, so do not forget to include the whole disk partition.
Partitioning the disk with GPT
The following parts explain how to create the example partition layout for a GPT installation using fdisk. The example partition layout was mentioned earlier:
Partition | Description |
---|---|
/dev/sda1 | Boot partition |
/dev/sda2 | Swap partition |
/dev/sda3 | Root partition |
Change the partition layout according the system's needs.
Viewing the current partition layout
fdisk is a popular and powerful tool to split a disk into partitions. Fire up fdisk against the disk (in the example, /dev/sda is used):
root #
fdisk /dev/sda
Use the p key to display the disk's current partition configuration:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 9850A2C2-76C4-FC47-9F0B-DA60449D2413 Device Start End Sectors Size Type /dev/sda1 2048 30547967 30545920 14.6G Linux filesystem
Creating a new disklabel and removing all existing partitions
Type g to create a new GPT disklabel on the disk; this will remove all existing partitions.
Command (m for help):
g
Created a new GPT disklabel (GUID: 9850A2C2-76C4-FC47-9F0B-DA60449D2413).
For an existing GPT disklabel (see the output of p above), alternatively consider removing the existing partitions one by one from the disk. Type d to delete a partition. For instance, to delete an existing /dev/sda1:
Command (m for help):
d
Selected partition 1 Partition 1 has been deleted.
The partition has now been scheduled for deletion. It will no longer show up when printing the list of partitions (p, 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 q immediately and hit Enter and the partition will not be deleted.
Repeatedly type p to print out a partition listing and then type d and the number of the partition to delete it. Eventually, the partition table will be empty:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 9850A2C2-76C4-FC47-9F0B-DA60449D2413
Now that the in-memory partition table is empty, we're ready to create the partitions.
Creating the BIOS boot partition
First, create the BIOS boot partition. Type n to create a new partition, followed by 1 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 Enter. When prompted for the last sector, type +2M to create a partition 2 Mbyte in size:
Command (m for help):
n
Partition number (1-128, default 1): First sector (2048-30548062, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30548062, default 30547967): +2M Created a new partition 1 of type 'Linux filesystem' and of size 2 MiB.
Mark the partition as a BIOS boot partition:
Command (m for help):
t
Selected partition 1 Partition type or alias (type L to list all): 4 Changed type of partition 'Linux filesystem' to 'BIOS boot'.
Creating the swap partition
Next, to create the swap partition, type n to create a new partition, then type 2 to create the second partition, /dev/sda2. When prompted for the first sector, hit Enter. When prompted for the last sector, type +4G (or any other size needed for the swap space) to create a partition 4 GiB in size.
Command (m for help):
n
Partition number (2-128, default 2): First sector (6144-30548062, default 6144): Last sector, +/-sectors or +/-size{K,M,G,T,P} (6144-30548062, default 30547967): +4G Created a new partition 2 of type 'Linux filesystem' and of size 4 GiB.
After all this is done, type t to set the partition type, 2 to select the partition just created and then type in 19 to set the partition type to "Linux Swap".
Command (m for help):
t
Partition number (1,2, default 2): 2 Partition type (type L to list all types): 19 Changed type of partition 'Linux filesystem' to 'Linux swap'.
Creating the root partition
Finally, to create the root partition, type n to create a new partition. Then type 3 to create the third partition, /dev/sda3. When prompted for the first sector, hit Enter. When prompted for the last sector, hit Enter to create a partition that takes up the rest of the remaining space on the disk. After completing these steps, typing p should display a partition table that looks similar to this:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 9850A2C2-76C4-FC47-9F0B-DA60449D2413 Device Start End Sectors Size Type /dev/sda1 2048 6143 4096 2M BIOS boot /dev/sda2 6144 8394751 8388608 4G Linux swap /dev/sda3 8394752 30547967 22153216 10.6G Linux filesystem
Saving the partition layout
To save the partition layout and exit fdisk, type w.
Command (m for help):
w
With the partitions created, it is now time to put filesystems on them.
Partitioning the disk with a Sun partition table
The following parts explain how to create the example partition layout for a Sun partition table installation using fdisk. The example partition layout was mentioned earlier:
Partition | Description |
---|---|
/dev/sda1 | Root partition |
/dev/sda2 | Swap partition |
/dev/sda3 | Whole disk partition |
Change the partition layout according to personal preference. If partitioning for a system using OBP version 3 or earlier, ensure that the root partition is less than 2G in size, and additionally create partitions /dev/sda4 and onward for additional filesystems.
Viewing the current partition layout
fdisk is a popular and powerful tool to split a disk into partitions. Fire up fdisk against the disk (in our example, we use /dev/sda):
root #
fdisk /dev/sda
Use the p key to display the disk's current partition configuration:
Command (m for help):
p
Disk model: USB Flash Disk Geometry: 64 heads, 32 sectors/track, 14916 cylinders Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: sun Device Start End Sectors Size Id Type Flags /dev/sda1 0 30445567 30445568 14.5G 83 Linux native /dev/sda2 30445568 30547967 102400 50M 82 Linux swap u /dev/sda3 0 30547967 30547968 14.6G 5 Whole disk
Creating a new disklabel / removing all partitions
Type s to create a new Sun disklabel on the disk; this will remove all existing partitions.
Command (m for help):
s
Created a new partition 1 of type 'Linux native' and of size 14.5 GiB. Created a new partition 2 of type 'Linux swap' and of size 50 MiB. Created a new partition 3 of type 'Whole disk' and of size 14.6 GiB. Created a new Sun disklabel.
For an existing Sun disklabel (see the output of p above), alternatively consider removing the existing partitions one by one from the disk. Type d to delete a partition. For instance, to delete an existing /dev/sda1:
Command (m for help):
d
Partition number (1-3, default 3): 1 Partition 1 has been deleted.
The partition has now been scheduled for deletion. It will no longer show up when printing the list of partitions (p, 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 q immediately and hit Enter and the partition will not be deleted.
Repeatedly type p to print out a partition listing and then type d and the number of the partition to delete it. Eventually, the partition table will be empty:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Geometry: 64 heads, 32 sectors/track, 14916 cylinders Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: sun
Now that the in-memory partition table is empty, we're ready to create the partitions.
Creating the whole disk partition
First, create the whole disk partition. Type n to create a new partition, followed by 3 to select the third partition. When prompted for the first sector, hit Enter. When prompted for the last sector, hit Enter to create a partition that takes up all of the space on the disk.
Command (m for help):
n
Partition number (1-8, default 1): 3 It is highly recommended that the third partition covers the whole disk and is of type `Whole disk' First sector (0-30547968, default 0): Last sector or +/-sectors or +/-size{K,M,G,T,P} (0-30547968, default 30547968): Created a new partition 3 of type 'Whole disk' and of size 14.6 GiB.
fdisk will automatically set the type of such a partition to 'Whole disk', so there is no need to explicitly set the type.
Creating the root partition
Next, to create the root partition, type n to create a new partition. Then type 1 to create the third partition, /dev/sda1. When prompted for the first sector, hit Enter. When prompted for the last sector, type -4G (or whatever space is required for non-root partitions). After completing these steps, typing p should display a partition table that looks similar to this:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Geometry: 64 heads, 32 sectors/track, 14916 cylinders Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: sun Device Start End Sectors Size Id Type Flags /dev/sda1 0 22159359 22159360 10.6G 83 Linux native /dev/sda3 0 30547967 30547968 14.6G 5 Whole disk
Creating the swap partition
Finally, to create the swap partition, type n to create a new partition, then type 2 to create the second partition, /dev/sda2. When prompted for the first sector, hit Enter. When prompted for the last sector, hit Enter to take up the remaining space on the disk.
Command (m for help):
n
Partition number (2,4-8, default 2): First sector (22159360-30547968, default 22159360): Last sector or +/-sectors or +/-size{K,M,G,T,P} (22159360-30547968, default 30547968): Created a new partition 2 of type 'Linux native' and of size 4 GiB.
After all this is done, type t to set the partition type, 2 to select the partition just created and then type in 82 to set the partition type to "Linux Swap".
Command (m for help):
t
Partition number (1-3, default 3): 2 Hex code (type L to list all codes): 82 Changed type of partition 'Linux native' to 'Linux swap'.
After completing these steps, typing p should display a partition table that looks similar to this:
Command (m for help):
p
Disk /dev/sda: 14.57 GiB, 15640625152 bytes, 30548096 sectors Disk model: USB Flash Disk Geometry: 64 heads, 32 sectors/track, 14916 cylinders Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: sun Device Start End Sectors Size Id Type Flags /dev/sda1 0 22159359 22159360 10.6G 83 Linux native /dev/sda2 22159360 30547967 8388608 4G 82 Linux swap u /dev/sda3 0 30547967 30547968 14.6G 5 Whole disk
Saving the partition layout
To save the partition layout and exit fdisk, type w.
Command (m for help):
w
With the partitions created, it is now time to put filesystems on them.
Erstellen von Dateisystemen
Einleitung
Nachdem die Partitionen angelegt wurden, ist es an der Zeit, Dateisysteme darauf anzulegen. Im nächsten Abschnitt werden die unterschiedlichen Dateisysteme beschrieben, die Linux unterstützt. Leser, die bereits wissen, welches Dateisystem sie verwenden wollen, können bei Dateisystem auf einer Partition anlegen fortfahren. Alle anderen sollten weiterlesen, um mehr über die verfügbaren Dateisysteme zu erfahren ...
Dateisysteme
Linux unterstützt mehrere Dutzend Dateisysteme, wobei allerdings viele davon für ganz spezielle Anwendungszwecke optimiert sind. Nur einige Dateisysteme gelten als stabil auf der sparc Architektur. Es ist ratsam, sich über Dateisysteme und deren Unterstützungsgrad zu informieren, damit Sie nicht für wichtige Partitionen ein eher experimentelles Dateisystem wählen. ext4 ist das empfohlene all-round Dateisystem für alle Plattformen. Nachfolgend eine nicht-vollständige Auswahl von verfügbaren Dateisystemen.
- btrfs
- Ein "next-generation" Dateisystem, das moderne Features wie Snapshots, Selbst-Heilung mit Hilfe von Checksums, transparente Komprimierung, Subvolumes und integriertes RAID enthält. Kernel älter als 5.4.y enthalten Fehler, die zu "Filesystem corruption" führen können. Solche Kernel sollten keinesfalls auf Produktibsystemen eingesetzt werden. Das englische Original dieses Handbuchs beschreibt die Fehler folgendermaßen: "Kernels prior to 5.4.y are not guaranteed to be safe to use with btrfs in production because fixes for serious issues are only present in the more recent releases of the LTS kernel branches. Filesystem corruption issues are common on older kernel branches, with anything older than 4.4.y being especially unsafe and prone to corruption. Corruption is more likely on older kernels (than 5.4.y) when compression is enabled. RAID 5/6 and quota groups unsafe on all versions of btrfs. Furthermore, btrfs can counter-intuitively fail filesystem operations with ENOSPC when df reports free space due to internal fragmentation (free space pinned by DATA + SYSTEM chunks, but needed in METADATA chunks). Additionally, a single 4K reference to a 128M extent inside btrfs can cause free space to be present, but unavailable for allocations. This can also cause btrfs to return ENOSPC when free space is reported by df . Installing sys-fs/btrfsmaintenance and configuring the scripts to run periodically can help to reduce the possibility of ENOSPC issues by rebalancing btrfs, but it will not eliminate the risk of ENOSPC when free space is present. Some workloads will never hit ENOSPC while others will. If the risk of ENOSPC in production is unacceptable, you should use something else. If using btrfs, be certain to avoid configurations known to have issues. With the exception of ENOSPC, information on the issues present in btrfs in the latest kernel branches is available at the btrfs wiki status page."
- ext4
- Ursprünglich als Abspaltung von ext3 entstanden, bringt ext4 neue Funktionen, Leistungsverbesserungen und den Wegfall der Größenbeschränkungen durch moderate Änderungen des On-Disk-Formats. Es kann Datenträger mit bis zu 1 EB und mit Dateigrößen von bis zu 16 TB verwalten. Anstelle der klassischen ext2/3 Bitmap-Block-Allokation nutzt ext4 Extents, die die Performance bei großen Dateien verbessern und Fragmentierung reduzieren. ext4 bietet zusätzlich ausgereiftere Block-Allokation-Algorithmen (Zeitverzögerte Allokation und mehrfache Preallokation), die es dem Dateisystemtreiber ermöglichen, das Layout der Daten auf der Festplatte zu optimieren. Es ist das empfohlene Allzweck-Dateisystem für jede Plattform.
- f2fs
- The Flash-Friendly File System was originally created by Samsung for the use with NAND flash memory. As of Q2, 2016, this filesystem is still considered immature, but it is a decent choice when installing Gentoo to microSD cards, USB drives, or other flash-based storage devices.
- JFS
- Das Hochleistungs-Journaling-Dateisystem von IBM. JFS ist ein schlankes, schnelles und verlässliches B+-Baum basiertes Dateisystem mit guter Performance unter verschiedensten Gegebenheiten.
- XFS
- Ein Dateisystem mit Metadaten-Journaling, das mit einer Reihe robuster Fähigkeiten daherkommt und für Skalierbarkeit optimiert ist. XFS scheint gegenüber unterschiedlichen Hardwareproblemen weniger fehlertolerant zu sein, aber es wird kontinuierlich weiterentwickelt und um moderne Features erweitert.
- VFAT
- Auch als FAT32 bekannt, wird von Linux unterstützt, aber unterstützt keine Standard UNIX Berechtigungen. Es wird vor allem aus Kompatibilitätsgründen und zum Datenaustausch mit anderen Betriebssystemen (Microsoft Windows oder Apples macOS) verwendet. VFAT ist Voraussetzung für die Bootloader Firmware mancher Systeme (wie UEFI). Auf UEFI Systemen wird zum Booten eine EFI System Partition benötigt, die mit VFAT formatiert ist.
- NTFS
- This "New Technology" filesystem is the flagship filesystem of Microsoft Windows since Windows NT 3.1. Similarly to VFAT, it does not store UNIX permission settings or extended attributes necessary for BSD or Linux to function properly, therefore it should not be used as a filesystem for most cases. It should only be used for interoperability/interchange with Microsoft Windows systems (note the emphasis on only).
Dateisystem auf einer Partition anlegen
Dateisysteme können mit Hilfe von Programmen auf einer Partition oder auf einem Datenträger angelegt werden. Die folgende Tabelle zeigt, welchen Befehl Sie für welches Dateisystem benötigen. Um weitere Informationen zu einem Dateisystem zu erhalten, können Sie auf den Namen des Dateisystems klicken.
Dateisystem | Befehl zum Anlegen | Teil der Minimal CD? | Gentoo Paket |
---|---|---|---|
btrfs | mkfs.btrfs | Yes | sys-fs/btrfs-progs |
ext4 | mkfs.ext4 | Yes | sys-fs/e2fsprogs |
f2fs | mkfs.f2fs | Yes | sys-fs/f2fs-tools |
jfs | mkfs.jfs | Yes | sys-fs/jfsutils |
reiserfs | mkfs.reiserfs | Yes | sys-fs/reiserfsprogs |
xfs | mkfs.xfs | Yes | sys-fs/xfsprogs |
vfat | mkfs.vfat | Yes | sys-fs/dosfstools |
NTFS | mkfs.ntfs | Yes | sys-fs/ntfs3g |
Um beispielsweise die root-Partition (/dev/sda1) als ext4 zu formatieren (wie in dem Beispiel-Partitionsschema), würde man folgende Befehle verwenden:
root #
mkfs.ext4 /dev/sda1
Bei der Verwendung von ext4 auf kleinen Partitionen (kleiner als 8 GiB), sollte das Dateisystem mit den passenden Optionen erstellt werden, um genügend Inodes zu reservieren. Dies kann mit einer der folgenden Anweisungen erfolgen:
root #
mkfs.ext4 -T small /dev/<device>
Dies vervierfacht die Zahl der Inodes für ein angegebenes Dateisystem in der Regel, da es dessen "bytes-per-inode" (Bytes pro Inode) von 16 kB auf 4 kB pro Inode reduziert.
Erzeugen Sie nun die Dateisysteme auf den zuvor erzeugten Partitionen (oder logischen Laufwerken).
Aktivieren der Swap-Partition
mkswap ist der Befehl der verwendet wird um Swap-Partitionen zu initialisieren:
root #
mkswap /dev/sda2
Zur Aktivierung der Swap-Partition verwenden Sie swapon:
root #
swapon /dev/sda2
Erzeugen und aktivieren Sie jetzt die Swap-Partition mit den oben genannten Befehlen.
Einhängen der Root-Partition
Anwender, die ein Nicht-Gentoo Installationsmedium verwenden, müssen mit folgendem Befehl einen Mount-Point erzeugen:
root #
mkdir --parents /mnt/gentoo
Nachdem die Partitionen initialisiert wurden und ein Dateisystem beinhalten, ist es an der Zeit, diese einzuhängen. Verwenden Sie den Befehl mount, aber vergessen Sie nicht die notwendigen Einhänge-Verzeichnisse für jede Partition zu erzeugen. Als Beispiel hängen wir die Root-Partition ein:
root #
mount /dev/sda1 /mnt/gentoo
Wenn sich /tmp/ auf einer separaten Partition befinden muss, ändern Sie die Berechtigungen nach dem Einhängen:
root #
chmod 1777 /mnt/gentoo/tmp
In der Anleitung wird später das Dateisystem proc (eine virtuelle Schnittstelle zum Kernel) zusammen mit anderen Kernel Pseudo-Dateisystemen eingehängt. Zunächst installieren wir jedoch die Gentoo Installationsdateien.