Implementing Logical Volumes: On Linux-Based Dell Poweredge Servers
Implementing Logical Volumes: On Linux-Based Dell Poweredge Servers
PowerEdge
and PowerVault
systems running
the Red Hat
Linux
operating system.
S
ystem administrators who manage disk storage in net-
work environments face several challenges: ensuring
that data-intensive applications get the data they need
quickly, providing and organizing additional storage,
preserving data integrity, and backing up data regularly.
Scalable storage management software that enables admin-
istrators to reconfigure storage allocations dynamically in
response to changing enterprise needs can help meet
these challenges. One such open source product is the
Sistina
Linux oper-
ating system. It also explains the steps for using LVM to
manage storage in Dell
PowerEdge
systems.
Understanding LVM architecture
LVM comprises five basic structures: volume group (VG),
logical volume (LV), logical extent (LE), physical extent
(PE), and physical volume
(PV). A physical volume
is typically a hard disk or
a partitionfor example,
a SCSI disk or a RAID
abstraction of a hard disk.
Each physical volume
comprises chunks of data,
called physical extents. All
physical extents within a
volume group are the
same size. In Figure 1,
the volume group, called
Vol_Grp00, is at the top
level of abstraction. This
group is obtained by
B Y T ES FA M A R I A M M I C H A EL A N D J O S H U A G I LES
LVM combines physical
disk drives into easily
manageable logical
volumes and allows
online storage adminis-
tration through tasks that
are transparent to the
user and the application.
mapping together the physical volumes /dev/sda2, /dev/sdc1,
and /dev/sde5 to create logical volumes that form one manage-
able group.
In Figure 1, lvdata, lvhome, and lvvar represent logical volumes,
which contain the file system and thus can be used as mount points
for directories such as /var/ftp, /home, and /usr. Each logical
volume is split into chunks of data, called logical extents. Within
a volume group, the size of the logical extent is the same as that
of the physical extent; that is, a one-to-one mapping exists between
the logical extents and the physical extents.
Each physical extent has a unique identification number on
a physical volume but does not necessarily have a unique identi-
fication number on a logical volume because several different
physical volumes can constitute one logical volume. Therefore, the
logical extent identification numbers also identify the associated
physical extents. Whenever the storage area is accessed, the address
or the identification number of the logical extent is used to actu-
ally perform I/O on the physical storage.
The volume group descriptor area (VGDA) is stored at the
beginning of each physical volume and functions similarly to the
partition table for LVM. The
VGDA contains one volume group
descriptor, one physical volume
descriptor, one logical volume
descriptor, and several physical
extent descriptors. When the
system is booted up, the volume
group and logical volumes are
activated and the VGDA is loaded
into memory. The VGDA allows
LVM to identify where the logical
volumes are actually stored. The
one-to-one mapping of physical
to logical volumes is necessary to
access the physical location and
to perform I/O operations.
Conceptualizing LVM processes
LVM comprises lvm-mod, a kernel module (that is, a device driver)
under General Public License (GPL), and applications that use the
module to perform storage-related management processes. In a typi-
cal scenario, administrators use an LVM command such as pvcreate
or vgscan to perform storage management functions. For example,
Figure 2 represents the execution flow of an LVM task to retrieve the
status of a particular storage device, as follows:
1. LVM commands invoke the LVM kernel module, lvm-mod, to
perform the operating systemlevel tasks that are required to
service the request.
2. The device driver executes the request on the hardware
storage device, and the LVM kernel module configures the
device dynamically through the /proc file system.
3. LVM dynamically obtains information on the storage devices
by using the /proc file system.
STORAGE ENVIRONMENT
POWER SOLUTIONS November 2003 112
Vol_Grp00 Volume group
Logical volumes
lvdata lvhome lvvar
8 MB
sda2
8 MB
sdc1
8 MB
sde5
8 MB
sde5
8 MB
sdc1
8 MB
sdc1
8 MB
sdc1
8 MB
sde5
8 MB
sda2
8 MB
sdc1
8 MB
sdc1
8 MB
sde5
Logical extents
Physical extent
Physical volume
8 MB 8 MB 8 MB 8 MB
/dev/sda2=PV
/dev/sdc1=PV
/dev/sde5=PV
SCSI disk 1 SCSI disk 3 SCSI disk 5
Figure 1. LVM schematic diagram
Administrator issues LVM commands (pvcreate, vgscan)
to manage device; receives status from /proc file system
LVM commands use LVM kernel module
and /proc file system to configure device
Hardware storage device is configured
1
2
3
Figure 2. LVM command process
Because storage manage-
ment is one of the main
challenges system
administrators regularly
face, most major
Linux distributions have
included LVM with their
installers, simplifying the
task of LVM deployment.
Implementing LVM during a Linux installation
Because storage management is one of the main challenges
system administrators regularly face, most major Linux distri-
butions have included LVM with their installers, simplifying the
task of LVM deployment. For instance, Red Hat Linux included
LVM starting with its 8.0 release. Although LVM can be intro-
duced during system installation or any time after, this article
discusses only the case of deploying LVM during Red Hat Linux
installation and modifying storage volumes afterward. Migration
of an already installed system to LVM can be complex, especially
if it involves moving any file systems required for system
boot, such as root and boot, to an LVM volume.
An important problem administrators must address when
installing Linux is how best to partition and allocate system stor-
age. Predicting how these partitions will be used during the life-
time of the system can be difficult. Even though storage on Linux
systems can be expanded by adding more disks or storage enclo-
sures, expanding or modifying existing partitions is very risky,
if not impossible. LVM greatly simplifies the task of expanding
or modifying partitions.
For data protection and integrity, Dell strongly suggests using
a Dell PowerEdge Expandable RAID Controller (PERC) or Dell Cost-
Effective RAID Controller (CERC) implementing a RAID level of 1,
5, or higher, depending on system needs.
Planning storage partitions and allocations
Before installing Linux, administrators should plan how to partition
and allocate their storage. They should also evaluate how much risk
and complexity they are willing to handle in order to recover a
failed system. For example, creating root and boot partitions out-
side LVM makes system recovery easier by eliminating the need to
activate LVM when rescuing a failed system. Also, those using Linux
Loader (LILO) as the preferred boot loader should be aware that it
does not support LVM. Administrators using LILO must put the
boot partition outside LVM.
Although LVM can be used with several file system types, such
as ext2, ext3, and ReiserFS, this article addresses only ext3, the
default Red Hat Linux file system. Figure 3 shows an example par-
titioning scheme; the installation steps described in the following
sections use these values.
Using Disk Druid for manual partitioning
Implementing a partitioning scheme such as the one shown in
Figure 3 during installation of Red Hat Linux 9 Professional is
straightforward. The LVM feature is available only in the graphical
user interface (GUI) installation mode. To use this feature, boot the
system by using the Red Hat Linux 9 CD 1. At the boot prompt,
press the Enter key to install in GUI mode. At the Disk Partitioning
Setup screen, select Manually partition with Disk Druid, followed
by Next.
When the Disk Druid menu is displayed, administrators can use
the New button to create both boot and root partitions on the first
hard drive, /dev/sda. Then, selecting the remaining free space of
/dev/sda to edit and setting the file system to LVM enables admin-
istrators to create physical volumes on the remaining space of the
first drive. This step can be repeated for all the remaining hard
drives. Selecting the LVM button on the Disk Druid screen launches
the Make LVM Volume Group window.
From this window, administrators can add, edit, and delete
logical volume groups. Other possible actions include setting the
volume group name and physical
extent size (the default is 4 MB)
and choosing the hard drive on
which to create the logical volume.
The Add and Edit buttons allow
administrators to set the mount
point, size, file system type, and
name of the planned logical vol-
umes (see Figure 4).
If implemented using the
default setting of 4 MB per phys-
ical extent, a volume group is
limited to 255 GB because only
65,534 physical or logical extents
are allowed in a volume group.
To provide more than 256 GB
in a volume group, administra-
tors must create the physical
extents in chunk sizes larger
than 4 MB. Physical extents
must be a power of 2 and can
range anywhere between 8 KB
STORAGE ENVIRONMENT
www.dell.com/powersolutions POWER SOLUTIONS 113
File system File system Logical
mount point Size (MB) type LVM group* volume name
/ 6144 ext3 None None
/boot 128 ext3 None None
Logical volume File system Logical
mount point Size (MB) type LVM group volume name
/home 4096 ext3 lvm00 lvm_home
/usr 6144 ext3 lvm00 lvm_usr
/var 6144 ext3 lvm00 lvm_var
/data 4096 ext3 lvm00 lvm_data
*Neither the root nor boot partitions use LVM.
Figure 3. Example partition values
Even though storage on
Linux systems can be
expanded by adding
more disks or storage
enclosures, expanding
or modifying existing
partitions is very risky,
if not impossible. LVM
greatly simplifies the
task of expanding or
modifying partitions.
and 512 MB. However, the installer limits this range to between
1 MB and 64 MB.
Managing and maintaining system storage
Once LVM is implemented during installation, managing and main-
taining system storage is the next task. If any logical volumes in
the system become full, more space can be added by extending the
logical volume using several methods, including:
Add more space from the free unallocated space in the same
volume group (see Scenario A in this article)