Section 10.2. Configuring RAID and LVM During Installation


10.2. Configuring RAID and LVM During Installation

Fedora Core's default storage layout works well for many systems, but one approach doesn't suit all situations. The Anaconda installer lets you configure complex storage layouts incorporating RAID and LVM to suit advanced needs.

Back up any important data on your disk drive(s) before installing Fedora Core!

Be sure to read Chapter 6 before reading this lab.


10.2.1. How Do I Do That?

Start a normal installation as described in Chapter 1. When you get to the disk and partition strategy screen shown in Figure 10-9, choose "Create custom layout" and select the checkbox for each of the disk drives that you wish to use.

Figure 10-9. Selecting a custom layout as the partitioning strategy


Click Next to proceed to the Disk Druid screen shown in Figure 10-10, which gives an overview of the drive partitions in the top portion of the screen; the details of drive partitions, RAID devices, and LVM configuration in the lower portion of the screen; and action buttons in the center.

Figure 10-10. Disk Druid screen


Start by scrolling through the partition list in the lower half of the window. Delete any existing partition that you no longer want by clicking on the partition to select it and then clicking the Delete button; confirm the deletion in the warning dialog that appears.

10.2.1.1. Creating a boot filesystem

The GRUB bootloader used by Fedora can boot only from simple disk partitions, not Logical Volumes or RAID stripes. However, when a RAID 1 (mirroring) array contains a filesystem, each partition that is an element of that array contains a full copy of the filesystem, and GRUB can boot from that.

Therefore, if you're using RAID levels other than RAID 1, or if you're using LVM, you must create a separate boot filesystem. The mount point for this filesystem is /boot, and the recommended size is 100 MB.

If you are not using RAID, create a small partition to hold the boot filesystem. In Disk Druid click the New button, which will bring up the Add Partition dialog shown in Figure 10-11. Enter a mount point of /boot, deselect the checkboxes for all of the drives except the first one, and then click Next. This will create a 100 MB ext3 partition on the first disk drive.

Figure 10-11. Add Partition window


If you are using RAID, follow the steps in the next section to create a boot partition.

10.2.1.2. Creating RAID devices

Table 10-1 shows RAID level recommendations for various numbers of disk drives. (Table 6-3 describes the RAID levels supported by Fedora.)

Table 10-1. RAID recommendations based on the number of same-sized disk drives
# of disk drivesPossible RAID levelsRecoverable failureNotes
1Cannot use RAIDNone 
2RAID 0NoneImproves performance but also increases the risk of data loss. It provides storage capacity equal to two drives.
 RAID 11 driveProvides storage capacity equal to one drive. This is the only RAID level that can be used for the /boot filesystem.
3RAID 51 driveProvides storage capacity equal to two drives.
4 or moreRAID 5 with no hot spares1 driveProvides storage capacity equal to the number of drives minus one.
 RAID 5 with hot spare(s)1 drive at a time to a sequential maximum failure of 1 + the number of hot sparesProvides storage capacity equal to the number of drives minus the number of hot spares minus one.
 RAID 6 with no hot spares2 drivesProvides storage capacity equal to the number of drives minus two.
5 or moreRAID 6 with hot spare(s)2 drives at a time to a maximum of 2 + the number of hot sparesProvides storage capacity equal to the number of drives minus the number of hot spares minus two.


To create a RAID array (device), you must first create the partitions that will make up the elements of the array. Start by creating a RAID 1 boot partition of about 100 MB on each drive. Although it's tempting to create a giant RAID partition to use the rest of the space, I recommend that you divide the space on each drive into five partitions of roughly equal size. For example, if you are using 120 GB disk drives, create five partitions of 24 GB; if you are using 10 GB drives, create five partitions of 2 GB. Combine these partitions into five RAID arrays, each incorporating one partition from each drive, and then combine those five RAID arrays into a single volume group. The advantage to this approach is that it enables you to migrate to a different RAID level as long as a minimum of 20 percent of the VG space is free (see Lab 6.1, "Using Logical Volume Management").

To create a partition to serve as a RAID array element, click the New button in Disk Druid's main window. The Add Partition dialog will appear, as in Figure 10-12.

Figure 10-12. Adding a RAID partition


Another way to create a RAID partition is by clicking on the RAID button; the dialog in Figure 10-13 will appear, asking what you want to do next. Select the option "Create a software RAID partition" and click OK.


For the File System Type, select "software RAID." Deselect all of the Allowable Drives checkboxes except one to indicate the drive on which you wish to create the partition. Enter the Size in megabytes, and select "Fixed size." Click OK to proceed.

Repeat this process to create partitions for the other elements of the RAID array on other drives. For example, when creating a 2 GB RAID 1 array that spans two drives, create a 2 GB software RAID partition on each of the two drives.

Once you have created all of the partitions for the array, click the RAID button to view the RAID Options window, as shown in Figure 10-13.

Figure 10-13. RAID Options window


Select the option to "Create a RAID device" and click OK. The Make RAID Device window will appear, as shown in Figure 10-14.

Figure 10-14. Make RAID Device window


To use this RAID array as a boot filesystem, enter the mount point /boot, set the File System Type to ext3, set the RAID Level to RAID 1, and then select the checkboxes of the RAID partitions that will serve as elements of the array. Click OK to create the filesystem.

When creating a RAID array, use partitions that are exactly or almost exactly the same size because the size of the smallest element defines the amount of space that will be used in each of the elements; any differences between the size of the smallest element and the sizes of each of the other elements is wasted space.


To create a RAID array that will serve as a Physical Volume in an LVM Volume Group, set the File System Type to "Physical volume (LVM)," select the RAID Level, and select the checkboxes of the RAID partitions that will serve as elements of this array. Click OK to create the array.

10.2.1.3. Creating an LVM layout

Whether you're using RAID or not, LVM is the best way to set up partitioning: the overhead is minuscule, and the flexibility that it buys is valuable.

In order to configure LVM during installation, you need to create one or more partitions that will serve as physical volumes. There are two ways to do this:

  • Use RAID arrays as physical volumes, following the instructions in the previous section.

  • Use disk partitions as physical volumes. Click New in the Disk Druid main screen to access the Add Partition window (Figure 10-11). Select "Physical volume (LVM)" for the File System Type, enter the partition size, and then click OK to create the partition.

It usually doesn't make sense to combine RAID and disk partition PVs in the same volume group because you will lose the data protection provided by the RAID array.


Once you have created the physical volumes, click the LVM button. The window shown in Figure 10-15 will be displayed.

Figure 10-15. Make LVM Volume Group window


Enter a descriptive volume group name, such as main for your primary volume group. The default physical extent size is 32 MB, which is a reasonable choice for most applications. If you have a good reason to use a different extent size, set it now because it cannot be easily changed after installation.

Reducing the physical extent size increases the size of the LVM data structures but gives a finer granularity for assigning storage to logical volumes. Increasing the physical extent size slightly reduces the LVM overhead, increasing performance.


Select the checkbox of all of the physical volumes you wish to use in this volume group.

The next step is to create a logical volume to hold each filesystem you wish to create. Table 10-2 contains a list of recommended filesystems.

Table 10-2. Recommended filesystems for Fedora Core
Mount pointRecommended sizeNotes
/ 10 GBRequired
/home 10 GB or more, depending on how much data your users will be personally storingStrongly recommended for any system where users will be logging in on the console or via remote SSH access (e.g., desktop systems, servers with personal user accounts), and systems that are acting as file servers for personal files such as a Samba server (see Lab 7.1, "Configuring Samba to Share Files with Windows Systems"). By separating the users' home directories onto a separate filesystem, you can reinstall the operating system in the future without affecting users' files.
/var 2 GB to 1 TB depending on the applications in useThe /var filesystem holds data that is variable but that is not stored in the users' home directoriesfor example, databases, email, web pages, and queued print requests. Creating a separate filesystem segregates it for backup and makes it easier to reinstall the operating system without affecting this data.


To create each logical volume and filesystem, click the Add button at the bottom of the screen to access the Make Logical Volume window shown in Figure 10-16.

Figure 10-16. Make Logical Volume window


Enter the chosen Mount Point and a descriptive logical volume name; then enter the desired size (leaving the File System Type set to the default, "ext3"). Click OK to return to the Make LVM Volume Group window; note that the LV size you entered is rounded to a multiple of the physical extent size in the Logical Volumes display.

Repeat this process for the other logical volumes.

It is best to leave some space within the VG unassigned so that you can use LVM snapshots and so that you can add space to a crowded filesystem without having to unmount another filesystem to reduce its size.


Finally, create a swap LV by clicking on the Add button in the Make LVM Volume Group window; when the Make Logical Volume window appears (Figure 10-16), set the File System Type to "swap," and enter the desired swap size. Although traditional wisdom dictates a swap size twice as large as the system memory, it's reasonable to give a system with more memory less swapspace, and a system with less memory more swapspace. If in doubt, use the traditional figure as a starting point, since it can be changed later. The swapspace should be at least as large as the installed RAM (Disk Druid will warn you if it is not).

Once you have configured all of the logical volumes, click OK in the Make LVM Volume Group window, and then click Next in the main Disk Druid window. Proceed with the installation as outlined in Chapter 1.

10.2.2. How Does It Work?

Like most of the Fedora system administration tools, Disk Druid (and Anaconda) are largely written in Python and interface with other open source tools such as parted, libparted, and lvm.

The purpose of Disk Druid is to improve the installation experience by taking care of many of the partitioning, RAID configuration, and LVM setup details automatically.

While other partitioning tools such as fdisk and parted require the user to keep track of partition numbers and starting and ending locations, and to use cylinders as a unit of measure, Disk Druid handles partition numbering automatically (even including drive selection, where appropriate).

On a PC, the first sector of each disk drive stores a Master Boot Record (MBR). The last 64 bytes of the MBR contain a partition table, which can hold a maximum of four entries; each entry contains a starting and ending cylinder number, boot flag, and partition type code. If more than four partitions are required, one of the MBR entries is configured to point to an extended partition, which contains its own extended partition table. The extended partition table can contain a maximum of one partition entry and one additional extended partition entry, both of which must be located within the extended partition. In this way, any number of partitions may be created.

10.2.3. What About...

10.2.3.1. ...disk partitions on non-PC systems?

There are many different types of disklabels, or disk partition table types, used on different types of systems. Of particular note for Fedora users is the fact that Mac systems use a different, more capable disk partition table. parted is able to display, create, and manipulate nine different types of disklabels, including those for IBM AIX Unix systems, Macs, PCs (called msdos in the parted documentation), Sun systems, and many others.

10.2.4. Where Can I Learn More?

  • The manpages for parted, fdisk, lvm, and mdadm

  • The Anaconda project page: http://fedora.redhat.com/projects/anaconda-installer/

  • The Anaconda Wiki page: http://fedoraproject.org/wiki/Anaconda




Fedora Linux
Fedora Linux: A Complete Guide to Red Hats Community Distribution
ISBN: 0596526822
EAN: 2147483647
Year: 2006
Pages: 115
Authors: Chris Tyler

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net