Problem solved through the following steps:
Backup of mbr through dd:
Code:
dd if=/dev/sda of=mnt/usb bs=512 count=1
Output of dmesg showed that ext4 expected a filesystem of 601747456 sectors in size. This was determined by multiplying the value given after "block count" by 8 to convert to sectors.
dmesg output:
Code:
[ 2805.943334] EXT4-fs (sda1): bad geometry: block count 75218432 exceeds size of device (48891563 blocks)
On to repairing. Creating backup of partition table with sfdisk:
Code:
sfdisk -d /dev/sda > PT.txt
Keep an unchanged copy of PT.txt in case the next steps do not work. Edit PT.txt with any editor. In PT.txt, the line referring to /dev/sda1 was changed to the following:
Code:
/dev/sda1 : start= 2048, size=601747456, Id=83, bootable
The value of "size=" was changed from its previous value to the value expected by ext4.
Then, with the corrected PT.txt, the partition table was changed to the new values:
Code:
sudo sfdisk -f /dev/sda -O PT.save < PT.txt
After this, /dev/sda1 mounted cleanly with
Code:
sudo mount -o ro /dev/sda1 /mnt/sda1
Filesystem check showed no errors, no data was lost, and the system rebooted properly. Thanks very much to thune3, who walked me through fixing this over IRC.
Bookmarks