LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-04-2007, 08:46 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Why LVM?


Why would I want to partition my drive using LVM? I am trying to think of a scenario that this would benefit me or what the benefit of this is. Can someone please break down some fundamental ideas of why this is a preferred or popular option of disk assignment?

Just for kicks I am installing Linux on my new Dell which I am using 2 x 500GB S-ATA drives in.
 
Old 01-04-2007, 10:21 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
From hear say (no experience with it):
You can expand your partitions. i.e. when /home gets full, just stick in another hd and add it to the volume.
 
Old 01-05-2007, 07:43 AM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
So it's kind of like an add-on RAID once the poop has hit the fan...
 
Old 01-05-2007, 12:30 PM   #4
strick1226
Member
 
Registered: Feb 2005
Distribution: Arch, CentOS, Fedora, macOS, SLES, Ubuntu
Posts: 327

Rep: Reputation: 63
To my knowledge lots of home theatre/MythTV folks use it. It really can speed up disk performance, but RAID0 across several drives frightens me a bit. Once a single drive fails you're out of luck...

You could, in theory, set up a redundant set of 2x LVM in order to provide a mirror, but that sounds pricey.
 
Old 01-05-2007, 12:46 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
It probably depends on how many spindles (uhh, "disk drives") you have to manage.

The essential concept behind LVM is that of a storage pool, which is simply "a place to put files in." The pool may consist of one drive or many; files in the pool may be spread among many drives, and/or duplicated onto many drives, and all of this is under the perview of the LVM.

If you need to enlarge a storage pool, you can add spindles to it at any time. You manage your storage as a resource that is no longer defined by "a particular physical device," but simply "a storage resource."
 
Old 01-05-2007, 03:05 PM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
The way I understand a Linux needs a driver to recognise a LVM. Grub can't read it so that is why /boot is needed in a separate partition.

Not use it myself but mounting a LVM to access the files inside may be a bit of a challenge I suppose, pressumably requiring some LVM-associated commands, especially if there are several partitions and disks inside.

Can a user migrate a LVM? say from a Pata into a Sata disk?

I could be wrong but if I start to learn Linux I feel a lot better to use the standard kits rather than going for a LVM without knowing how the normal partitions work first.

Let's see if anybody would challenge the statement that there is very little need to resize a Linux partition because we can just create a bigger one, format it to the required filing system, tar the content across and revised the /etc/fstab if needed.

I migrate the whole Linux this way (which need to alter the partition reference in the boot loader is /boot is affected). Also I frequently have to install a Linux in a simple disk with only a few number of partitions inside and then move it into a bigger disk with high-number partitions that can scare away many installers.

Last edited by saikee; 01-05-2007 at 03:12 PM.
 
Old 01-05-2007, 04:03 PM   #7
eyebrowsoffire
Member
 
Registered: Sep 2004
Location: Goleta, CA
Distribution: Fedora Core 6
Posts: 55

Rep: Reputation: 15
Quote:
Originally Posted by saikee
Can a user migrate a LVM? say from a Pata into a Sata disk?
I'm not a complete expert on this, but I think so. If you have a Volume Group with Disk A as a physical volume, you can add Disk B as a physical volume to the Volume Group and then pvmove the blocks of data from Disk A to Disk B. Then you can uninitialize Disk A and remove it. I think this is how it works but like I said, I'm pretty new to LVM.

But I think this is the general concept behind LVM. So that instead of having a bunch of different disks to deal with, and worrying about different partitions on different drives, you can just think about it as one big pool of space. As long as you have enough space to hold all of your data, you can change what physical volumes hold the data pretty easily.
 
Old 01-05-2007, 04:20 PM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
eyebrowsoffire,

If one loses the location for addressing Disk A, as it has been "uninitialised", how does the LVM label itself in Disk B, using the same label even if it is on a different disk? I suppose the kernel must find the new location of the LVM in the "root=" parameter.
 
Old 01-06-2007, 03:47 AM   #9
eyebrowsoffire
Member
 
Registered: Sep 2004
Location: Goleta, CA
Distribution: Fedora Core 6
Posts: 55

Rep: Reputation: 15
Quote:
Originally Posted by saikee
eyebrowsoffire,

If one loses the location for addressing Disk A, as it has been "uninitialised", how does the LVM label itself in Disk B, using the same label even if it is on a different disk? I suppose the kernel must find the new location of the LVM in the "root=" parameter.
I'm not sure I completely understand the question, and like I said, I am by no means an expert on the subject, but this is how I think LVM works:

You create a partition for LVM to use without a filesystem on it. Then, you use LVM to initialize the partition for use in LVM, making it a "physical volume". To do this, you basically can specify any size you want that is smaller than or equal to the size of the partition, or if you don't specify it just creates the maximum sized physical partition. You also need to specify what "volume group" it will belong to (which means you have to create the volume group if there isn't already one). So anyway, now the volume group has a certain amount of "free space," which right now, is all of it. You can use this space to create logical volumes, and on each of the logical volumes, you can create a filesystem on which you store your files.

So let's say that I have one hard drive that's 100GB, and its label is /dev/hda. I create a partition on it that is /dev/hda1 that takes up the whole drive. Without creating a filesystem on that partition, I create a physical volume on it using LVM that takes up the whole partition and place it in the volume group "/dev/VolGroup00". Then I make a logical volume in the volume group "/dev/VolGroup00" called "LogVol00" that takes up all the space in the volume group. I can treat this logical volume as a partition, so I format "/dev/VolGroup00/LogVol00" as an ext3 filesystem.

Now, if I wanted to move it to a different drive, I would install a 100GB hard drive as /dev/hdb. I would partition it, and then initialize it as a physical volume and add it to "/dev/VolGroup00". Then all I would have to do is use LVM to move the logical volume from one physical volume to the other and I can remove /dev/hda as a physical volume and do what I want with it.

Again, if I'm spouting wrong information, someone please correct me, because I'm pretty new to this stuff.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to change non-LVM to LVM? darthfoolish Linux - Software 2 08-01-2008 03:47 AM
lvm anyone? puffinman Linux - Software 2 06-26-2005 11:07 AM
Lvm uselpa Slackware 1 03-03-2005 05:44 AM
lvm Ammad Linux - General 2 02-22-2005 08:19 PM
To LVM or not to LVM? illtbagu Linux - Software 3 12-29-2003 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration