Diskleri hazırlama

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page Handbook:AMD64/Installation/Disks and the translation is 100% complete.

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎čeština • ‎русский • ‎українська • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
AMD64 Handbook
About the installation
Choosing the media
Configuring the network
Preparing the disks
Installing stage3
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Mixing software branches
Additional tools
Custom package repository
Advanced features
Network configuration
Getting started
Advanced configuration
Modular networking
Adding functionality
Dynamic management

Blok aygıtlarına giriş

Blok aygıtları

Şimdi de Gentoo Linux'a, hatta genel olarak Linux'a disk açısından bakalım ve dosya sistemleri, disk bölümleri ve blok aygıtlarını inceleyelim. Bu kavramlar anlaşıldıktan sonra Gentoo Linux kurulumu için disk ve dosya sistemi yapılandırmasına geçeceğiz.

Öncelikle blok aygıtlarına bakalım. Muhtemelen en ünlü blok aygıtı, Linux sistemindeki ilk diski simgeleyen /dev/sda'dir. Sisteme SCSI, Serial ATA ve hatta IDE kanalı ile bağlanmış diskler bile /dev/sd* olarak isimlendirilir. Eski sistemlerde IDE'ler /dev/hd* olarak isimlendirilmekteydi.

Yukarıdaki blok aygıtının ismi, diske erişmemizde yardımcı olan bir arayüzdür. Kullandığınız programlar, diskin nasıl bağlandığı ile ilgilenmeden, bu blok aygıtlarını kullanarak diskiniz üzerinde işlem yaparlar. Programlar diski basitçe, 512-byte'lık bloklar halinde erişilebilen bir kaydetme ortamı olarak görecektir.

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 amd64 systems, these are called partitions. There are currently two standard partitioning technologies in use: MBR and GPT.


The MBR (Master Boot Record) setup uses 32-bit identifiers for the start sector and length of the partitions, and supports three partition types: primary, extended, and logical. Primary partitions have their information stored in the master boot record itself - a very small (usually 512 bytes) location at the very beginning of a disk. Due to this small space, only four primary partitions are supported (for instance, /dev/sda1 to /dev/sda4).

To support more partitions, one of the primary partitions can be marked as an extended partition. This partition can then contain logical partitions (partitions within a partition).

Although still supported by most motherboard manufacturers partition tables are considered legacy. Unless working with hardware that is pre-2010, it best to partition a disk using a GUID Partition Table. Readers who must proceed with MBR should acknowledge the following information:
  • Most post-2010 motherboards consider MBR a legacy (supported, but not ideal) boot mode.
  • Due to using 32-bit identifiers, master boot record partitioning tables cannot handle disks that are greater than 2 TiBs in size.
  • Unless a extended partition is created, MBR supports a maximum of four partitions.
  • The MBR setup does not provide any backup-MBR, so if an application or user overwrites the MBR, all partition information is lost.

The Handbook authors suggest using GPT whenever possible for Gentoo installations.


The GPT (GUID Partition Table) setup uses 64-bit identifiers for the partitions. The location in which it stores the partition information is much bigger than the 512 bytes of an MBR, 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, zettabytes).

When a system's software interface between the operating system and firmware is UEFI (instead of BIOS), GPT is almost mandatory as compatibility issues will arise with MBR.

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 veya MBR

From the description above, one might think that using GPT should always be the recommended approach, however there are a few caveats.

Using GPT on a BIOS-based computer works, but then one cannot dual-boot with a Microsoft Windows operating system. The reason is that Microsoft Windows will boot in UEFI mode if it detects a GPT partition label.

Some buggy motherboard firmware configured to boot in BIOS/CSM/legacy mode might also have problems with booting from GPT labeled disks. If that is the case, it might be possible to work around the problem by adding the boot/active flag on the protective MBR partition which has to be done through fdisk with the -t dos option to force it to read the partition table using the MBR format.

In this case, launch fdisk and toggle the flag using the a key. Press 1 to select the first partition, then press the w key to write the changes to the disk and exit the fdisk application:

