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

LVM - recover from lvresize w/o shrinking file system



I am using LVM2 on kernel 2.6.7 from Debian Sid. When shrinking a
logical volume containing a Reiser filesystem from 48G to 40G using

  # lvresize -L 40G /dev/vg00/pub2

stupid me forgot to shrink the filesystem first using:

  # resize_reiserfs -s 40G /dev/vg00/pub2

Immediately after the lvresize command I recognised my mistake and
tried to restore the LVM metadata from the backup as follows:

  # vgcfgrestore -v --file /etc/lvm/archive/vg00_00043.vg vg00
    Restored volume group vg00
  # vgchange -a y vg00
    4 logical volume(s) in volume group "vg00" now active

which seemed to be succesful and the LVM structure looks recovered
when comparing the LVM files before lvresize and after vgcfgrestore,
but when checking the filesystem it is apparently corrupted now:

  # reiserfsck /dev/vg00/pub2
  Will read-only check consistency of the filesystem on /dev/vg00/pub2
  Will put log info to 'stdout'

  Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
  bread: Cannot read the block (12582911): (Invalid argument).

  reiserfs_open: Your partition is not big enough to contain the
  filesystem of (12582911) blocks as was specified in the found super block.

  Failed to open the filesystem.

Mounting the filesystem read-only also fails of course:

  # mount -o ro /pub
  mount: wrong fs type, bad option, bad superblock on /dev/vg00/pub2,
         or too many mounted file systems

Fortunately that logical volume only contained mirrors from public
file servers while the rest of the system is still intact. However,
I would like to recover the data to avoid transferring ~40GB again.

Any recommendation to recover the logical volume would be appreciated.

Achim



Reply to: