Results 1 to 9 of 9

Thread: 10.04 w/ Ext4 Cannot boot after partition resize

  1. #1
    Join Date
    Jun 2008
    Beans
    78

    10.04 w/ Ext4 Cannot boot after partition resize

    Ubuntu is installed on /dev/sda1. The computer fails to boot and instead drops to an intramfs shell. The partition is still visible in gparted and fdisk, but it is unreadable. Attempting to mount it fails, and directs me to dmesg. Dmesg output:
    Code:
     EXT4-fs: bad geometry: block count (large number) exceeds size of device (another large number) blocks
    Output of fdisk:
    Code:
     Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders total 625142448 sectors
    Units = sectors of 1*512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk Identifier: 0x00013224
    
         Device    Boot     Start              End               Blocks     Id  System
    /dev/sda1      *       2048   391134554  195566253+    83     Linux
    /dev/sda2     601751550   625141759        11695105      5  Extended
    /dev/sda5     601751552   625141759        11695104     82 Linux swap/Solaris
    As the disk had not been written to or, to my knowledge, formatted, I was considering following this tutorial on restoring partitions to fix the problem. Would this work? Any loss of data would be a problem, as the computer is not mine and there are no backups.
    Last edited by Soupcan; June 20th, 2010 at 03:25 AM.

  2. #2
    Join Date
    Nov 2009
    Beans
    3,336

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Have you had a look using Testdisk this can show you the disk partition table
    and sometimes give you clues to heading in a direction for fixing it ......

  3. #3
    Join Date
    Jul 2008
    Location
    Oklahoma City, OK
    Beans
    330
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Not sure about 10.04, but i know in previous version, if You use gparted to resize your partition, it would create a new UUID for the partiion, instead of using the one that was already assigned.

    I don't recall how to fix this, but search the forums and You should be able to find it.

  4. #4
    Join Date
    Jun 2008
    Beans
    78

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Quote Originally Posted by 23dornot23d View Post
    Have you had a look using Testdisk this can show you the disk partition table
    and sometimes give you clues to heading in a direction for fixing it ......
    I have, but I did not finish the process. I stopped it during Deep Scan to run a few commands for a post on the GParted forum. I'll let it run all the way through and return with the results. I'd like to avoid writing anything to the drive until I get a few more opinions.

    Quote Originally Posted by gdonwallace View Post
    Not sure about 10.04, but i know in previous version, if You use gparted to resize your partition, it would create a new UUID for the partiion, instead of using the one that was already assigned.

    I don't recall how to fix this, but search the forums and You should be able to find it.
    Thanks, that's good to know. However, the partition can't be mounted, and so I cannot edit any files to point toward the new UUID. I'll be sure to check for that if I can make the drive usable again, though.

  5. #5
    Join Date
    Nov 2009
    Beans
    3,336

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Safest way get as much information as possible before committing to disk.

    Also try to get a backup image or remove as much useful data as you can ....
    photographs documents etc ..... anything thats not easily replaceable for the owner.

    Photorec recovers photos without changing the drives contents as far as I know ....
    this I have used to recover photos off of accidentally deleted SD cards before .......
    it also worked on a hard drive I had a problem with once .....
    Last edited by 23dornot23d; June 20th, 2010 at 12:29 AM.

  6. #6
    Join Date
    Jun 2008
    Beans
    78

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Quote Originally Posted by 23dornot23d View Post
    Safest way get as much information as possible before committing to disk.

    Also try to get a backup image or remove as much useful data as you can ....
    photographs documents etc ..... anything thats not easily replaceable for the owner.

    Photorec recovers photos without changing the drives contents as far as I know ....
    this I have used to recover photos off of accidentally deleted SD cards before .......
    it also worked on a hard drive I had a problem with once .....
    I'll do that. Of course, the only storage I have handy is an 8gb flash drive, while the partition contained about 16gb of data.

  7. #7
    Join Date
    Jun 2008
    Beans
    78

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    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.
    Last edited by Soupcan; June 20th, 2010 at 06:53 AM.

  8. #8
    Join Date
    Jan 2008
    Location
    Melbourne, Australia.
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    Cheers for that, it helped me out too.

    I think the problem for me had something to do with this:
    http://gparted-forum.surf4.info/viewtopic.php?id=13777

  9. #9
    Join Date
    Feb 2008
    Location
    Toronto, ON, CA
    Beans
    405
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: 10.04 w/ Ext4 Cannot boot after partition resize

    What version of gparted does the 10.04 live cd use?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •