1 (edited by janhe 2010-06-04 00:44:37)

Topic: [SOLVED] shrinking ext2 partition aborts on file system check after...

The error occured during the "check file system on /dev/sda7 for errors and (if possible) fix them" stage,
after doing the resize (and move to the right)
details from the error report: http://lumumba.uhasselt.be/heja/gparted_details.htm

I used the gparted 0.5.2-9 "live cd" via PXE

fdisk -l -u:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0b480b48

   Device Boot      Start         End      Blocks   Id  System
/dev/sda2          401625    21382514    10490445   83  Linux
/dev/sda3   *    21382515    86654609    32636047+   7  HPFS/NTFS
/dev/sda4        86654610   156296384    34820887+   f  W95 Ext'd (LBA)
/dev/sda5        86654673   102012749     7679038+  83  Linux
/dev/sda6       102012813   130399604    14193396   83  Linux
/dev/sda7       138785598   156296384     8755393+  83  Linux

parted /dev/sda unit s print:

Model: ATA FUJITSU MHW2080B (scsi)
Disk /dev/sda: 156301488s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End         Size       Type      File system  Flags
 2      401625s     21382514s   20980890s  primary   ext3
 3      21382515s   86654609s   65272095s  primary   ntfs         boot
 4      86654610s   156296384s  69641775s  extended               lba
 5      86654673s   102012749s  15358077s  logical   ext3
 6      102012813s  130399604s  28386792s  logical   ext3
 7      138785598s  156296384s  17510787s  logical

Can you help me to recover from this error, or am I on my own?

2

Re: [SOLVED] shrinking ext2 partition aborts on file system check after...

From reviewing the gparted_details.htm file, it appears that the steps to shrink the file system and to move it to the right completed successfully.  Unfortunately for some reason the last check of the file system failed with an indication that the file system was in use.

It should be possible to recover the file system and the data contained within, but unfortunately I do not have the time to help you with this.  Perhaps some one else in this forum could help?

You might try using photorec to try to recover you data.

3

Re: [SOLVED] shrinking ext2 partition aborts on file system check after...

gedakc wrote:

You might try using photorec to try to recover you data.

That doesn't seem to be a solution. It turns up allot of files that were in a virtual machine on that disk, and the data I want to find is impossible to trace down between all those .txt files.

I tried to run e2fsck again, and it seems like the shrink didn't go as it should have (or am I wrong?):

root@jan:/# e2fsck /dev/sda7
e2fsck 1.41.8 (11-July-2009)
The filesystem size (according to the superblock) is 3237089 blocks
The physical size of the device is 2188848 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes

Would it hurt to try and continue the e2fsck (instead of abort)?

4

Re: [SOLVED] shrinking ext2 partition aborts on file system check after...

Based on the output in post #3, it would appear that the problem is different than I first thought.  It seems that the file system size is bigger than the partition.

This is a problem that we have been struggling with on and off for a few months now.  You can read more about this problem at the following link:
WARNING! Problem Resizing File Systems with GParted

If the partition had not been moved, then I would suggest using fdisk to increase the size of the partition back to it's original size.

Since this is not the case, the partition either needs:

1) To be moved back to it's original location
   

dd if=/dev/sda bs=512 count=17510787 skip=138785598 | dd of=/dev/sda bs=512 seek=130399668

   , have the partition increased to encompass the entire file system by using fdisk to delete sda7 and recreate it with the following:
   

130399668 - start sector
156296384 - end sector
25896717 - total sectors

   , and have the file system checked and fixed.
   

e2fsck -f -y -v /dev/sda7

, OR

2) To be shrunk down to fit within the partition (I don't think that this will work due to partition constraints.)
   

resize2fs /dev/sda7 8755393K

Please note that you should review the above commands.  My thoughts are that the method #1 would have the best chance for success.

5

Re: [SOLVED] shrinking ext2 partition aborts on file system check after...

I tried method #1

I wasn't able to save the partition, but I was able to get the data off.

Thank you for your help.

6

Re: [SOLVED] shrinking ext2 partition aborts on file system check after...

I am glad to hear that you were able to recover your data.

Thanks also for editing the initial post and prefixing the title with SOLVED.  This might help other users search for solutions to problems.