Ask Your Question
0

File System size discrepancies

asked 2012-03-29 16:27:11 -0500

escozzia gravatar image

updated 2012-03-29 20:00:38 -0500

I'm new to the world of LVM (and Fedora for that matter) and I'm used to doing everything via simple partitions... At any rate here's my story, my hard drive had a primary partition with windows on it, and an extended partition with some Linux distro (call it sda5) and swap space. I told the Fedora installer to resize sda5, and it made a PV in there. It split it into the new system and some more swap space, so I had it delete the old swap partition, make a new PV in that space, hook it up to the volume group and grow the Fedora root. Once the system got installed, I wanted to mount sda5 to get out some data, and it refused to mount with "wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or helper program, or other error". Upon inspecting dmesg, I got:

bad geometry: block count 27498496 exceeds size of device (27498280 blocks)

So I tried resize2fs -f and I got:

    Attempt to read block from filesystem resulted in short read while trying to resize /dev/sda5
Please run 'e2fsck -fy /dev/sda5' to fix the filesystem
after the aborted resize operation.

e2fsck gave me:

    The filesystem size (according to the superblock) is 27498496 blocks
The physical size of the device is 27498280 blocks
Either the superblock or the partition table is likely to be corrupt!

and implied that I should give up the ghost, basically. So I tried e2fsck -b, using a superblock from mke2fs -n, but it gave me the exact same output. I'm running out of tricks, does anyone know what could be going on and how to fix it? Supposing the filesystem is lost (which doesn't seem obvious to me) how should I go about recovering it? edit: the FS was perfectly fine before I did the install, I actually mounted it and checked it out from the live USB right before I installed.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-03-31 19:46:40 -0500

I think that when you told the Fedora installer to resize sda5, make an LVM PV of it, and split it into the new system and some more swap space" you overlaid your original sda5. If you don't have a backup of it I'm afraid the data that was in sda5 is lost.

When you add a partition to LVM and created logical volumes in it, that partition is no longer mountable, or resize-able, etc. It's no longer a filesystem. The logical volumes in the volume group on that physical volume are format-able, mountable, resize-able, etc.

If you're curious you can do a few lvm displays that show you a lot of information about your PV(s) and LV(s). You can do 'pvdisplay --maps /dev/sda5' and conversely you can look at it from an LV perspective with 'lvdisplay --maps /dev/mapper/<vgname>-<lvname>'.

Hope this helps.

edit flag offensive delete link more
0

answered 2012-03-31 14:08:59 -0500

mether gravatar image

Please file a bug report in Red Hat bugzilla.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-03-29 16:27:11 -0500

Seen: 912 times

Last updated: Mar 31 '12