Jan Stary 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 Disk: wd0 geometry: 41344/15/63 [39070080 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: A5 0 1 1 - 22191 14 63 [ 63: 20971377 ] FreeBSD *1: A6 22192 0 1 - 39944 14 63 [ 20971440: 16776585 ] OpenBSD 2: 82 39945 0 1 - 41053 14 63 [ 37748025: 1048005 ] OpenBSD 3: 82 41054 0 1 - 41343 14 63 [ 38796030: 274050 ] OpenBSD and I try to make both systems use partiton 3 as their swap. (The type of 'OpenBSD' = a6 for slices 2 and 3 is arbitrary - one will just be the swap, the last one is for suspend/hibernation and my FS experiments.)
I'm not sure this is really recommended. I *think* that each "slice" gets its own disklabel, and only one disklabel per disk is used. I'd use only one 'OpenBSD' partition.
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)?
No. wd0 (or rather wd0c) is the entire disk. Use disklabel -E wd0 and copy the "slice" boundaries into your disklabel, preferrably as wd0b, which will then be used as swap by default. You'll probably have to use the 'b' command in disklabel(8)'s interactive mode to do this. The slices you refer to is, after boot, not really used by OpenBSD. You should read up on fdisk and disklabel on OpenBSD. fdisk(8) disklabel(5) disklabel(8) DISCLAIMER: I have no idea how stuff works on FreeBSD. Some OS's require a "formatted" swap etc. And, of course, I take no responsability for any of this. :) (And if/where I'm wrong, I'd appreciate cluesticks).
Is it really neccessary to have the swap partition on a separate disk to share it with other systems?
From an OpenBSD point of view, I very much doubt it.
/Alexander

