How to find lost ext2 partitions

How to find lost ext2 partitions

Post by Yann Dupo » Sat, 16 Jan 1999 04:00:00



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
keyboard)..

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 ??

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


   \__U_/    http://www.unantes.univ-nantes.fr/~dupont

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


   \__U_/    http://www.unantes.univ-nantes.fr/~dupont

 
 
 

How to find lost ext2 partitions

Post by Peter Samuels » Sun, 17 Jan 1999 04:00:00



Quote:> 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.

Some time ago Gordon Chaffee (author of Linux support for such things
as vfat and fat32) announced a utility to do exactly this.  Look for
details on

  http://bmrc.berkeley.edu/people/chaffee/fat32.html

If HTTP is inconvenient, just get the file via FTP:

  bmrc.berkeley.edu:/pub/linux/rescue/fixdisktable-0.*

fat32.html makes no mention of swap partitions.  I do not know whether
fixdisktable can cope with a disk that has swap partitions (or any
other type it doesn't know about).  It claims to understand FAT16,
FAT32, NTFS, BSD UFS, BSD disklabels, and of course ext2.

--
Peter Samuelson
<sampo.creighton.edu!psamuels>

 
 
 

How to find lost ext2 partitions

Post by Tero Peland » Mon, 18 Jan 1999 04:00:00



>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.

...

You could try the gpart program that tries to guess the partition tables.
If you can't find on an ftp server try...
        http://www.stud.uni-hannover.de/user/76201/gpart/

 
 
 

How to find lost ext2 partitions

Post by Yann Dupo » Tue, 19 Jan 1999 04:00:00


Thanks to all the persons which responded.

I was finally able to find the partitions again with the combination of
fixdisktable (located my partitions ) but seg faults (*),
the advice and program from David D. Gitchell,

and finally, with the program gpart wich was able to rewrite a good
partition table.

The main problem was that the geometry reported by the disk didn't
correspond to the geometry of the disk when the partition were created :
Thoses disks were quite old, and never reformated (thanks linux
stability) sine 3 years, and in fact the geometry wasn't good
(they were probably  formatted by another SCSI adaptor, I don't remember)

(*) I suppose that's why fixdisktable seg faults...

Anyway thanks a lot everybody !

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


   \__U_/    http://www.unantes.univ-nantes.fr/~dupont

 
 
 

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
keyboard)..

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 ??

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


   \__U_/    http://www.unantes.univ-nantes.fr/~dupont

2. Connecting through NAT

3. Lost Partition Table/How to find partition boundaries

4. Intel 810 Chipset

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

6. remote printer won't print non plain text print jobs.

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

8. Problems with /dev/video0

9. resize ext2 partition without losing data?

10. ext2 partition resize & ext2 in boot manager

11. find a word in Linux ext2 partition.

12. find without the "find: cannot read dir /usr/lost+found: Permission denied"

13. trying to find lost linux partition