Disk partitioning in Fedora

Drawing the Line

© Lead Image © lovesiyu, 123RF.com

© Lead Image © lovesiyu, 123RF.com

Author(s):

Partitioning prepares your disk to receive an operating system. We help you navigate this unfamiliar landscape safely.

Disk partitioning is the division and formatting of a storage device. Partitioning is done early in the installation process to prepare a device for installing the operating system. In Fedora, as in other Linux distributions, you have the option of letting the installer choose for you, of manually partitioning to customize your system, or of making room for Fedora on a Windows system. You also have the options of encrypting the partitions and deciding where to place the bootloader.

Partitioning might sound like a risky business if you have never tried it, but the main time you are likely to have problems is when the power to your machine is interrupted. However, you can minimize that potential problem by never installing while on battery power and by making sure that all cords are placed where nobody can trip over them. To be absolutely sure, always back up any information already on the machine before you start installation.

With these precautions, the next greatest danger is accidentally deleting the wrong partition, and even that danger can be minimized if you give each partition a label and note which kind of partition belongs to which operating system. An NTFS partition, for example, is likely to be for Windows, and an XFS partition for Linux.

Easing into Partitioning

The Fedora installer is easier to use than other partitioning editors. In particular, it takes care of naming and positioning partitions for you. This means you do not need to remember the system Linux uses to name partitions, arcane facts such as the difference between primary and extended partitions, or where a Windows partition needs to be on the hard drive so that the bootloader can be installed to it.

Disk partitioning begins after you select a language. When you click Installation Destination in the Installation Summary dialog, the screen changes to show the hardware devices available for installation (Figure 1) – usually a single hard drive, but optionally a flash drive or multiple hard drives. Highlight a device and click Done.

Figure 1: Installation Destination shows the available devices. Here, Fedora is being installed on a virtual machine.

After examining your hard drive, the installer shows a list of Installation Options, confirming that you have the necessary space to install Fedora and offering the choice of an automatic or manual installation. During an automatic installation, Fedora installs with three partitions – root, swap, and /boot – and you do not need to give partitioning any other thought. If you plan to use automatic partitioning, check out Step Three in the "Installing Fedora 20" article.

However, if you choose to set up partitioning yourself, you need to learn a few basics so that you can make the choices best for you. Before starting your manual install, click the Full disk summary and bootloader link at the bottom of the page and select the device to which the bootloader is loaded (Figure 2). The bootloader is the tool that allows you to install different operating systems on the same system and to choose from a selection of kernels. Click Set as Boot Device after you have selected a device.

Figure 2: The bootloader manages the different kernels and operating systems on your machine.

Manual Partitioning Basics

The first thing you need to know is that Fedora supports two partitioning schemes – Standard Partitioning and Logical Volume Manager (LVM). Which one you should use is the stuff of holy wars, but Fedora defaults to LVM, probably because it can use remote partitions, making it more suitable for networks and servers. Another advantage of LVM is that its partitions are quick to resize.

By contrast, standard partitions are extremely slow to edit but tend to be more robust than LVM partitions. For example, if your root partition is corrupted with standard partitions, you may find that a separate /home partition is unaffected, whereas with LVM, the collapse of one partition can mean the collapse of all.

In Fedora, each of these schemes also has a special case. Standard partitioning has Btrfs [1], an experimental filesystem format that has special requirements, such as a separate /boot partition. LVM has the equally experimental LVM thin provisioning [2], which can mount virtual installations into the directory tree. However, if you are new to Fedora, chances are you can ignore both Btrfs and thin provisioning and choose between Standard Partition or LVM.

No matter which partitioning scheme you decide to use, you also have the option of encrypting the data on your partitions (Figure  3). Unless you have a slow computer, you usually have few reasons not to select this option. For a small reduction in speed, this encryption can protect you against most malicious attacks.

Figure 3: Whether installing automatically or manually, you can choose to encrypt your data.

Manual Partitioning

Manual partitioning begins with planning. Your planned partitioning must meet certain requirements, depending on your choices, and you can review your plan before any change is made to the disk.

When you decide to review or modify your partitions, from the Installation Options window, click the Continue button to bring up the Manual Partitioning window (Figure 4). Follow the online instructions, clicking the plus (+) button at the bottom of the left pane to set up a partition.

Figure 4: Manual partitioning gives you the freedom to set up partitions any way you prefer.

The swap partition requires only a size on the hard drive. All other partitions require the mountpoint, or the directory in which the partition is mounted (i.e., displayed) in the Linux directory tree (Figure  5). The top level of the tree is the root directory, which is indicated by a forward slash (/). Along with the swap directory, the root directory is one of the two required partitions; if you do not create other partitions, all the directories in your Fedora installation are placed on the root partition.

Figure 5: Each partition must have a size and a mountpoint.

The other required directory is the swap partition, which is used whenever your system runs out of RAM. Traditionally, the swap partition was twice the size of a system's RAM, but with 4GB of RAM being standard on today's machines, the swap partition generally needs to be no larger than 2GB. Alone among partitions, it does not have a mountpoint.

You also have the option to create separate partitions for other directories. This habit can protect against attacks on your system. If you select Btrfs, then you need a separate /boot partition because the bootloader does not support Btrfs in this version of Fedora.

You can add any mountpoint you want, but the drop-down list in the Mount Point field lists the most common ones. However, if you do use more than /, be sure you give each partition enough space that you don't have to resize them six months later. Assuming a modern system, Table 1 shows sizes that you should not quickly outgrow.

Table 1

Recommended Partition Sizes

Partition

Description

Size

/

Root directory

4GB

/boot

Kernel and other core system files

50-100MB

/home

User's private files

As much space as possible or that is leftover

/tmp

Temporary files

2GB

/usr

Application files

50-100GB

/var

Spools, logs, and internal mail

2GB

Once a partition is set up, you also have the option to Encrypt or to set a format other than the default ext4 filesystem. Some of these options, such as ext3 or VFAT provide compatibility with older partitions on existing systems, but unless you are familiar with other filesystems, you will probably not notice the advantages of using them and can safely stay with ext4.

When you have finished setting up partitions, press the Done button in the top left corner. The Summary of Changes window appears. Study this window carefully to be sure it will not have an unexpected effect  – most likely, the destruction of a partition you want to keep. When you are satisfied, press the Accept Changes button.

Once you are done, return to Installation Summary and click the Begin installation button in the lower right corner. By contrast, if the installation destination is marked by an orange icon, return to the procedure to correct the mistakes.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: Partitioning

    Despite the popularity of LVM, traditional partitioning is still preferred by some admins. We provide some tips to consider before choosing a partitioning scheme for your setup.

  • Clonezilla

    Clonezilla Live backs up and clones complete partitions or hard disks. The popular live system comes with an easy-to-use interface.

  • ASK KLAUS!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine. com

  • Ask Klaus!

     

  • Migrating to an SSD

    Replacing your hard drive with an SSD is a sure way to speed up your system; however, migrating to an SSD is a little more complicated than you might imagine. We'll help you find your way through the pitfalls.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia