Running Linux, 5th Edition - Matthias Kalle Dalheimer [33]
If you already have other software installed on your system, you may need to resize those partitions in order to free up space for Linux. You will then create one or more Linux partitions on the resulting free space for storing the Linux software and swap space. We call this process repartitioning .
Many Windows systems utilize a single partition inhabiting the entire drive. To Windows, this partition is known as C:. If you have more than one partition, Windows names them D:, E:, and so on. In a way, each partition acts like a separate hard drive.
On the first sector of the disk is a master boot record along with a partition table. The boot record (as the name implies) is used to boot the system. The partition table contains information about the locations and sizes of your partitions.
There are three kinds of partitions : primary, extended, and logical. Of these, primary partitions are used most often. However, because of a limit on the size of the partition table, you can have only four primary partitions on any given drive. This is due to the poor design of MS-DOS and Windows; even other operating systems that originated in the same era do not have such limits.
The way around this four-partition limit is to use an extended partition. An extended partition doesn't hold any data by itself; instead, it acts as a "container" for logical partitions . Therefore, you could create one extended partition, covering the entire drive, and within it create many logical partitions. However, you are limited to only one extended partition per drive.
Linux Partition Requirements
Before we explain how to repartition your drives, you need an idea of how much space you will be allocating for Linux. We discuss how to create these partitions later in this chapter, in "Editing /etc/fstab."
On Unix systems, files are stored on a filesystem, which is essentially a section of the hard drive (or other medium, such as CD-ROM, DVD, or floppy) formatted to hold files. Each filesystem is associated with a specific part of the directory tree; for example, on many systems, there is a filesystem for all the files in the directory /usr, another for /tmp, and so on. The root filesystem is the primary filesystem, which corresponds to the topmost directory, /.
Under Linux, each filesystem lives on a separate partition on the hard drive. For instance, if you have a filesystem for / and another for /usr, you will need two partitions to hold the two filesystems.[*]
Before you install Linux, you will need to prepare filesystems for storing the Linux software. You must have at least one filesystem (the root filesystem), and therefore one partition, allocated to Linux. Many Linux users opt to store all their files on the root filesystem, which, in most cases, is easier to manage than several filesystems and partitions.
However, you may create multiple filesystems for Linux if you wish—for example, you may want to use separate filesystems for /usr and /home. Those readers with Unix system administration experience will know how to use multiple filesystems creatively. In "Creating Filesystems" in Chapter 10 we discuss the use of multiple partitions and filesystems.
Why use more than one filesystem? The most commonly stated reason is safety; if, for some reason, one of your filesystems is damaged, the others will (usually) be unharmed. On the other hand, if you store all your files on the root filesystem, and for some reason the filesystem is damaged, you may lose all your files in one fell swoop. This is, however, rather uncommon; if you back up the system regularly, you should be quite safe.
On the other hand, using several filesystems has the advantage that you can easily upgrade your system without endangering your own precious data. You might have a partition for the users' home directories, and when upgrading the system, you leave this partition alone, wipe out the others, and reinstall Linux from scratch. Of course, nowadays distributions all have quite elaborate update procedures, but from time to time, you might want a fresh