user $fdisk -t dos /dev/sda
Welcome to fdisk (util-linux 2.24.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): a
Partition number (1-4): 1
Command (m for help): w

Using UEFI

When installing Gentoo on a system that uses UEFI to boot the operating system (instead of BIOS), then it is important that an EFI System Partition (ESP) is created. The instructions for parted below contain the necessary pointers to correctly handle this operation.

The ESP must be a FAT variant (sometimes shown as vfat on Linux systems). The official UEFI specification denotes FAT12, 16, or 32 filesystems will be recognized by the UEFI firmware, although FAT32 is recommended for the ESP. Proceed in formatting the ESP as FAT32:

root #mkfs.fat -F 32 /dev/sda2
If a FAT variant is not used for the ESP, the system's UEFI firmware is not guaranteed to find the bootloader (or Linux kernel) and most likely be unable to boot the system!

Advanced storage

Btrfs RAID

As noted above, btrfs has the ability to create filesystems across multiple devices. Btrfs filesystems generated in this way can act in the following modes: raid0, raid1, raid10, raid5, and raid6. RAID modes 5 and 6 have improved considerably, but are still considered unstable. After a multiple device filesystem has been created, new devices can be added and old devices removed in a few commands. Btrfs takes more involvement than other filesystems making it not as friendly to beginners.

ext4 filesytems can be converted into btrfs filesystems, which may be useful for those who'd like to install Gentoo with a stable, well tested filesystem and gradually increase their knowledge about newer filesystems such as btrfs by experimentation.


The amd64 Installation CDs provide support for Logical Volume Manager (LVM). LVM increases the flexibility offered by the partitioning setup. The installation instructions below will focus on "regular" partitions, but it is good to know LVM is supported if that route is desired. Visit the LVM article for more details. Newcomers beware: although fully supported LVM is outside the scope of this guide.

Default partitioning scheme

Throughout the remainder of the handbook, the following partitioning scheme will be used as a simple example layout:

Partition Filesystem Size Description
/dev/sda1 (bootloader) 2M BIOS boot partition
/dev/sda2 ext2 (or fat32 if UEFI is being used) 128M Boot/EFI system partition
/dev/sda3 (swap) 512M or higher Swap partition
/dev/sda4 ext4 Rest of the disk Root partition

If this suffices and the reader going the GPT route they can immediately jump to Default: Using parted to partition the disk. Those who are still interested in MBR (hey - it happens!) and using the example layout can jump to Alternative: Using fdisk to partition the disk.

Both fdisk and parted are partitioning utilities. fdisk is well known, stable, and recommended for the MBR partition layout while parted was one of the first Linux block device management utilities to support GPT partitions. Those who like the user interface of fdisk can use gdisk (GPT fdisk) as an alternative to parted.

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.

Designing a partition scheme

How many partitions and how big?

The number of partitions is highly dependent on the environment. For instance, if there are lots of users, then it is advised to have /home/ separate as it increases security and makes backups easier. If Gentoo is being installed to perform as a mail server, then /var/ should be separate as all mails are stored inside /var/. A good choice of filesystem will then maximize the performance. Game servers will have a separate /opt/ as most gaming servers are installed there. The reason is similar for the /home/ directory: security and backups. In most situations, /usr/ is to be kept big: not only will it contain the majority of applications, it typically also hosts the Gentoo ebuild repository (by default located at /usr/portage) which already takes around 650 MiB. This disk space estimate excludes the packages/ and distfiles/ directories that are generally stored within this ebuild repository.

It very much depends on what the administrator wants to achieve. Separate partitions or volumes have the following advantages:

  • Choose the best performing filesystem for each partition or volume.
  • The entire system cannot run out of free space if one defunct tool is continuously writing files to a partition or volume.
  • If necessary, file system checks are reduced in time, as multiple checks can be done in parallel (although this advantage is more with multiple disks than it is with multiple partitions).
  • Security can be enhanced by mounting some partitions or volumes read-only, nosuid (setuid bits are ignored), noexec (executable bits are ignored) etc.

