Systemconfiglvm

The system-config-lvm tool provides a GUI interface for managing your Logical Volume Manager. With it you can obtain information about your logical and physical volumes, as well as perform simple tasks such as deleting and extending logical volumes, or migrating and removing physical volumes. You can invoke system-config-lvm from its menu entry under System | Administration | Logical Volume Management. You can also enter system-config-lvm in a terminal window. system-config-lvm will display a window with three panes: one listing all your logical and physical volumes, one showing a graphical representation of a selected volume or volume group, and one that displays information about the selected volumes. Figure 31-1 shows two volume groups. VolGroupOO is the default volume group set up during installation, whereas mymedia is one set up later by the user, as discussed later in the chapter. VolGroupOO is implemented on a physical volume, a pv partition, which is the third partition on the first hard drive, sda3. The two logical volumes for the group are used for the root and swap partitions, LogVolOl for the root partition, and LogVolOO for the swap partition.

Selecting a physical volume displays buttons with the options to extend the volume group or remove physical volumes, whereas selecting a particular partition allows you to migrate a particular volume or remove it from the group. When extending a volume group, you will be presented with a list of possible partitions to choose from.

Selecting a logical group shows buttons to create or remove the volume, and selecting a particular volume in that group permits you to remove the logical volume or edit its properties. A logical volume's properties will let you specify its file system type, size, and logical volume name. When adding a new logical volume, you can use properties to set the name, size, and file system type, formatting it appropriately. Space permitting, you can even resize current volumes.

The uninitialized entries are partitions that do not belong to any volume. Recall, though, that the boot partition cannot belong to a volume group; it cannot be a logical volume. Be sure to leave it alone. For other uninitialized partitions, you can select their entries and initialize them to add them to a volume group. Use the Initialize Block Device entry in the Tools menu.

If you have the free space on a logical group you can create a new logical volume. First select the logical group entry on the left-hand pane. Then click Create New Logical Volume (see later Figure 31-4). This opens up a new window with a panel for creating a new logical volume (see Figure 31-2). There are entries for the volume name, its size, the file system you want it formatted with, and where you want it mounted. You also have the option of specifying the size of the extents, though the default normally works well. You can specify whether a logical volume should be linear, mirrored, or striped. These features are similar to the linear, mirrored, or striped implementations used in RAID devices. Normally you would use the linear implementation, which is the default.

Figure 31-2 Creating a new logical volume with LVM

To extend the size of a volume using free space in the volume group, just select the volume group and click the Edit properties button. This opens the same window as displayed in Figure 31-2. You can then use the slider on the volume size to extend the size of the volume. When you click OK, system-config-lvm will unmount your volume group and then resize the volume and check the file system, extending the size while preserving your original data. This capability is a major advantage for LVM devices. Hard disk partitions are fixed, whereas LVM logical disks can easily be expanded. To expand a hard disk partition, you had to destroy the old one and create a new, larger one that in turn was also fixed. With LVM you just add more storage. The logical structure is separated from the physical implementation.