manse
11th April 2011, 01:36 AM
I've just installed Fedora 14 over an old Ubuntu (heron, I think). The old install used a single partition for both / and /home; and I wanted to try to avoid reinstalling /home if possible (but yes, I did back it up).
I chose the anaconda option to shrink the old Ubuntu /, and created a new LVM for the Fedora /. This seemed to work perfectly. I mounted the old / on '/host' (an old naming habit), and then mounted individual home dirs into /home using autofs. All seemed fine. However, on my first reboot after the autofs mounts fsck failed.
The current situation is as follows:
# fsck /dev/sda6
fsck from util-linux-ng 2.18
e2fsck 1.41.12 (17-May-2010)
The filesystem size (according to the superblock) is 15360000 blocks
The physical size of the device is 15359895 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes
# dumpe2fs /dev/sda6 | grep 'Block count'
dumpe2fs 1.41.12 (17-May-2010)
Block count: 15360000
# dumpe2fs -o superblock=32768 /dev/sda6 | grep 'Block count'
dumpe2fs 1.41.12 (17-May-2010)
Block count: 15360000
Same thing for all the other backup superblocks I've tried.
# echo '15360000 4 * p' | dc
61440000
# fdisk -s /dev/sda6
61439583
resize2fs tells me to run fsck, and complains of a short read if I try to force. fsck seems to run fine if I say 'no' to the abort prompt, but doesn't change the problem. Filesystem is ext3..
Can anyone suggest a way to fix this short of remaking the filesystem and recovering from the backup?
Many thanks.
manse.
---------- Post added 11th April 2011 at 01:36 AM ---------- Previous post was 10th April 2011 at 08:13 PM ----------
Managed to fix it, thanks to http://smartmontools.sourceforge.net/badblockhowto.html.
For the record:
Started with debugfs. First used icheck and ncheck to work out which file(s) had been written to the non-existent blocks past the partition size. Fortunately, there was only one. Deleted that file (can restore it from backup later). Quit debugfs.
Now resize2fs -p -f worked perfectly. fsck after resizing was clean. Reboot seems happy.
Hope someone else finds this helpful.
As for the origin of the problem, I would guess there's a rounding bug in the code anaconda uses to shrink partitions ...
m.
I chose the anaconda option to shrink the old Ubuntu /, and created a new LVM for the Fedora /. This seemed to work perfectly. I mounted the old / on '/host' (an old naming habit), and then mounted individual home dirs into /home using autofs. All seemed fine. However, on my first reboot after the autofs mounts fsck failed.
The current situation is as follows:
# fsck /dev/sda6
fsck from util-linux-ng 2.18
e2fsck 1.41.12 (17-May-2010)
The filesystem size (according to the superblock) is 15360000 blocks
The physical size of the device is 15359895 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes
# dumpe2fs /dev/sda6 | grep 'Block count'
dumpe2fs 1.41.12 (17-May-2010)
Block count: 15360000
# dumpe2fs -o superblock=32768 /dev/sda6 | grep 'Block count'
dumpe2fs 1.41.12 (17-May-2010)
Block count: 15360000
Same thing for all the other backup superblocks I've tried.
# echo '15360000 4 * p' | dc
61440000
# fdisk -s /dev/sda6
61439583
resize2fs tells me to run fsck, and complains of a short read if I try to force. fsck seems to run fine if I say 'no' to the abort prompt, but doesn't change the problem. Filesystem is ext3..
Can anyone suggest a way to fix this short of remaking the filesystem and recovering from the backup?
Many thanks.
manse.
---------- Post added 11th April 2011 at 01:36 AM ---------- Previous post was 10th April 2011 at 08:13 PM ----------
Managed to fix it, thanks to http://smartmontools.sourceforge.net/badblockhowto.html.
For the record:
Started with debugfs. First used icheck and ncheck to work out which file(s) had been written to the non-existent blocks past the partition size. Fortunately, there was only one. Deleted that file (can restore it from backup later). Quit debugfs.
Now resize2fs -p -f worked perfectly. fsck after resizing was clean. Reboot seems happy.
Hope someone else finds this helpful.
As for the origin of the problem, I would guess there's a rounding bug in the code anaconda uses to shrink partitions ...
m.