However, multiple partitions have disadvantages as well. If not configured properly, the system might have lots of free space on one partition and none on another. Another nuisance is that separate partitions - especially for important mount points like /usr/ or /var/ - often require the administrator to boot with an initramfs to mount the partition before other boot scripts start. This isn't always the case though, so results may vary.

There is also a 15-partition limit for SCSI and SATA unless the disk uses GPT labels.

What about swap space?

There is no perfect value for the swap partition. The purpose of swap space is to provide disk storage to the kernel when internal memory (RAM) is under pressure. A swap space allows for the kernel to move memory pages that are not likely to be accessed soon to disk (swap or page-out), freeing memory. Of course, if that memory is suddenly needed, these pages need to be put back in memory (page-in) which will take a while (as disks are very slow compared to internal memory).

When the system is not going to run memory intensive applications or the system has lots of memory available, then it probably does not need much swap space. However, swap space is also used to store the entire memory in case of hibernation. If the system is going to need hibernation, then a bigger swap space is necessary, often at least the amount of memory installed in the system.

What is the BIOS boot partition?

A BIOS boot partition 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 (a few hundred bytes in case of MBR) and cannot be placed elsewhere.

Such partitions are not always necessary, but considering the low space consumption and the difficulties we have with documenting the plethora of partitioning differences otherwise, it is recommended to create it in either case.

For completeness, the BIOS boot partition is needed when a GPT partition layout is used with GRUB2 in PC/BIOS mode. It is not required when booting in EFI/UEFI mode.

Default: Using parted to partition the disk

In this chapter, the example partition layout mentioned earlier in the instructions will be used:

Partition Description
/dev/sda1 BIOS boot partition
/dev/sda2 Boot partition
/dev/sda3 Swap partition
/dev/sda4 Root partition

Change the partition layout according to personal preference.

Viewing the current partition layout with parted

The parted application offers a simple interface for partitioning the disks and supports very large partitions (more than 2 TB). Fire up parted against the disk (in our example, we use /dev/sda). It is recommended to ask parted to use optimal partition alignment:

root #parted -a optimal /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.

Alignment means that partitions are started on well-known boundaries within the disk, ensuring that operations on the disk from the operating system level (retrieve pages from the disk) use the least amount of internal disk operations. Misaligned partitions might require the disk to fetch two pages instead of one even if the operating system asked for a single page.

To find out about all options supported by parted, type help and press return.

Setting the GPT label

Most disks on the x86 or amd64 architectures are prepared using an msdos label. Using parted, the command to put a GPT label on the disk is mklabel gpt:

Changing the partition type will remove all partitions from the disk. All data on the disk will be lost.
(parted)mklabel gpt

To have the disk with MBR layout, use mklabel msdos.

Removing all partitions with parted

If this isn't done yet (for instance through the mklabel operation earlier, or because the disk is a freshly formatted one), first remove all existing partitions from the disk. Type print to view the current partitions, and rm <N> where <N> is the number of the partition to remove.

(parted)rm 2

Do the same for all other partitions that aren't needed. However, make sure to not make any mistakes here - parted executes the changes immediately (unlike fdisk which stages them, allowing a user to "undo" his changes before saving or exiting fdisk).

Creating the partitions

Now parted will be used to create the partitions with the following settings:

  • The partition type to use. This usually is primary. If the msdos partition label is used, keep in mind that there can be no more than 4 primary partitions. If more than 4 partitions are needed, make one of the first four partitions extended and create logical partitions inside it.
  • The start location of a partition (which can be expressed in MB, GB, ...)
  • The end location of the partition (which can be expressed in MB, GB, ...)

First, tell parted that the size unit we work with is megabytes (actually mebibytes, abbreviated as MiB which is the "standard" notation, but we will use MB in the text throughout as it is much more common):

(parted)unit mib

