Crash while Resizing (move start to "left") -> ext3-"/home"

How to use TestDisk to recover lost partition
Post Reply
Message
Author
humanerror
Posts: 1
Joined: 04 Nov 2012, 17:31

Crash while Resizing (move start to "left") -> ext3-"/home"

#1 Post by humanerror » 04 Nov 2012, 17:43

Hello,
I made a big mistake and have NO backup.

motivation: I deleted one older partition and wanted to put the freed GiB to my /home-partition (ext3-formatted).
Everything was processed with a promising look (read-only test OK, ...) when my laptop decided to shutdown due to overheating ...
So I rebooted and took a look with GParted (running from Linux Mint 13 from a usb-stick):

Image

As you can see, the original partition /device/sda5 with size 191 Gib (or so) is now 222 GiB and not readable.
So when it crashed during the process of moving the beginning (data) to the left (which would be the case if "increasing with space in before"), then there should be the data with a block of "nothing" in between. Only the rest of the data has to be moved and then the partition table has to be restored/recreated somehow.

=====================
When I first tried to recover the sparse superblocks with system-tools I got:

Code: Select all

mint@mint ~ $ sudo mke2fs -n /dev/sda5
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
14614528 inodes, 58432387 blocks
2921619 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1784 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872
When I check the given blocks with: (the same for every other block-number)

Code: Select all

mint@mint ~ $ sudo e2fsck -b 2654208 -B 4096 /dev/sda5
e2fsck 1.42 (29-Nov-2011)
e2fsck: Bad magic number in super-block while trying to open /dev/sda5

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
=====================
Then I gave Testdisk a try (snippet from its logfile):
this is from the advanced view mode: there it suggests to try some sparse blocks, but this results in "bad magic number at the beginning of ..."

Code: Select all

Interface Advanced
Geometry from i386 MBR: head=255 sector=63
NTFS at 32219/15/53
NTFS at 32231/206/40
check_part_i386 failed for partition type 83
get_geometry_from_list_part_aux head=255 nbr=1
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
get_geometry_from_list_part_aux head=32 nbr=1
get_geometry_from_list_part_aux head=64 nbr=1
get_geometry_from_list_part_aux head=128 nbr=1
get_geometry_from_list_part_aux head=240 nbr=1
get_geometry_from_list_part_aux head=255 nbr=1
 1 * Linux                    0   1  1  2594 131 33   41680833
     ext3 blocksize=4096 Large file Sparse superblock, 21 GB / 19 GiB
 2 E extended LBA          2594 131 34 32219  15 52  475918336
   X extended              2594 131 35  3120 226 50    8456191
 6 L Linux Swap            2594 164  3  3120 226 50    8454144
     SWAP2 version 1, pagesize=4096, 4328 MB / 4128 MiB
 5 L Linux                 3121   4 20 32218 254 62  467459098
 3 P HPFS - NTFS          32219  15 53 32231 206 39     204800 [System-reserviert]
     NTFS, blocksize=4096, 104 MB / 100 MiB
 4 P HPFS - NTFS          32231 206 40 38913  37 36  107335680 [Festplatte]
     NTFS, blocksize=4096, 54 GB / 51 GiB
search_superblock
search_superblock

recover_EXT2: s_block_group_nr=0/158, s_mnt_count=1/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 2 (block=0, blocksize=4096)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 262144 (block=32768, blocksize=4096)

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 786432 (block=98304, blocksize=4096)

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 1310720 (block=163840, blocksize=4096)

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 1835008 (block=229376, blocksize=4096)

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 2359296 (block=294912, blocksize=4096)

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 6553600 (block=819200, blocksize=4096)

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 7077888 (block=884736, blocksize=4096)

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 12845056 (block=1605632, blocksize=4096)

block_group_nr 81

recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=81/158, s_mnt_count=0/27, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 5210104
recover_EXT2: part_size 41680832
Ext2 superblock found at sector 21233664 (block=2654208, blocksize=4096)
  Linux                    0   1  1  2594 131 32   41680832
superblock 0, blocksize=4096 []
superblock 32768, blocksize=4096 []
superblock 98304, blocksize=4096 []
superblock 163840, blocksize=4096 []
superblock 229376, blocksize=4096 []
superblock 294912, blocksize=4096 []
superblock 819200, blocksize=4096 []
superblock 884736, blocksize=4096 []
superblock 1605632, blocksize=4096 []
superblock 2654208, blocksize=4096 []

To repair the filesystem using alternate superblock, run
fsck.ext3 -p -b superblock -B blocksize device

TestDisk exited normally.


TL;DR
Resized ext3-partition with GParted; Crash in between; impossible to recover data because partition-table is missing


What else can I try? Do I just use the wrong parameters for e2fsck?

How can I find the position where the moving-operation stopped?

Sponsored links

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests