*BSD News Article 80663


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!news1.wtn.mci.net!newsfeed.internetmci.com!news.sgi.com!mr.net!uunet!news-in2.uu.net!EU.net!main.Germany.EU.net!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Linux and FreeBSD swap share?
Date: 12 Oct 1996 11:04:04 GMT
Organization: Private BSD site, Dresden
Lines: 62
Message-ID: <53ntv4$8ok@uriah.heep.sax.de>
References: <51rlp5$k5k@www.uno.edu> <R.3244BD69.2781E494@freebsd.org>
  <52jomt$8s@uriah.heep.sax.de> <53h5ed$nvc@newshost.lanl.gov>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E

hlu@retro.lanl.gov (Henry Lu) wrote:

> : No, it needs to get a BSD disklabel (with a `b' partition) before.
> : However, i've once proven that this can be done from inside the
> : /etc/rc scripts.

> Could You please post your solution here. I missed the previous post.

Sorry, i can't.  This machine is long since gone.  (I once got a disk
for my notebook with a pre-installed Linux, and i've played a little
with it.)

Basically, what you need is (assumes the shared swap is wd0s2 in
FreeBSD, i think this corresponds to hda2 in Linux):

In FreeBSD's /etc/rc, before the swapon command:

echo 'some
mystic
numbers
you
gotta
find
yourself
just
to
change
the
partition(slice)
type
to
0xa5' | fdisk wd0 > /dev/null

disklabel -w wd0s2 disktab-entry-for-this-slice

(This disktab entry defines the `b' and `c' partitions which are
identical except that `b' is marked as swap.  The offset is 0, and the
size is the entire slice size.)


In Linux, you needed (in that old version of Linux) something like:

Again, fdisk, to change the partition type to Linux Swap.

mkswapfile /dev/hda2 <number of blocks>


All this is from memory, so it's likely that i'm mistaken.  Since i
don't follow the Linux development, it's also possible that the
procedure there has changed now.  I'm pretty sure however that the
above should work for FreeBSD.  The `mystic numbers' for FreeBSD's
fdisk are easy to find: simply run fdisk manually, and change the
magic number of that slice to 0xa5.  Write down all the input you
needed (including plain newlines), and put them into that `echo'
statement.

-- 
cheers, J"org

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