Re: RECOVERY: partition table

Itai Nahshon (nahshon@actcom.co.il)
Sun, 11 Jul 1999 19:21:23 +0300 (EET DST)


That happened to me too. Instead of recreating the
partition table I was able to backup my Linux file
systems and then repartition the disk and
restore the stuff (There was also a FAT partition
but it did not contain anything worths saving. I took
this as an opportunity to get rid of it).

To do that I wrote a small program that reads the
disk and finds Ext2 "signatures". This is mainly the
magic number on the superblock (but this will find
all copies of the superblock!). Once that I had
the locations of the partitions, I could mount
the whole disk with options -o loop,offset=xxx
to get to any partition which starts at offsets
smaller than 2GB. A small hack (changing loop device
offsets to unsigned) made all the partitions in the
4 GB disk accessible for backup.

I suggest to change the offset field in the loop device
(lo_offset) to an loff_t (requires also change of API).

Itai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/