Mounting raw disk backup file.
Michael Sierchio
kudzu at tenebras.com
Mon Aug 6 06:28:52 UTC 2012
On Sun, Aug 5, 2012 at 11:12 PM, Matthew Navarre
<navarre.matthew at gmail.com>wrote:
> I had a drive fail recently, it was working fine until I rebooted. After
> that the partition map was corrupt and I can't mount either partition on
> the disk. So I made a copy of the whole disk using dd to an old USB drive.
> There were several IO errors while dd was copying the disk, so I think the
> disk is starting to go.
>
> I can probably fix the partition table using testdisk, but now that I've
> got this image file I'd rather work with that instead of the physical disk.
> I've read the Handbook section on using mdconfig, but that assumes the
> image file is of a filesystem, not a whole disk. I think I've
> found instructions for how to do it on linux, but if there's a way to mount
> it on FreeBSD I'd rather do that.
>
> So, any suggestions?
>
> Here's what file says about the file:
> mnavarre at pcbsd-1810] /# file /mnt/ada1_backup
> /mnt/ada1_backup: x86 boot sector; partition 1: ID=0xa5, active, starthead
> 1, startsector 63, 167766732 sectors; partition 2: ID=0xa5, starthead 254,
> startsector 167766795, 144809910 sectors, code offset 0x3c, BSD disklabel
>
>
Why did you put it in /mnt? That's customarily used for mounting
fileystems. Move it ;-)
mdconfig -a -t vnode -f /new-path/ada1_backup
note the device that's created (probably md0)
you can then operate on /dev/md0 as if it were a disk. In particular, you
might want to fix the partition map, the label info, etc. You can then
fsck the filesystem (presumably something like /dev/md0s1a or /dev/md0a
etc).
You'll probably need to tell fsck that it's ufs (i.e. fsck -t ufs /dev/md0a
)
you can then mount the fs (mount -t ufs /dev/md0a /mnt )
- M
More information about the freebsd-questions
mailing list