Subject: Re: Share swap partition between NetBSD & Linux?
To: Thomas Mueller <>
From: Richard Rauch <>
List: netbsd-users
Date: 01/04/2001 05:05:23
 /~~~ Thomas Mueller

Is there any way to make NetBSD use a Linux swap partition, or make Linux
use a NetBSD swap partition?  I am mainly interested in i386, though this
question might be relevant to other platforms too.  Linux swap partition
is type 82 (hexadecimal).

 \___ Thomas Mueller

For non-i386 platforms, the following disklabel suggestion might
work.  The ``BIOS-level partition'' suggestion is probably more or less
i386-specific, but might have workable analogues on other systems.

As I understand it, GNU/LINUX may actually require a BIOS-level partition
for swapping.  So you may not be able to simply configure GNU/LINUX to
swap to the area that is already set aside in a normal NetBSD install for
NetBSD swapping.

Fortunately, NetBSD's swap partition on a drive is designated by a
disklabel.  I know that you _can_ use disklabel to access filesystems that
are outside of the NetBSD section (usually a single BIOS-level
partition) of your disk.

You can probably edit the NetBSD swap disklabel entry to use any arbitrary
slice of your disk, which should let you share swap space between the two.

(Of course, if you do this _after_ a normal NetBSD install, you will end
up with an unused section in the middle of your NetBSD area.  You could
stick a further filesystem on that, of course...)

You could also (probably) get GNU/LINUX to use a previously-established
NetBSD swap by constructing a BIOS-level partition to overlay your NetBSD
swap area.  Somehow that seems a bit yuckier than what I suggested doing
with the disklabel above.

See disklabel(8) for information about fiddling with your disklabel.  
fdisk(8) should cover BIOS-level partitions.

Good luck.  (^&

  "I probably don't know what I'm talking about."