Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Sep 1995 10:02:26 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Cc:        leisner@sdsp.mc.xerox.com
Subject:   Re: can swap space be shared with other OSes?
Message-ID:  <199509010802.KAA03027@uriah.heep.sax.de>
In-Reply-To: <199508312321.QAA01188@ref.tfs.com> from "Julian Elischer" at Aug 31, 95 04:21:42 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Julian Elischer wrote:
> 
> > I believe a similar scheme would work for an unknown partition ID, for
> > instance the Linux swap -- assuming each DOS partition gets a logical
> > device regardless of whether we recognize the ID or not.  This is
> > something that should be done if it hasn't been already.
> I believe it will work..
> swapon /dev/sd0s3 would swap onto the 3rd slice...
> if that was the linux swap slice.....

It doesn't.  See my recent discussion about this topic in -current.
(Reminder: i've bought an second-hand disk for my notebook, and it
came with an installed Linux from the previous owner, which i decided
to keep.)

Either Linux as FreeBSD insist on finding some `magic' on the slice
they're using as swap area.  For Linux, this is arranged by the Linux
swap slice ID (0x81?) and the `mkswap' command, while FreeBSD requires
a 0xa5 slice ID and a correct disklabel (that should cover the entire
slice, and have a `b' partition also using the entire slice).

So by now i use some hackery inside /etc/rc that runs fdisk and mkswap
whenever Linux is about to be booted, and fdisk plus disklabel for
FreeBSD.  Needless to say, the slice must be behind the FreeBSD root
(and /usr, for that matter) slice, since FreeBSD's boot loader does
only boot off the ``compatibility slice'', i.e. the first 0xa5 slice
found in the fdisk table.  (Only the order in the fdisk table is
important, the order on the disk is irrelevant.)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509010802.KAA03027>