LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   superblock is corrupt after attempted resize & move of ext3 partition (https://www.linuxquestions.org/questions/linux-hardware-18/superblock-is-corrupt-after-attempted-resize-and-move-of-ext3-partition-856026/)

ktat 01-13-2011 02:25 AM

superblock is corrupt after attempted resize & move of ext3 partition
 
Hi All,

I could really use some help here (I hope I am posting in correct place), I have made my /home partition inaccessible :(

Problem started when I used gparted to resize and move /dev/sda3 (where all my personal data is). This partition is about 250G and the process was going to take some hours to complete so I went to bed before it finished. When I checked it in the morning my pc had shut itself down, so I rebooted and started up gparted again. Looking at the partition table in gparted I noticed that /dev/sda6 had been resized, however it hadn't been moved. I tried to move it and the following error came up...



Code:

GParted 0.5.2



Libparted 2.2

Check and repair file system (ext3) on /dev/sda3  00:00:01    ( ERROR )

           

calibrate /dev/sda3  00:00:01    ( SUCCESS )

           

path: /dev/sda3

start: 39054829

end: 474914343

size: 435859515 (207.83 GiB)

check file system on /dev/sda3 for errors and (if possible) fix them  00:00:00    ( ERROR )

           

e2fsck -f -y -v /dev/sda3

           

e2fsck: Group descriptors look bad... trying backup blocks...

e2fsck: going back to original superblock

Filesystem mounted or opened exclusively by another program?

e2fsck 1.41.11 (14-Mar-2010)

e2fsck: The ext2 superblock is corrupt when using the backup blocks

e2fsck: Device or resource busy while trying to open /dev/sda3



This is the dmesg output...



Code:

karlos@ubuntu-10:~$ dmesg|tail

[ 4588.270555] EXT3 FS on sda6, internal journal

[ 4588.270565] EXT3-fs: mounted filesystem with ordered data mode.

[ 4669.197392] kjournald starting.  Commit interval 5 seconds

[ 4669.197633] EXT3 FS on sda6, internal journal

[ 4669.197643] EXT3-fs: mounted filesystem with ordered data mode.

[ 6401.853257] kjournald starting.  Commit interval 5 seconds

[ 6401.853573] EXT3 FS on sda6, internal journal

[ 6401.853584] EXT3-fs: mounted filesystem with ordered data mode.

[ 7895.924569] EXT3-fs error (device sda3): ext3_check_descriptors: Block bitmap for group 1 not in group (block 0)!

[ 7895.925081] EXT3-fs: group descriptors corrupted!



Then I did some playing around with the partition table, deleting partitions and then rescuing them with parted. This resulted in sda3 becoming sda1. To continue



## backing up sda1

Code:

sudo dd if=/dev/sda1 of=/home/karlos/backup/backup-sda1.img

435859512+0 records in

435859512+0 records out

223160070144 bytes (223 GB) copied, 3623.43 s, 61.6 MB/s



## then after trying a number of different superblocks.. (found using mke2fs -n /dev/sda1)

Code:

karlos@ubuntu-10:~$ sudo e2fsck -f -b 163840 /dev/sda1

e2fsck 1.41.11 (14-Mar-2010)

Resize inode not valid.  Recreate<y>? yes



Pass 1: Checking inodes, blocks, and sizes

Inode 161, i_blocks is 3440, should be 0.  Fix<y>? yes



Inode 417, i_blocks is 48, should be 0.  Fix<y>? yes



Inode 32769 is a unknown file type with mode 00 but it looks like it is really a directory.

Fix<y>? yes



Inode 98337, i_blocks is 16, should be 0.  Fix<y>? yes



Inode 98338, i_blocks is 72, should be 0.  Fix<y>? yes



Inode 114849 is a unknown file type with mode 00 but it looks like it is really a directory.

Fix<y>? yes



Inode 147489, i_blocks is 8, should be 0.  Fix<y>? yes



Inode 147490 is a unknown file type with mode 00 but it looks like it is really a directory.

Fix<y>? yes



Inode 180225 is a unknown file type with mode 00 but it looks like it is really a directory.

Fix<y>? yes



Inode 180225, i_size is 0, should be 4096.  Fix<y>? yes



Inode 213025, i_blocks is 4168, should be 0.  Fix<y>? yes



Inode 213026, i_blocks is 4240, should be 0.  Fix<y>? yes



Inode 213027, i_blocks is 3368, should be 0.  Fix<y>? yes



Inode 213028, i_blocks is 4448, should be 0.  Fix<y>? yes



Inode 213029, i_blocks is 3512, should be 0.  Fix<y>? yes



Special (device/socket/fifo) inode 2116299 has non-zero size.  Fix<y>?



.....



Inode 5179684 has illegal block(s).  Clear<y>? yes



Illegal block #0 (4040140531) in inode 5179684.  CLEARED.

Illegal block #1 (3902218074) in inode 5179684.  CLEARED.

Illegal block #2 (771429886) in inode 5179684.  CLEARED.

Illegal block #3 (935633403) in inode 5179684.  CLEARED.

Illegal block #4 (1327107087) in inode 5179684.  CLEARED.

Illegal block #5 (3680397508) in inode 5179684.  CLEARED.

Illegal block #6 (1350728668) in inode 5179684.  CLEARED.

Illegal block #7 (846466656) in inode 5179684.  CLEARED.

Illegal block #8 (3803158996) in inode 5179684.  CLEARED.

Illegal block #9 (346235357) in inode 5179684.  CLEARED.

Illegal block #10 (2055782526) in inode 5179684.  CLEARED.

Too many illegal blocks in inode 5179684.

Clear inode<y>?



......



Illegal block #135267340 (1295874896) in inode 5179471.  CLEARED.

Error storing directory block information (inode=5179471, block=0, num=126821203): Memory allocation failed

e2fsck: aborted



### try again...

Code:

root@PartedMagic:~# e2fsck -f -b 163840 /dev/sda1

e2fsck 1.41.11 (14-Mar-2010)

Resize inode not valid.  Recreate<y>? yes



Pass 1: Checking inodes, blocks, and sizes

Inode 5179471 has illegal block(s).  Clear<y>? yes



Illegal block #135267340 (1295874896) in inode 5179471.  CLEARED.

Error storing directory block information (inode=5179471, block=0, num=126821236): Memory allocation failed

e2fsck: aborted




So now I am stuck with an error stating "memory allocation failed", does anyone know what this means and how I might work around it?

syg00 01-13-2011 03:07 AM

I suspect you may have lost the opportunity to "work around it". If there ever was such an opportunity.
I've generally had very good results with gparted, but I'm anal about backups before screwing with data. I just searched and found this - you may not like what it says.

Reuti 01-14-2011 04:23 AM

Quote:

Originally Posted by syg00 (Post 4222645)
I've generally had very good results with gparted, but I'm anal about backups before screwing with data.

Especially when there is no UPS for the system during such an operation.


All times are GMT -5. The time now is 05:26 AM.