Skip to contentSkip to conversation

lvm2 and external enclosures

linux-lvm Ron Johnson 2 participants 3 messages Jul 19, 2009 – Jul 20, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

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

I created PVs then an LV on a pair of drives in a USB dual enclosure, created the FS, backed up my data, umounted the fs, and disconnected/powered down the enclosure.

Upon powering it back up/reconnecting it, I did vgscan, vgchange, mount, but got IO and "unable to read superblock" errors.

Rebooting, even with the external drives disconnected, made things all better (though I did have to do an lvchange -a y).

***** START ******

# vgscan
  WARNING: Ignoring duplicate config node: filter (seeking filter)
  Reading all physical volumes.  This may take a while...
  /dev/dm-1: read failed after 0 of 4096 at 2000380952576: 
Input/output error
  /dev/dm-1: read failed after 0 of 4096 at 2000381009920: 
Input/output error
  /dev/dm-1: read failed after 0 of 4096 at 0: Input/output error
  /dev/dm-1: read failed after 0 of 4096 at 4096: Input/output error
  /dev/dm-1: read failed after 0 of 4096 at 0: Input/output error
  Found volume group "backup_vg" using metadata type lvm2
  Found volume group "main_huge_vg" using metadata type lvm2
# vgchange -a y backup_vg
  WARNING: Ignoring duplicate config node: filter (seeking filter)
  /dev/dm-1: read failed after 0 of 4096 at 0: Input/output error
  1 logical volume(s) in volume group "backup_vg" now active
# mount -v /mnt/backups
mount: wrong fs type, bad option, bad superblock on /dev/mapper/backup_vg-backup_lv,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
[28722.859373] EXT4-fs: unable to read superblock
[28722.859458] EXT3-fs: unable to read superblock

***** STOP *****

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

Thanks

Signature · 2 lines
Scooty Puff, Sr
The Doom-Bringer
#1 lore raw
Quoted 1 line · Ron Johnson

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

...

Quoted 1 line

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.

Signature · 4 lines
	      Stuart D. Gathman <[email protected]>
    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.
#2 lore raw
Quoted 9 lines · Stuart D. Gathman
Quoted 1 line · Ron Johnson

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

...

Quoted 1 line

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

Worked like a charm. Thanks!

Signature · 2 lines
Scooty Puff, Sr
The Doom-Bringer