[linux-lvm] lvm2 and external enclosures

Stuart D. Gathman stuart at bmsi.com
Mon Jul 20 04:30:21 UTC 2009

On Sun, 19 Jul 2009, Ron Johnson wrote:

> (The purpose of this "exercise" is to implement a backup strategy.)


> Any thoughts on getting lvm2 to play nice with dynamic devices?

You have to do "vgchange -an backupvgxx" before removing the 
dynamic volumes.  It is possible to deactivate the vg after
physical removal (which you must do before a vgscan will work),
but it was tricky - the details were posted here a while back.

I created the VG on the full physical device (/dev/sdx, not /dev/sdx1),
and liked the idea of dispensing with the crufty DOS boot sector,
and getting resizable "partitions".

But the whole process is a pain (the two levels of mount/umount/vgchange) 
- and after creating similar backup solutions at 7 sites, I finally decided
that a labeled (so it doesn't matter which device node the drive appears on)
filesystem on /dev/scx1 was the simplest and most reliable way to go.
I keep the filesystem mounted in readonly mode (users are always removing
tapes or usb drives when they aren't supposed to, "Didn't you see the yellow
light flashing???").  I do "mount  -o remount,rw /media/backup" before the
backup script, and "mount -o remount,ro /media/backup" afterward.  I do and
unmount and fsck every day - which ensures that the fs gets clean regularly.

Where USB and other hotswap drives shine with LVM is testing drive failure
recovery.  It is simple and safe (hardware wise) to disconnect a USB
drive to see how your LVM configuration handles the failure.

	      Stuart D. Gathman <stuart at bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

More information about the linux-lvm mailing list