[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: questions about lvm2



On Wednesday 21 January 2009 09:13:07 pm Ron Johnson wrote:
> If I have lots of existing data in JBODs, would I create a PV and VG
> on the new drive, mv all the data from the existing drives to the
> new VG, then add my existing drives (while also enlarging the fs) to
> the one-drive VG, thus making an uber-device?

That is exactly what I would do. Everyone warns about how cataclysmic things 
will happen because your new uber-device has the same failrate as a raid-0 
setup, but as long as you backup regularly (perhaps to another LV made from 
PV's on different disks) this isn't too much to worry about.

> Also, what's a good HOWTO?  Everything I've found via Google seems
> out-of-date.

When I first set up LVM I used the LVM2 howto here

http://tldp.org/HOWTO/LVM-HOWTO/

The "anatomy" and "common tasks" are really all you need.

Here are the notes I made when I set up LVM. First partition the drives you 
want to use. Make sure to set the type of the partitions as linux LVM. Next 
tell LVM2 about them with

$ pvcreate <device name>

You can see what devices are seen by lvm2 with pvdisplay. Next make a VG

$ vgcreate <vg name> <device1> <device2> ...

At this point you might need to activate the volume group

$ vgchange -a y <vg name>

Next make a LV in the VG

$ lvcreate -n <lv name> -l <extents> <vg name>

You can get the number of extents available in a volume group with vgdisplay. 
There should now be a new device file at /dev/<vg name>/<lv name> that you 
can put a filesystem on. You can only enter /dev/<vg name> as root, but the 
device-mapper framework puts links to the LV's in /dev/mapper/<vg name>_<lv 
name> when you it gets started at boot (this is the location most people 
point to in their fstab).

Since you're already using the device-mapper, you also might want to set up 
encryption with cryptsetup.

MM


Reply to: