Greg Thomas writes:
> I just ran through a fresh 7.3 install onto sd0 on an old 6.8 laptop and I
> have no idea what happened to the disklabel on sd1 (during the install I
> only did an automatic disklabel on sd0).  This is just a backup of my
> current laptop so not the end of the world (unless my current laptop dies
> before I have a chance to back it up again).

Part of the solution I used previously to recover my trashed disklabel
was a script to create a partition on the disklabel with every
starting value (a simple brute force approach). This proved to be
far too slow so I resorted to hacking scan_ffs but that's because
I had other partitions and swap of unknown size to skip over first
to find the /var/backup partition that I needed.

Since your lost partition is at the beginning of the disc somewhere
this shouldn't be much of a problem. The end sector doesn't really
matter if you'll mount the partition read-only provided it's large
enough; just don't run fsck on it.

Something along the lines of:

        for k in `jot 2048`; do echo <blah> | disklabel -e sd0; mount -r 
/dev/sd1a /mnt && echo $k; umount /mnt; done

Where <blah> is multi-line input to disklabel to delete and create
partition a. Alternatively investigate disklabel's -R option.

Then locate your disklabel backup, investigate -R if you didn't
already, and restore it exactly.

Matthew

Reply via email to