On 4/24/07, Jan Stary <[EMAIL PROTECTED]> wrote:
Hello list,
I am trying to share swap between OpenBSD 4.0/i386 and FreeBSD,
on a Dell laptop. I have sliced the disk as
The FreeBSD installation lives in 'ad0s1a' (the first and only
partition within the FreeBSD slice), and uses 'ad0s3b' (the only
partition within the third slice) as its swap.
The OpenBSD installation lives in 'wd0a', and I don't know how to make
it use the third partition as the swap. How do I even refer to the
pieces of disk which lie outside the OpenBSD slice? I only see
/dev/wd0? and /dev/rwd0? under /dev - which of them would possibly be
the other slices? Isn't 'wd0' just the OpenBSD portion of the disk
(ie, slice 1 in the above fdisk output)?
/dev/r* are 'raw' devices, corresponding to the non-raw devices. They
both access the same hardware.
The letterings after /dev/wd0* are defined by the disklabel which the
kernel reads on boot up--they are entirely up to you, except that 'a'
is always /, 'b' is always swap, and 'c' is always the entire disk.
See the FAQ: http://www.openbsd.org/faq/faq14.html#disklabel
Thus, converting between what you see in `fdisk wd0` and what is
actually in /dev is complex, and depends on your disklabel. It sounds
like you might have set wd0's first DOS partition to correspond to
/dev/wd0a; this will cause extra headaches but it's not unworkable.
I came accross an old message
http://openbsd.monkey.org/misc/199803/msg00085.html
[...]
Is it really neccessary to have the swap partition on a separate disk
to share it with other systems?
No, it just makes it simpler. For you, you'll want to look into
fdisk's 'b' command. Use 'b' to extend OpenBSD's idea of its disk
boundaries to cover the entire disk, and then just add the swap
partition ("a b") and set its boundaries to
38796030..(38796030+274050) (but be very very very careful about your
calculations when you do this!). I don't know how to do the same in
FreeBSD, but there should be a way, because the trick is that these
numbers are absolute--from the start of the disk--so all OSes agree on
them.