The beginning of ext2 partition is lost... help!

The beginning of ext2 partition is lost... help!

Post by Mikhail Dikovsk » Sun, 01 Apr 2001 07:57:38

Hi, all,

Can anyone help me with my problem?
My first hard disk was split to several partitions, some of which were
Linux partitions, some of them Windows ones. Two days ago Windows
scandisk "optimized its partition" (hda6) so that the remaining portion
of the partition table (after windows's partition) has been erased and
the beginning of the following partition has been overwritten as well.
Trying to recover my Linux partition, I set up a new Linux system
on the other hard disk and tried numerous utilities, including
gpart, fixdisk, and e2fsprogs. None of them could help me to locate the
beginning of my linux partition. I have put the partition hda7 to the
approximate location, according to my old notes, but I am not sure if it
is correct. Here is the partition table of hda by cfdisk:
  (1 cylinder = 1008*512 bytes)
            First    Last
 # Type     Sector   Sector   Offset  Length   Filesystem Type (ID)  
-- ------- -------- --------- ------ --------- ----------------------
 1 Primary        0    33263      63    33264  Linux (83)            
None (00)
 2 Primary    33264   545327       0   512064  Linux swap (82)      
None (00)
 3 Primary   545328  2593583       0  2048256  Win95 FAT32 (LBA) (0C)
Boot (80)
 4 Primary  2593584 40088159       0 37494576  Win95 Ext'd (LBA) (0F)
None (00)
 5 Logical  2593584 10785599    1008# 8192016  Win95 FAT32 (0B)      
None (00)
 6 Logical 10785600 31265662*     63 20480063* Win95 FAT32 (0B)      
None (00)
   Logical 31265663*31266144*      0      482* Free Space            
None (00)
 7 Logical 31266145*39663792*     63  8397648  Linux (83)            
None (00)
   Logical 39663793*40088159       0   424367* Free Space            
None (00)

The nice program findsuper did locate some superblocks:
mic:~# findsuper /dev/hda7
  thisoff     block fs_blk_sz  blksz grp last_mount
133970944    130831   1049758     2    1 Tue Mar 27 03:58:59 2001
402406400    392975   1049758     2    3 Tue Mar 27 03:58:59 2001
670841856    655119   1049758     2    5 Tue Mar 27 03:58:59 2001
939277312    917263   1049758     2    7 Tue Mar 27 03:58:59 2001
Unfortunately none of the e2fsprogs could open the ext2 filesystem, with
or without
the argument "-b 130831".
Now I need some way to restore the beginning of the partition... Can
anyone help?
If it is impossible, then, how can I recover at least part of the
directory tree,
most importantly the directories "work" and "disser" :( ?
Is there a tool that is able to search for and interpret the contents of
inodes? - some of those were untouched, I believe.

I would appreciate any help.



1. How to find lost ext2 partitions

Hello. I have a problem : I have two disks where the partition tables have
been erased by error (human error :)

The ext2 partitions haven't be damaged - or the damage is minimal.

But the partition tables were quite complex (2 swaps by disks, 2 ext2
partitions) And I can't manage to find the correct partition scheme.

Is there a way to find the correct partition, with finding the ext2
super-blocks ???

I tried with debugfs, dumpe2fs without much luck.
Also tried with fb to edit the whole disk, trying to find the ext2 MAGIC, which
is on the superblock I think... but using it is not very easy.

also tried ext2ed which seems to be the best tool for the purpose, but it
seems it's not running OK on redhat 5.2 (I don't see what I type on the

finally i wrote a script which try and increment the superblock number for
e2fsck, (the -b parameter for e2fsck) but I got things like that :

e2fsck 1.13, 15-Dec-98 for EXT2 FS 0.5b, 95/08/09
/dev/sdc contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory.  Clear<y>?

^^^^ This message seems not very good.
And what surprises me is that the block 17 shouldn't be a superblock ;
the disk is /dev/sdc: 17 heads, 62 sectors, 1009 cylinders

if I understand correctly, a block in the ext2 sense is, depending on the  
ext2 format chosen, n sectors, in the most cases, just 2 sectors ???
(and I find also a superblock on block 8192+17 , 8192*2 + 17 , etc...)

So my questions :

It is logic i find a superblock there ?? Maybe there is a geometry problem ?
? in that case I can't use standard fdisk to rebuild the tables...

Is there a good sector editor out there (with pattern find)

or is there an easy way to search for a ext2 superblock, and maybe rebuild
the correct partition table ??

\|/ ____ \|/ Fac. des sciences de Nantes-Linux-Python-IPv6-ATM-BONOM....


2. who knows what is language optional software package is on solaris 8?

3. fat32 + ext2 partitions lost. How to recover?

4. AIX 4.1.4 TCP/IP & NIS Client Setup

5. How to find lost ext2 partitions

6. Free copy Internet Security Monthly

7. resize ext2 partition without losing data?

8. LILO hangs early

9. I am buying an Ultra 5 but am lost in part numbers ....

10. help: lost of beginning of disk

11. Help! The beginning of the ext2 partition is lost.

12. ext2 partition resize & ext2 in boot manager

13. i am lost , help