26.12.2014 Views

Gentoo Linux AMD64 Handbook

Gentoo Linux AMD64 Handbook

Gentoo Linux AMD64 Handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4. Preparing the Disks<br />

Introduction to Block Devices<br />

Block Devices<br />

Partitions<br />

We'll take a good look at disk-oriented aspects of <strong>Gentoo</strong> <strong>Linux</strong> and <strong>Linux</strong> in general, including <strong>Linux</strong><br />

filesystems, partitions and block devices. Then, once you're familiar with the ins and outs of disks<br />

and filesystems, you'll be guided through the process of setting up partitions and filesystems for your<br />

<strong>Gentoo</strong> <strong>Linux</strong> installation.<br />

To begin, we'll introduce block devices. The most famous block device is probably the one that<br />

represents the first drive in a <strong>Linux</strong> system, namely /dev/sda. SCSI and Serial ATA drives are both<br />

labeled /dev/sd*; even IDE drives are labeled /dev/sd* with the new libata framework in the<br />

kernel. If you're using the old device framework, then your first IDE drive is /dev/hda.<br />

The block devices above represent an abstract interface to the disk. User programs can use these<br />

block devices to interact with your disk without worrying about whether your drives are IDE, SCSI<br />

or something else. The program can simply address the storage on the disk as a bunch of contiguous,<br />

randomly-accessible 512-byte blocks.<br />

Although it is theoretically possible to use a full disk to house your <strong>Linux</strong> system, this is almost<br />

never done in practice. Instead, full disk block devices are split up in smaller, more manageable block<br />

devices. On <strong>AMD64</strong> systems, these are called partitions.<br />

Partitions are divided in three types: primary, extended and logical.<br />

A primary partition is a partition which has its information stored in the MBR (master boot record).<br />

As an MBR is very small (512 bytes) only four primary partitions can be defined (for instance, /dev/<br />

sda1 to /dev/sda4).<br />

An extended partition is a special primary partition (meaning the extended partition must be one<br />

of the four possible primary partitions) which contains more partitions. Such a partition didn't exist<br />

originally, but as four partitions were too few, it was brought to life to extend the formatting scheme<br />

without losing backward compatibility.<br />

A logical partition is a partition inside the extended partition. Their definitions aren't placed inside the<br />

MBR, but are declared inside the extended partition.<br />

Advanced Storage<br />

The <strong>AMD64</strong> Installation CDs provide support for LVM2. LVM2 increases the flexibility offered by<br />

your partitioning setup. During the installation instructions, we will focus on "regular" partitions, but<br />

it is still good to know LVM2 is supported as well.<br />

Designing a Partitioning Scheme<br />

Default Partitioning Scheme<br />

If you are not interested in drawing up a partitioning scheme for your system, you can use the<br />

partitioning scheme we use throughout this book:<br />

Partition Filesystem Size Description<br />

22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!