Solved How to properly mount a bootable .bin file?

Greetings, all!
OK. I've got a bin file. Initially, I thought I could mount() it, by simply performing the following:
Code:
mdconfig -a -t vnode -f ./my.bin -u 0
mount /dev/md0 /mnt
But that only returned:
Code:
mount: /dev/md0: Invalid argument
Meaning; It wasn't a readily recognizable filesystem.
So I ran file() against it, to get a better picture of exactly what I was working with. This returned:
Code:
x86 boot sector; partition 4: ID=0xa5, active, starthead 0, startsector 0, 50000 sectors, code offset 0x3c, BSD disklabel
OK. It's a bootable FreeBSD filesystem. While I should, I don't know how I might properly convert this new found knowledge into a mountable object, on my system. That I can investigate, or modify.
Anyone care to share some thoughts on how I might accomplish this (mdconfig(), mount(), ...)?
Thanks!

--Chris
 
Use mdconfig(8) as you have, to get the image visible as a disk device. Then mount the partitions from there, md0p1 or md0s1a or whatever. Or you can use gpart show to see the offsets of the partitions from the beginning of the device, then unmount the device and use gnop(8) to skip over the initial data to the start of the partition and mount that. There is an example at the end of the mdconfig(8) man page.
 
Use mdconfig(8) as you have, to get the image visible as a disk device. Then mount the partitions from there, md0p1 or md0s1a or whatever. Or you can use gpart show to see the offsets of the partitions from the beginning of the device, then unmount the device and use gnop(8) to skip over the initial data to the start of the partition and mount that. There is an example at the end of the mdconfig(8) man page.
Thanks wblock!
Yes, I saw the example. But wasn't sure exactly how to apply it to my current situation. I think you've given me the tools to work it out, now.

Thanks, again!

--Chris
 
HAH! That gets it!
gpart show -p /dev/md0 reveals:
Code:
=>  0  80000  md0  BSD  (39M)
  0  16  - free -  (8.0k)
  16  79984  md0a  !0  (39M)
Followed by: mount /dev/md0a /mnt. Provides access to the entire disk (save the boot sector).
Thanks again, Warren. How did I know that you would be the one to know this. :)

All the best.


--Chris
 
Back
Top