Now create a 2 MB partition that will be used by the GRUB2 boot loader later. Use the mkpart command for this, and inform parted to start from 1 MB and end at 3 MB (creating a partition of 2 MB in size).

(parted)mkpart primary 1 3
(parted)name 1 grub
(parted)set 1 bios_grub on
Model: Virtio Block Device (virtblk)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number   Start      End      Size     File system  Name   Flags
 1       1.00MiB    3.00MiB  2.00MiB               grub   bios_grub

Do the same for the boot partition (128 MB), swap partition (in the example, 512 MB) and the root partition that spans the remaining disk (for which the end location is marked as -1, meaning the end of the disk minus one MB, which is the farthest a partition can go).

(parted)mkpart primary 3 131
(parted)name 2 boot
(parted)mkpart primary 131 643
(parted)name 3 swap
(parted)mkpart primary 643 -1
(parted)name 4 rootfs

When using the UEFI interface to boot the system (instead of BIOS), mark the boot partition as the EFI System Partition. Parted does this automatically when the boot option is set on the partition:

(parted)set 2 boot on

The end result looks like so:

Model: Virtio Block Device (virtblk)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number   Start      End      Size     File system  Name   Flags
 1       1.00MiB    3.00MiB  2.00MiB               grub   bios_grub
 2       3.00MiB    131MiB   128MiB                boot   boot
 3       131MiB     643MiB   512MiB                swap
 4       643MiB     20479MiB 19836MiB              rootfs
On an UEFI installation, the boot and esp flags will show up on the boot partition.

Use the quit command to exit parted.

Alternative: Using fdisk to partition the disk

Although recent fdisk should support GPT, it has still shown to have some issues with it. The instructions given below assume that the partition layout being used is MBR.

The following parts explain how to create the example partition layout using fdisk. The example partition layout was mentioned earlier:

Partition Description
/dev/sda1 BIOS boot partition
/dev/sda2 Boot partition
/dev/sda3 Swap partition
/dev/sda4 Root partition

Change the partition layout according to personal preference.

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
To use GPT support, add -t gpt. It is recommended to closely investigate the fdisk output in case more recent developments in fdisk change its default behavior of defaulting to MBR. The remainder of the instructions assume an MBR layout.

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

Command (m for help):p
Disk /dev/sda: 240 heads, 63 sectors, 2184 cylinders
Units = cylinders of 15120 * 512 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        14    105808+  83  Linux
/dev/sda2            15        49    264600   82  Linux swap
/dev/sda3            50        70    158760   83  Linux
/dev/sda4            71      2184  15981840    5  Extended
/dev/sda5            71       209   1050808+  83  Linux
/dev/sda6           210       348   1050808+  83  Linux
/dev/sda7           349       626   2101648+  83  Linux
/dev/sda8           627       904   2101648+  83  Linux
/dev/sda9           905      2184   9676768+  83  Linux

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

Removing all partitions with fdisk

First remove all existing partitions 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-4): 1

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: 30.0 GB, 30005821440 bytes
240 heads, 63 sectors/track, 3876 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Device Boot    Start       End    Blocks   Id  System

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

Creating the BIOS boot partition

First create a very small BIOS boot partition. Type n to create a new partition, then p to select a primary partition, followed by 1 to select the first primary partition. When prompted for the first sector, make sure it starts from 2048 (which is needed for the boot loader) and hit Enter. When prompted for the last sector, type +2M to create a partition 2 Mbyte in size:

The start from sector 2048 is a fail-safe in case the boot loader does not detect this partition as being available for its use.
Command (m for help):n
Command action
  e   extended
  p   primary partition (1-4)
Partition number (1-4): 1
First sector (64-10486533532, default 64): 2048
Last sector, +sectors +size{M,K,G} (4096-10486533532, default 10486533532): +2M

Mark the partition for UEFI purposes:

Command (m for help):t
Selected partition 1
Hex code (type L to list codes): 4
Changed system type of partition 1 to 4 (BIOS boot)
Using UEFI with MBR partition layout is discouraged. If an UEFI capable system is used, please use GPT layout.

