HD crash. Normally I wouldn't care, but it looks like I missed a spot in my backup plan: my MySQL DB, web root, and SCM repo are on the drive with no copy anywhere else. Time to break out the usual tools and see what has survived.

Now, I need to get that data off the image. If possible, I'd like to rebuild / recover the partition table, and then mount it (loopback), and then scp the important data to another machine for safekeeping.
But the next step eludes me: I now have a disk image, but neither fdisk nor gpart want to tell me about it. In fact it doesn't seem to want to operate on anything but a (real) disk device, out in /dev somewhere.
What am I missing? BTW here is output from fdisk on the "real" ada1 drive:
And for gpart:
In any case, given this info, I should have enough to mount it, right?
- Insert FreeBSD 9.0 net-install CD
- Make a fakeroot to install pkg_add stuff,
mkdir /tmp/fakeroot
- Get ddrescue
cd /tmp/fakeroot
pkg_add -P `pwd` -r ddrescue
- Mount second hard drive to store disk image
mkdir -p mnt/nas
mount -t ufs /dev/ada0s1d mnt/nas
- Begin the rescue operation
cd bin
./ddrescue -R --max-retries=3 /dev/ada1 ../mnt/nas/ada1.bin ../mnt/nas/ada1.log
- (wait 4 hours)

Now, I need to get that data off the image. If possible, I'd like to rebuild / recover the partition table, and then mount it (loopback), and then scp the important data to another machine for safekeeping.
But the next step eludes me: I now have a disk image, but neither fdisk nor gpart want to tell me about it. In fact it doesn't seem to want to operate on anything but a (real) disk device, out in /dev somewhere.
Code:
> fdisk ./ada1.bin
fdisk: unable to get correct path for ./ada1.bin: Inappropriate file type or format
What am I missing? BTW here is output from fdisk on the "real" ada1 drive:
Code:
*** Working on device /dev/ada1 ***
parameters extracted from in-core disklabel are:
cylinders=79656 heads=16 sectors/track=63 (1008 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=79656 heads=16 sectors/track=63 (1008 blks/cyl)
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 238 (0xee),(EFI GPT)
start 1, size 80293247 (39205 Meg), flag 80 (Active)
beg: cyl 0/ head 0/ sector 2;
end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
And for gpart:
Code:
gpart show /dev/ada1
=> 34 80293181 ada1 GPT (38G)
34 128 1 freebsd-boot (64k)
162 75497344 2 freebsd-ufs (36G)
75497506 4014080 3 freebsd-swap (1.9G)
79511586 781629 - free - (381M)
In any case, given this info, I should have enough to mount it, right?