What is LVM and what is it used for?


Answer #: 1

You can think of LVM as “dynamic partitions”, meaning that you can create/resize/delete LVM “partitions” (they’re called “Logical Volumes” in LVM-speak) from the command line while your Linux system is running: no need to reboot the system to make the kernel aware of the newly-created or resized partitions.

Other nice features that LVM “Logical Volumes” provide are:

If you have more than one hard-disk, Logical Volumes can extend over more than one disk: i.e., they are not limited by the size of one single disk, rather by the total aggregate size.

You can set up “striped” LVs, so that I/O can be distributed to all disks hosting the LV in parallel. (Similar to RAID-0, but a bit easier to set-up.)

You can create a (read-only) snapshot of any LV. You can revert the original LV to the snapshot at a later time, or delete the snapshot if you no longer need it. This is handy for server backups for instance (you cannot...

0 0

LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem.

For a long time I wondered why anyone would want to use LVM when you can use gparted to resize and move partitions just fine. The answer is that lvm can do these things better, and some nifty new things that you just can't do otherwise. I will explain several tasks that lvm can do and why it does so better than other tools, then how to do them. First you should understand the basics of lvm.

There are 3 concepts that LVM manages:

Volume Groups Physical Volumes Logical Volumes

A Volume Group is a named collection of physical and logical volumes. Typical systems only need one Volume Group to contain all of the physical and logical volumes on the system, and I like to name mine after the name...

0 0

What Is LVM Linux?
LVM is also referred to as logical volume manager. It is available for Linux kernel. Its main purpose is to manage disk drives and other mass- storage devices. Though LVM stands for logical volume manager, it can also mean logical volume management. It holds true if it is used with the IBM AIX, HP-UX, or OS/2 operating systems.

Uses of LVM Linux;

It is perfect for managing hard disks through adding disks or replacing disks. It can also work by means of copying and sharing the contents. This can happen without interrupting the service at all. It allows the creations of backups just in case things do not go the right way. LVM also makes it possible the resizing of disk partitions as easy as possible. This holds true for smaller systems such as desktops. LVM also allows dynamic volume resizing which can be applicable in certain cases. Again, this is only applicable in certain cases.

Capabilities of LVM Linux:

It resizes volume groups...
0 0

Logical volume management provides a higher-level view of the disk storage on a computer system than the traditional view of disks and partitions. This gives the system administrator much more flexibility in allocating storage to applications and users.

Storage volumes created under the control of the logical volume manager can be resized and moved around almost at will, although this may need some upgrading of file system tools.

The logical volume manager also allows management of storage volumes in user-defined groups, allowing the system administrator to deal with sensibly named volume groups such as "development" and "sales" rather than physical disk names such as "sda" and "sdb".

Logical volume management is traditionally associated with large installations containing many disks but it is equally suited to small systems with a single disk or maybe two.

One of the difficult decisions facing a new...

0 0

This article describes a basic logic behind a Linux logical volume manager by showing real examples of configuration and usage. Although Debian Linux will be used for this tutorial, you can also apply the same command line syntax with other Linux distributions such as Red Hat, Mandriva, SuSe Linux and others.

For this Linux lvm example you need an unpartitioned hard disk /dev/sdb. First you need to create physical volumes. To do this you need partitions or a whole disk. It is possible to run pvcreate command on /dev/sdb, but I prefer to use partitions and from partitions I later create physical volumes.

Use your preferred partitioning tool to create partitions. In this example I have used cfdisk.

Partitions are ready to use.

Use the pvcreate command to create physical volumes.

# pvcreate /dev/sdb1
# pvcreate /dev/sdb2

The pvdisplay command displays all physical volumes on your system.

# pvdisplay...
0 0
0 0

This is the 6th part of our ongoing Logical Volume Management series, in this article we will show you how to migrate existing logical volumes to other new drive without any downtime. Before moving further, I would like to explain you about LVM Migration and its features.

LVM Storage Migration

What is LVM Migration?

LVM migration is one of the excellent feature, where we can migrate the logical volumes to a new disk without the data-loss and downtime. The purpose of this feature is it to move our data from old disk to a new disk. Usually, we do migrations from one disk to other disk storage, only when an error occur in some disks.

Features of Migration

Moving logical volumes from one disk to other disk. We can use any type of disk like SATA, SSD, SAS, SAN storage iSCSI or FC. Migrate disks without data loss and downtime.

In LVM Migration, we will swap every volumes, file-system and it’s data in the existing storage. For example, if we have a...

0 0

LVM is a tool for logical volume management which includes allocating disks, striping, mirroring and resizing logical volumes.

With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks.

The physical volumes are combined into logical volumes, with the exception of the /boot/ partition. The /boot/ partition cannot be on a logical volume group because the boot loader cannot read it. If the root (/) partition is on a logical volume, create a separate /boot/ partition which is not a part of a volume group.

Since a physical volume cannot span over multiple drives, to span over more than one drive, create one or more physical volumes per drive.

The volume groups can be divided into logical volumes, which are assigned mount points, such as /home and / and file system types, such as ext2 or ext3. When "partitions" reach their...

0 0
Comments From People Like You!
Managing RAID and LVM with Linux add a comment DB
10-Oct-2010 10:19 Hi all,

I have a Hammer NAS device set up with 2 drives that I believe are set up as RAID LVM. The reason that I think this is Ghost says LVM, and Clonezilla says Linux RAID when I try to image the drives. I'm not sure what exactly these are except what I've read online.

I have 2 questions: 1) How do I tell what exactly the setup is so I can read more about it, and, 2) is it possible to recover my data if 1 of these drives has failed?

Thanks in advance

24-Mar-2010 18:14 This is very interesting. I like reading pertinent information on similar topic I experienced. If I may also suggest some reading that I wrote about similar issue.

It's an howto on how to Create a Raid5 under Linux RHEL5.4 using md, lvm and ext4 filesystem. (look at http://panoramicsolution.com/blog/?p=92 )

and I also wrote the experience on Testing for a Raid5...

0 0


After breaking cinnamon in mint14 I thought I would use gnome to back up files and software. Done.

Install mint16 with a view to going XEN.

SO I followed the tutorial here :


only on final reboot I am faced with the grub rescue prompt with
error: no such device: e66ef71e-907a-43a3-9a28-3988ef1dc150

I'll post the steps I followed as I have 4 drives not 1 like the tutorial.

Mint16 disk burnt from downloaded iso from mint.

Code: Select all

sudo -i
apt-get install lvm2
fdisk -l

4.1 Run gparted from the Linux Mint "administration" menu.

4.1 Partition the disk (/dev/sdc) to MBR (default option).

4.2. Create /dev/sdc1 size 512MB formatted as ext2 and flagged as "boot".

4.3. Create /dev/sdc2 unformatted using the rest of the disk.

Code: Select all

pvcreate /dev/sdc2

vgcreate lm13...

0 0

This is the first of a three-part series, designed to introduce new users to the concept of logical volume management in Linux. To have the others delivered automatically to you, you may subscribe to our RSS feed by clicking on the RSS icon diagonally above this paragraph

Logical Volume Management is a method of partitioning hard disk drives that provides more flexibility in managing storage space than the traditional method of disk partitioning. The Linux version, Logical Volume Manager or LVM, has been a feature of the Linux kernel since about 1999, and was contributed (to the Linux kernel) by Sistina Software, Inc, a company that was later acquired by Redhat.

Other UNIX-like operating systems – AIX, HP-UX, and Sun Solaris – have their own implementation of logical volume management. Until recently, there was no equivalent technology – feature-wise – in the BSD distributions. FreeBSD only recently added experimental support for Zone File System (ZFS), a recent...

0 0

You can think of LVM as "dynamic partitions", meaning that you can create/resize/delete LVM "partitions" (they're called "Logical Volumes" in LVM-speak) from the command line while your Linux system is running: no need to reboot the system to make the kernel aware of the newly-created or resized partitions.

Other nice features that LVM "Logical Volumes" provide are:

If you have more than one hard-disk, Logical Volumes can extend over more than one disk: i.e., they are not limited by the size of one single disk, rather by the total aggregate size.

You can set up "striped" LVs, so that I/O can be distributed to all disks hosting the LV in parallel. (Similar to RAID-0, but a bit easier to set-up.)

You can create a (read-only) snapshot of any LV. You can revert the original LV to the snapshot at a later time, or delete the snapshot if you no longer need it. This is handy for server backups for instance (you cannot stop all your applications from writing,...

0 0

In Linux, Logical Volume Manager (LVM) is a device mapper target that provides logical volume management for the Linux kernel. Most modern Linux distributions are LVM-aware to the point of being able to have their root file systems on a logical volume.[3][4][5]

Heinz Mauelshagen wrote the original LVM code in 1998, taking its primary design guidelines from the HP-UX's volume manager.[1]

Common uses[edit]

LVM is commonly used for the following purposes:

Managing large hard disk farms by allowing disks to be added and replaced without downtime or service disruption, in combination with hot swapping. On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows file systems to be easily resized later as needed. Performing consistent backups by taking snapshots of the logical volumes. Creating single logical volumes of multiple physical volumes or entire hard...
0 0

In this example the whole system was installed in a single root partition with the exception of /boot. The system had a 2 gig disk partitioned as:

The / partition covered all of the disk not used by /boot and swap. An important prerequisite of this procedure is that the root partition is less that half full (so that a copy of it can be created in a logical volume). If this is not the case then a second disk drive should be used. The procedure in that case is similar but there is no need to shrink the existing root partition and /dev/hda4 should be replaced with (eg) /dev/hdb1 in the examples.

To do this it is easiest to use GNU parted. This software allows you to grow and shrink partitions that contain filesystems. It is possible to use resize2fs and fdisk to do this but GNU parted makes it much less prone to error. It may be included in your distribution, if not you can download it from ...

0 0

In computer storage, logical volume management or LVM provides a method of allocating space on mass-storage devices that is more flexible than conventional partitioning schemes. In particular, a volume manager can concatenate, stripe together or otherwise combine partitions (or block devices in general) into larger virtual ones that administrators can re-size or move, potentially without interrupting system use.

Volume management represents just one of many forms of storage virtualization; its implementation takes place in a layer in the device-driver stack of an OS (as opposed to within storage devices or in a network).

Linux Logical Volume Manager (LVM) v1

Most volume-manager implementations share the same basic design. They start with physical volumes (PVs), which can be either hard disks, hard disk partitions, or Logical Unit Numbers (LUNs) of an external storage device. Volume management treats each PV as being composed of a sequence of chunks called...

0 0
0 0

In my last post I explained about the concepts of the Logical Volume Manager (LVM). If you need some background on Logical Volume Manager (LVM) or you are new to LINUX you can read the post Understanding The Concept Of Logical Volume Manager – LVM. Now hope you have a fair background with linux and the LVM lets try to setup it on a Ubuntu Linux Machine, you can use any LINUX distribution to set Setup Logical Volume Manager (LVM). The commands are almost same.

The setup of my machine is :-
1.) Primary Disk 20 Gb (dev/sda).
2.) Secondary Disk 10 GB (dev/sdb) [Will be used for LVM].
3.) Third Disk 6GB (dev/sdc) [Will be used for LVM].

Now to find the partitions or drives in your machine you can use the following command.

sudo fdisk -l

Now as per my previous post I want to use the same partition size for secondary disk as 10Gb but 3 Gb for Third disk because I also want to show how to extend the LVM partition. So we start by...

0 0

Thank! This looked like it was going to work, however it failed saying:


Check of filesystem failed. Command attempted: "/sbin/e2fsck -f -p /dev/VG_Guests/RH9" - System Error Message: /: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options)

No I'm really scared. The last time I attemped to use fsck, I had to reinstall from scratch.


I followed your procedure with success.

First I made a backup.

Then I decided how much is empty in the volume with

#df -h

Because I could not unmount (in use) I booted a Knoppix live-CD.
Then activate the volume in question
#lvchange -ay

Then continued from # e2fsck in your procedure.

Thank you!

For future reference who still have interests in this topic, I make a reply to this old question.

The case of the original question is that Volume Group is composed of several Physical Volumes which actually...

0 0