Creating the boot partition

Now create a small boot partition. Type n to create a new partition, then p to select a primary partition, followed by 2 to select the second primary partition. When prompted for the first sector, accept the default by hitting Enter. When prompted for the last sector, type +128M to create a partition 128 Mbyte in size:

Command (m for help):n
Command action
  e   extended
  p   primary partition (1-4)
Partition number (1-4): 2
First sector (5198-10486533532, default 5198): (Hit enter)
Last sector, +sectors +size{M,K,G} (4096-10486533532, default 10486533532): +128M

Now, when pressing p, the following partition printout is displayed:

Command (m for help):p
Disk /dev/sda: 30.0 GB, 30005821440 bytes
240 heads, 63 sectors/track, 3876 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1             1         3      5198+  ef  EFI (FAT-12/16/32)
/dev/sda2             3        14    105808+  83  Linux

Type a to toggle the bootable flag on a partition and select 2. After pressing p again, notice that an * is placed in the "Boot" column.

Creating the swap partition

To create the swap partition, type n to create a new partition, then p to tell fdisk to create a primary partition. Then type 3 to create the third primary partition, /dev/sda3. When prompted for the first sector, hit Enter. When prompted for the last sector, type +512M (or any other size needed for the swap space) to create a partition 512MB in size.

After all this is done, type t to set the partition type, 3 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 n to create a new partition, then p to tell fdisk to create a primary partition. Then type 4 to create the fourth primary partition, /dev/sda4. 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: 30.0 GB, 30005821440 bytes
240 heads, 63 sectors/track, 3876 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1             1         3      5198+  ef  EFI (FAT-12/16/32)
/dev/sda2   *         3        14    105808+  83  Linux
/dev/sda3            15        81    506520   82  Linux swap
/dev/sda4            82      3876  28690200   83  Linux

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.

Dosya sistemlerini oluşturmak


Disk bölümlerimizi oluşturduğumuza göre, şimdi üzerlerinde bir dosya sistemi yaratma zamanı. Gelecek bölümde Linux'un desteklediği bazı dosya sistemlerini açıklayacağız. Zaten bildiğiniz bir konu ie disk bölümünü biçimlendirme kısmından devam edebilirsiniz.

Dosya sistemleri

Kullanabileceğiniz çok sayıda dosya sistemi mevcut. Bazıları amd64 mimarisinde kararlı durumda. Önemli disk bölümlerinde kullanacağınız dosya sistemleri için özelliklerini ve desteklenip desteklenmediğini okumanızı tavsiye ediyoruz.

Denenmiş ve köklü bir Linux dosya sistemidir ancak metadata journaling (günlük tutma) özelliği yoktur. Bu sebeple dosya sistemi kararsız durumda ise sistem açılış sırasında doğruluğunu kontrol etmek için oldukça vakit harcayabilir. Modern dosya sistemlerindeki günlük tutma özelliğinin getirilerinden dolayı artık pek tercih edilmemektedir.
ext2 dosya sisteminin günlük tutan sürümüdür. Nerdeyse tüm durumlarda yüksek performans sağlayan HTree index yapısını kullanır. Kısaca ext3, kaliteli ve güvenilir bir dosya sistemidir.
Önceleri ext3'ün bir kopyası olarak başlanmasına rağmen, artık ext3'ün devamı niteliğini taşıyan bu dosya sistemi fazla sayıda yeni özellik ve performans artışı getirmektedir. 1 EB (1 milyon terabayt) disk bölümleri ve 16 terabayt boyutundaki dosyalar ile çalışabilir. ext2/3'de kullanılan "bitmap block allocation" altyapısının yerine ext4'de "extents" kullanılmaktadır, bu da büyk dosyalarda performans kaybını engellemekte ve alt seviyede bölünmeleri azaltmaktadır. Ext4 ayrıca daha gelişmiş allocation algoritmalarını da destekler, bu sayede kullanıcı dosya sistemi üzerindeki düzeni daha optimize hale getirebilir. Ext4 tüm amaçlar ve platformlar için kullanılabileceği önerilen bir dosya sistemidir.
IBM'in yüksek performanslı günlük tutan dosya sistemidir. Çoğu durumda performans sağlayan, hafif bir dosya sistemidir ve B+tree yapısı kullanır.
Bir başka B+tree altyapılı ve günlük tutan dosya sistemi. Genel olarak performansı (özellikle çok sayıda ufak dosya ile işlem yaparken) gayet iyi olmasına rağmen, son zamanlarda pek fazla bakımı yapılmayan bir dosya sistemidir.
Esnekliği ve özellikleri ile ön plana çıkan ve günlük tutan bir dosya sistemdir. Ancak donanım arızalarında diğer dosya sistemlerine göre daha fazla sorun çıkarabilmektedir.
FAT32 olarak da bilinir, Linux tarafından desteklenir ancak yetkilendirme altyapısı desteği yoktur. Genellikle (Microsoft Windows gibi) bazı işletim sistemleri ile uyumluluk amacıyla kullanılır ancak bazı gömülü sistem yazılımları (firmware'ler) için zorunludur (UEFI gibi).

Ufak disk bölümlerinde (8GB'dan az) ext2, ext3 veya ext4 kullanacaksanız dosya sistemini oluştururken yeterli inode sayısına sahip olacak şekilde oluşturmanız gerekmekte. mke2fs öntanımlı olarak boyuta göre inode sayısını ayarladığından, küçük disk bölümlerinde elle müdahale tavsiye edilmekte.

ext2'de bu işlem şöyle yapılabilir:

root #mke2fs -T small /dev/<aygit>

Bu sayede inode sayısı her 16kB'dan her 4kB'a inerek dörde katlanacaktır. Oran değiştirilerek bu daha da fazla yapılabilir:

root #mke2fs -i <oran> /dev/<aygit>

Disk bölümünü biçimlendirme

Fiziksel veya mantıksal bir disk bölümünü bir dosya sistemi ile biçimlendirmek için kullanabileceğiniz araçlar bulunmakta:

Dosya sistemi Oluşturma komutu
ext2 mkfs.ext2
ext3 mkfs.ext3
ext4 mkfs.ext4
reiserfs mkreiserfs
xfs mkfs.xfs
jfs mkfs.jfs
vfat mkfs.vfat

For instance, to have the boot partition (/dev/sda2) in ext2 and the root partition (/dev/sda4) in ext4 as used in the example partition structure, the following commands would be used:

root #mkfs.ext2 /dev/sda2
root #mkfs.ext4 /dev/sda4

Şimdi mantıksal veya fiziksel bölümlerinizi biçimlendirebilirsiniz.

Swap Bölümünü Etkinleştirme

Bir bölümü swap haline getirmek için mkswap kullanılır:

root #mkswap /dev/sda3

Swap bölümünü aktifleştirmek için ise swapon:

root #swapon /dev/sda3

Yukardaki adımları kullanarak swap bölümlerini oluşturabilir ve kullanabilirsiniz.


Artık disk bölümlerimizde birer dosya sistemi de var, yani sisteme bağlayabiliriz. mount komutuna gerekli dizinleri parametre olarak verip bağlayabiliriz. Örneğin kök ve boot bölümünü bağlayalım:

root #mount /dev/sda4 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda2 /mnt/gentoo/boot
Eğer /tmp/ dizini farklı bir disk bölümündeyse, bağladıktan sonra izinlerini değiştirmeniz gerekmekte:
root #chmod 1777 /mnt/gentoo/tmp
Bu ayrıca /var/tmp için de geçerli.

İleri adımlarda proc (çekirdeğin kullandığı sanal arayüz) ve diğer özel dosya sistemlerini de bağlayacağız. Ancak önce Gentoo kurulum dosyalarını yükleyeceğiz.