Discussion:
mounting OpenBSD partition
(too old to reply)
Matthias Apitz
2016-07-13 07:42:05 UTC
Permalink
Hello,

I was in need to investigate some hardware / driver issue and made an OpenBSD
bootable USB key. The creation and installation of this is pretty much
simple and fast. Based on an image install59.ff (some 290 MByte) after a
few minutes you have a running system on the disk or in my case on some
other USB key of 15 GByte which even contains already X11 (just login
and says 'startx'). Just do installation to sd1 (sd0 is the harddisk in your
laptop). Nice.

What is interesting for me as FreeBSD user is, that you can mount parts
of the OpenBSD file system to our FreeBSD; the layout is:

# fdisk da0

******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=1915 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1915 heads=255 sectors/track=63 (16065 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:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
sysid 166 (0xa6),(OpenBSD)
start 64, size 30764411 (15021 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 2;
end: cyl 1023/ head 254/ sector 63

and we have the following devices in FreeBSD after plug-in:

# ls -l /dev/da*

crw-r----- 1 root operator 0x74 jul. 13 07:44 /dev/da0
crw-r----- 1 root operator 0x75 jul. 13 07:44 /dev/da0s4
crw-r----- 1 root operator 0x77 jul. 13 09:38 /dev/da0s4a
crw-r----- 1 root operator 0x78 jul. 13 09:38 /dev/da0s4b
crw-r----- 1 root operator 0x79 jul. 13 09:38 /dev/da0s4d
crw-r----- 1 root operator 0x7a jul. 13 09:38 /dev/da0s4e
crw-r----- 1 root operator 0x7b jul. 13 09:38 /dev/da0s4f
crw-r----- 1 root operator 0x7c jul. 13 09:38 /dev/da0s4g
crw-r----- 1 root operator 0x7d jul. 13 09:38 /dev/da0s4h
crw-r----- 1 root operator 0x7e jul. 13 09:38 /dev/da0s4i
crw-r----- 1 root operator 0x7f jul. 13 09:38 /dev/da0s4j
crw-r----- 1 root operator 0x80 jul. 13 09:38 /dev/da0s4k

The device /dev/da0s4 is normal UFS mountable and seems to contain the
root file system. I found no way to get further access, for example to
/home, ...

HIH

matthias
--
Matthias Apitz, ✉ ***@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045
"Wer übersieht, dass wir uns den anderen weggenommen haben und sie uns wiederhaben wollen,
kann von den Kämpfen der letzten Tage keinen verstehen. Und kann natürlich auch keinen
dieser Kämpfe bestehen." Hermann Kant in jW 1.10.1989
Polytropon
2016-07-13 09:25:14 UTC
Permalink
Post by Matthias Apitz
What is interesting for me as FreeBSD user is, that you can mount parts
# fdisk da0
******* Working on device /dev/da0 *******
cylinders=1915 heads=255 sectors/track=63 (16065 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
cylinders=1915 heads=255 sectors/track=63 (16065 blks/cyl)
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
<UNUSED>
<UNUSED>
<UNUSED>
sysid 166 (0xa6),(OpenBSD)
start 64, size 30764411 (15021 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 2;
end: cyl 1023/ head 254/ sector 63
# ls -l /dev/da*
crw-r----- 1 root operator 0x74 jul. 13 07:44 /dev/da0
crw-r----- 1 root operator 0x75 jul. 13 07:44 /dev/da0s4
crw-r----- 1 root operator 0x77 jul. 13 09:38 /dev/da0s4a
crw-r----- 1 root operator 0x78 jul. 13 09:38 /dev/da0s4b
crw-r----- 1 root operator 0x79 jul. 13 09:38 /dev/da0s4d
crw-r----- 1 root operator 0x7a jul. 13 09:38 /dev/da0s4e
crw-r----- 1 root operator 0x7b jul. 13 09:38 /dev/da0s4f
crw-r----- 1 root operator 0x7c jul. 13 09:38 /dev/da0s4g
crw-r----- 1 root operator 0x7d jul. 13 09:38 /dev/da0s4h
crw-r----- 1 root operator 0x7e jul. 13 09:38 /dev/da0s4i
crw-r----- 1 root operator 0x7f jul. 13 09:38 /dev/da0s4j
crw-r----- 1 root operator 0x80 jul. 13 09:38 /dev/da0s4k
The device /dev/da0s4 is normal UFS mountable and seems to contain the
root file system. I found no way to get further access, for example to
/home, ...
OpenBSD uses a partitioner similar to FreeBSD's bsdlabel (disklabel).
The device /dev/da0s4 (4th slice) equals /dev/da0s4c and mounts the
whole slice. This is strange, as the mountable partitions should be
/dev/da0s4[adefghijk]; /dev/da0s4a being the root partition, and
/dev/da0s4b is the swap partition. But I'm not fully sure the different
partitioning is 100% compatible...

Can you check the output of "mount -v" on OpenBSD, as well as
"disklabel da0s4" on FreeBSD? Additionally, what does "file -s <FS>"
say for those files?
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Loading...