LVM - recover from lvresize w/o shrinking file system

From: Achim Löbbert (aloebbert_at_gmx.de)
Date: 07/28/04

  • Next message: Tim Raats: "Upgrade Sarge to Sid failed ?"
    Date: Wed, 28 Jul 2004 16:14:40 +0200 (CEST)
    To: debian-user@lists.debian.org
    
    

    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

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Tim Raats: "Upgrade Sarge to Sid failed ?"

    Relevant Pages

    • Re: Fedora Cookbook: Resizing a logical volume
      ... need to umount the filesystem, ... Shrinking must be off-line, still. ... Note that usually there's no symlinks for lvm utilities in the rescue ... You do have to rescan the partition table if you changed the partition ...
      (Fedora)
    • LVM - recover from lvresize w/o shrinking file system
      ... logical volume containing a Reiser filesystem from 48G to 40G using ... which seemed to be succesful and the LVM structure looks recovered ... Any recommendation to recover the logical volume would be appreciated. ...
      (Debian-User)
    • Re: How to resize ext3 partitions?
      ... create a new partition that starts where the old one did and continues ... "ext2online" to resize the filesystem to match. ... not shrinking. ... run resize2fs to shrink the filesystem then use fdisk ...
      (Fedora)
    • Re: lvm -> shrinking logical volumes
      ... >ext2/ext3 filesystems, you can use resize2fs for this. ... >the filesystem size smaller than the size I eventually want it to be (to ... >shrinking the logical volume to get the filesystem using the full size ... I've never heard about this resize2fs tool. ...
      (Fedora)
    • [SLE] Update with LVM and Raid
      ... Why not use LVM for the root filesystem too? ... select "Start Installation or System" ...
      (SuSE)