0% found this document useful (0 votes)
164 views6 pages

Implementing Logical Volumes: On Linux-Based Dell Poweredge Servers

Uploaded by

anon-407358
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views6 pages

Implementing Logical Volumes: On Linux-Based Dell Poweredge Servers

Uploaded by

anon-407358
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

STORAGE ENVIRONMENT

Implementing Logical Volumes


on Linux-based Dell PowerEdge Servers

Sistina Logical Volume Manager (LVM) software provides an abstraction layer that
allows administrators to work with logical volumes, helping to simplify storage
management. This article describes LVM and presents scenarios for using LVM to
resize storage volumes on Dell™ PowerEdge™ and PowerVault™ systems running
the Red Hat Linux operating system.

BY TESFAMARIAM MICHAEL AND JOSHUA GILES

Understanding LVM architecture


S ystem administrators who manage disk storage in net-
work environments face several challenges: ensuring
that data-intensive applications get the data they need
LVM comprises five basic structures: volume group (VG),
logical volume (LV), logical extent (LE), physical extent
quickly, providing and organizing additional storage, (PE), and physical volume
preserving data integrity, and backing up data regularly. LVM combines physical (PV). A physical volume
Scalable storage management software that enables admin- is typically a hard disk or
istrators to reconfigure storage allocations dynamically in disk drives into easily a partition—for example,
response to changing enterprise needs can help meet a SCSI disk or a RAID
these challenges. One such open source product is the manageable logical abstraction of a hard disk.
Sistina® Logical Volume Manager (LVM), which is embed- Each physical volume
ded in the Linux® kernel. LVM combines physical disk volumes and allows comprises chunks of data,
drives into easily manageable logical volumes and allows called physical extents. All
online storage administration through tasks that are trans- online storage adminis- physical extents within a
parent to the user and the application. volume group are the
This article discusses the basic architecture and con- tration through tasks that same size. In Figure 1,
figuration of LVM running under the Red Hat® Linux oper- the volume group, called
ating system. It also explains the steps for using LVM to are transparent to the Vol_Grp00, is at the top
manage storage in Dell™ PowerEdge™ servers and Dell level of abstraction. This
PowerVault™ systems. user and the application. group is obtained by

www.dell.com/powersolutions POWER SOLUTIONS 111


STORAGE ENVIRONMENT

Volume group Vol_Grp00


partition table for LVM. The Because storage manage-
VGDA contains one volume group
descriptor, one physical volume ment is one of the main
lvdata lvhome lvvar descriptor, one logical volume
descriptor, and several physical challenges system
Logical volumes extent descriptors. When the
system is booted up, the volume administrators regularly
group and logical volumes are

8 MB 8 MB 8 MB 8 MB
activated and the VGDA is loaded face, most major
sda2 sdc1 sde5 sde5 into memory. The VGDA allows

Logical extents 8 MB 8 MB 8 MB 8 MB LVM to identify where the logical Linux distributions have
sdc1 sdc1 sdc1 sde5 volumes are actually stored. The
8 MB 8 MB 8 MB 8 MB one-to-one mapping of physical included LVM with their
sda2 sdc1 sdc1 sde5
to logical volumes is necessary to
access the physical location and installers, simplifying the
to perform I/O operations.
Physical extent 8 MB 8 MB 8 MB 8 MB task of LVM deployment.
Conceptualizing LVM processes
LVM comprises lvm-mod, a kernel module (that is, a device driver)
/dev/sda2=PV /dev/sdc1=PV /dev/sde5=PV
under General Public License (GPL), and applications that use the
module to perform storage-related management processes. In a typi-
Physical volume 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
SCSI disk 1 SCSI disk 3 SCSI disk 5
status of a particular storage device, as follows:

Figure 1. LVM schematic diagram 1. LVM commands invoke the LVM kernel module, lvm-mod, to
perform the operating system–level tasks that are required to
service the request.
mapping together the physical volumes /dev/sda2, /dev/sdc1, 2. The device driver executes the request on the hardware
and /dev/sde5 to create logical volumes that form one manage- storage device, and the LVM kernel module configures the
able group. device dynamically through the /proc file system.
In Figure 1, lvdata, lvhome, and lvvar represent logical volumes, 3. LVM dynamically obtains information on the storage devices
which contain the file system and thus can be used as mount points by using the /proc file system.
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 Administrator issues LVM commands (pvcreate, vgscan)
the logical extents and the physical extents. to manage device; receives status from /proc file system
Each physical extent has a unique identification number on
3 1
a physical volume but does not necessarily have a unique identi-
fication number on a logical volume because several different LVM commands use LVM kernel module
physical volumes can constitute one logical volume. Therefore, the and /proc file system to configure device

logical extent identification numbers also identify the associated


2
physical extents. Whenever the storage area is accessed, the address
or the identification number of the logical extent is used to actu- Hardware storage device is configured
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 Figure 2. LVM command process

112 POWER SOLUTIONS November 2003


STORAGE ENVIRONMENT

File system File system Logical does not support LVM. Administrators using LILO must put the
mount point Size (MB) type LVM group* volume name
boot partition outside LVM.
/ 6144 ext3 None None Although LVM can be used with several file system types, such
/boot 128 ext3 None None as ext2, ext3, and ReiserFS, this article addresses only ext3, the
default Red Hat Linux file system. Figure 3 shows an example par-
Logical volume File system Logical
mount point Size (MB) type LVM group volume name titioning scheme; the installation steps described in the following
sections use these values.
/home 4096 ext3 lvm00 lvm_home

/usr 6144 ext3 lvm00 lvm_usr


Using Disk Druid for manual partitioning
/var 6144 ext3 lvm00 lvm_var Implementing a partitioning scheme such as the one shown in
/data 4096 ext3 lvm00 lvm_data Figure 3 during installation of Red Hat Linux 9 Professional is
*Neither the root nor boot partitions use LVM. straightforward. The LVM feature is available only in the graphical
user interface (GUI) installation mode. To use this feature, boot the
Figure 3. Example partition values 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
Implementing LVM during a Linux installation by “Next.”
Because storage management is one of the main challenges When the Disk Druid menu is displayed, administrators can use
system administrators regularly face, most major Linux distri- the New button to create both boot and root partitions on the first
butions have included LVM with their installers, simplifying the hard drive, /dev/sda. Then, selecting the remaining free space of
task of LVM deployment. For instance, Red Hat Linux included /dev/sda to edit and setting the file system to LVM enables admin-
LVM starting with its 8.0 release. Although LVM can be intro- istrators to create physical volumes on the remaining space of the
duced during system installation or any time after, this article first drive. This step can be repeated for all the remaining hard
discusses only the case of deploying LVM during Red Hat Linux drives. Selecting the LVM button on the Disk Druid screen launches
installation and modifying storage volumes afterward. Migration the Make LVM Volume Group window.
of an already installed system to LVM can be complex, especially From this window, administrators can add, edit, and delete
if it involves moving any file systems required for system logical volume groups. Other possible actions include setting the
boot, such as root and boot, to an LVM volume. volume group name and physical
An important problem administrators must address when Even though storage on extent size (the default is 4 MB)
installing Linux is how best to partition and allocate system stor- and choosing the hard drive on
age. Predicting how these partitions will be used during the life- Linux systems can be which to create the logical volume.
time of the system can be difficult. Even though storage on Linux The Add and Edit buttons allow
systems can be expanded by adding more disks or storage enclo- expanded by adding administrators to set the mount
sures, expanding or modifying existing partitions is very risky, point, size, file system type, and
if not impossible. LVM greatly simplifies the task of expanding more disks or storage name of the planned logical vol-
or modifying partitions. umes (see Figure 4).
For data protection and integrity, Dell strongly suggests using enclosures, expanding If implemented using the
a Dell PowerEdge Expandable RAID Controller (PERC) or Dell Cost- default setting of 4 MB per phys-
Effective RAID Controller (CERC) implementing a RAID level of 1, or modifying existing ical extent, a volume group is
5, or higher, depending on system needs. limited to 255 GB because only
partitions is very risky, 65,534 physical or logical extents
Planning storage partitions and allocations are allowed in a volume group.
Before installing Linux, administrators should plan how to partition if not impossible. LVM To provide more than 256 GB
and allocate their storage. They should also evaluate how much risk in a volume group, administra-
and complexity they are willing to handle in order to recover a greatly simplifies the tors must create the physical
failed system. For example, creating root and boot partitions out- extents in chunk sizes larger
side LVM makes system recovery easier by eliminating the need to task of expanding or than 4 MB. Physical extents
activate LVM when rescuing a failed system. Also, those using Linux must be a power of 2 and can
Loader (LILO) as the preferred boot loader should be aware that it modifying partitions. range anywhere between 8 KB

www.dell.com/powersolutions POWER SOLUTIONS 113


STORAGE ENVIRONMENT

following steps describe how to expand the logical volume /home


by 10 GB from this unallocated space:

1. Confirm that the desired logical volume is not being used


and take it offline:
umount /logical_volume_mounting_point

For this scenario, enter:


umount /home

2. To scan for physical and then logical volumes, display all


existing physical volumes with information about the physical
device (such as /dev/sda3) to volume group mappings, the
volume group to which the device belongs, and the present
size status of the device:
Figure 4. Make LVM Volume Group window in Red Hat Linux installer pvscan
lvscan

and 512 MB. However, the installer limits this range to between 3. To determine the unallocated free space that can be used to
1 MB and 64 MB. expand the logical volumes, display all volume groups and
their size allocation status:
Managing and maintaining system storage vgdisplay
Once LVM is implemented during installation, managing and main-
taining system storage is the next task. If any logical volumes in 4. Expand the logical volume from an active but unallocated
the system become full, more space can be added by extending the physical volume:
logical volume using several methods, including: lvextend -L +X /dev/lvm_name/logical_volume_name
/dev/physical_volume
• Add more space from the free unallocated space in the same
volume group (see Scenario A in this article) where X is the expansion size. The results from steps 2 and 3
• Reduce another logical volume (see Scenario B) provide the available size for this expansion. The -L parameter
• Add more hard drives or Dell PowerVault disk enclosures to extends the logical volume size. In this scenario, the unallocated
the system (see Scenario C) physical volume is /dev/sda3. Expand the logical volume /home
by 10 GB by entering:
In the following scenarios that detail these approaches, /home lvextend -L +10G /dev/lvm00/home /dev/sda3
is the logical volume to be expanded. Although LVM does not
require these safety measures, administrators should perform a 5. Verify that the logical volume was extended by comparing
full system backup and bring the system to runlevel 1 (init 1) the current size to that found in step 2:
before starting the expansion; in some approaches, the logical pvscan
volume being modified should be taken offline. Dell also lvscan
recommends performing these operations during off-peak hours.
For more information about the LVM commands used in these These commands should report the updated space information.
scenarios, see “LVM commands for managing and maintaining
system storage” in this article. 6. Resize the file system:
e2fsck -f /dev/logical_volume_name
Scenario A: Expanding from unallocated space resize2fs /dev/lvm_name/logical_volume_name
in the same volume group
The “Make LVM Volume Group” window in Figure 4 shows that For this scenario, enter:
the volume group lvm00 still has 40 GB of active, unallocated space e2fsck -f /dev/lvm00/home
that can be used to expand any of the logical volumes. The resize2fs /dev/lvm00/home

114 POWER SOLUTIONS November 2003


STORAGE ENVIRONMENT

7. Bring the logical volume online: reduce the logical volume before reducing the file system, because
mount /logical_volume_mounting_point doing so can corrupt the file system on the reduced logical volume.
Again, Dell recommends backing up the system before following the
For this scenario, enter: approach in this scenario. Performing the following procedure
mount /home expands one logical volume by reducing another—in this case, by
adding 2 GB from /data to /home:
8. Verify that the added space is accounted for:
df –h 1. Identify a logical volume to shrink that has sufficient free
space. The command df -h reports information about the
Administrators can also use the e2fsadm command to expand system storage usage.
the logical volume and resize its file system; this command com-
bines the lvextend, e2fsck, and resize2fs commands. 2. Bring the system down to runlevel 1:
init 1

Scenario B: Reducing another logical volume


3. Take both logical volumes offline:
Administrators should expand logical volumes by reducing another
umount /logical_to_shrink
only when the other volume has sufficient additional space. For
umount /logical_to_grow
instance, if a data volume uses only a fraction of its allocated space
and this usage is expected to continue, administrators can safely For this scenario, enter:
reduce that volume by some amount and assign that space to another umount /data
logical volume, /home in this scenario. Administrators should not umount /home

LVM COMMANDS FOR MANAGING 4. Reduce the selected logical volume and its associated file system:
e2fsadm -L –X /dev/lvm_name/logical_volume_name
AND MAINTAINING SYSTEM STORAGE
where X is the size by which the volume should be reduced.
Figure A shows various LVM commands used in resizing and managing Take care not to reduce the size beyond its free space; doing
logical volumes. Detailed information about each command is available so can cause data loss—or corrupt the file system.
from the command’s man page.
For this scenario, enter the following command to reduce both
Command Description the file system and the logical volume /data by 2 GB:
pvcreate Creates a physical volume by initializing a disk or a partition e2fsadm -L -2G /dev/lvm00/data
pvscan Scans all drives for physical volumes and reports drive usage, including
available space 5. Expand the logical volume by the same amount the other
lvscan Scans all disks for logical volumes volume was reduced:
e2fsadm -L +X /dev/lvm_name/logical_volume_name
lvextend Expands the size of a logical volume by adding a given amount of space
from a given physical volume
where X is the expansion size. For this scenario, expand
lvreduce Reduces the size of a logical volume (if a file system exists on the volume,
the file system must be reduced using resize2fs before running this /home by 2 GB by entering:
command; lvreduce does not permit reducing a logical volume size
below its used space) e2fsadm -L +2G /dev/lvm00/home

vgextend Extends a volume group by adding physical volumes


6. Mount both file systems and bring the system up to
lvdisplay Displays information about the attributes of a logical volume runlevel 3 or 5:
vgdisplay Displays information about the attributes of volume groups mount –a

e2fsadm Expands or reduces an ext2 file system and logical volume together init desired_runlevel

resize2fs Expands or reduces an ext2 or ext3 file system


7. Verify the changes:
e2fsck Checks a Linux ext2
df –h

Figure A. LVM commands Administrators can also use the resize2fs, lvreduce, and
lvextend commands in place of e2fsadm to achieve these results.

www.dell.com/powersolutions POWER SOLUTIONS 115


STORAGE ENVIRONMENT

Scenario C: Adding more storage LVM eases storage For this scenario, to expand /home by 10 GB, enter:
If a Dell PowerEdge server lacks un- e2fsadm -L +10G /dev/lvm00/home
allocated or unused storage space, management in Linux
administrators must add more storage Alternatively, use the lvextend and resize2fs commands
to expand volumes. This approach installations by instead of e2fsadm. In this case, enter:
requires adding more hard drives or lvextend -L +10G lvm00
a Dell disk enclosure such as a empowering Linux resize2fs /dev/lvm00/home 10G
PowerVault 220S. For background on
expanding storage for PowerEdge system administrators 6. Mount the expanded logical volume:
servers, see “Expanding Storage on mount /logical_volume_mounting_point
Linux-based Servers” by Matt to expand and
Domsch and Tesfamariam Michael in For this scenario, enter:
Dell Power Solutions, February 2003 reduce storage at an mount -a
(http://www.dell.com/us/en/esg/
topics/power_ps1q03-michael.htm). abstracted level. 7. Bring the system back to the desired runlevel (3 or 5):
The article is particularly helpful init desired_runlevel
because the expansion procedure can be very complex, especially
for RAID storage, the recommended type. To expand a volume by 8. Verify the changes:
adding more storage, administrators can follow these steps: df –h

1. Partition the added drive or RAID volume and set its Achieving more manageable storage environments
partition ID to 8e: LVM eases storage management in Linux installations by empow-
fdisk /dev/new_added_drive ering Linux system administrators to expand and reduce storage at
an abstracted level. Using the techniques described in this article,
For this scenario, to add the drive /dev/sdc, enter: administrators can upgrade, reallocate, and modify storage resources
fdisk /dev/sdc as needed, helping to create a nimble, scalable storage environment
with minimal complexity.
2. Create a physical volume on the new partition:
pvcreate /dev/partition_of_new_added_drive
Tesfamariam Michael (tesfamariam_michael@dell.com) is a software engineer on the
Linux Development Team of the Dell Product Group, which tests Linux on all Dell PowerEdge
For this scenario, enter:
servers. Tesfamariam has an M.S. in Computer Science from Clark Atlanta University, a B.S.
pvcreate /dev/sdc1
in Electrical Engineering from the Georgia Institute of Technology, and a B.S. in Mathemat-
ics from Clark Atlanta University. His areas of interest include operating systems and I/O devices.
3. Take the logical volume to be expanded offline:
umount /logical_volume_mounting_point
Joshua Giles (joshua_giles@dell.com) is a Linux systems management software engi-
For this scenario, enter: neer on the Linux Development Team of the Dell Product Group. His interests include oper-
umount /home ating systems, grammar- and automata-based programming, and Support Vector Machine
(SVM) learning. Joshua has a B.S. from the New Mexico Institute of Mining and Technology.
4. Expand the volume group:
vgextend volume_group_name physical_volume_name

For this scenario, enter: FOR MORE INFORMATION


vgextend lvm00 /dev/sdc1
Dell and Linux: http://www.dell.com/linux
LVM HowTo page: http://tldp.org/HOWTO/LVM-HOWTO
5. Expand the size of the logical volume and its file system:
Red Hat Linux: http://www.redhat.com
e2fsadm –L +X logical_volume_name
Sistina LVM: http://www.sistina.com/products_lvm.htm
where X is the expansion size.

116 POWER SOLUTIONS November 2003

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy