Hi there,
today I received a very interesting mail from Marco Luchini as a
followup to Tom Blinn's mail. He basically says you CAN use a
partition containing cylinder 0 as swap area.
Just read the little chat for yourself. It's worth it.
Bye
Hi,
I have had the following very intersting discussion with Tom. I think
it would be very useful if the fact that DU does not in fact overwrite
the disklabel if one swaps to a partition starting at cylinder 0
became public knowledge, since almost everybody on the list thinks
that it does. Tom thinks it would be most appropriate if you were to
post a followup as the original poster, since he been criticised for
posting proactively.
Ciao, Marco
------- Start of forwarded message -------
From: "Dr. Tom Blinn, 603-881-0646" <tpb_at_zk3.dec.com>
To: Dr Marco Luchini <m.luchini_at_ic.ac.uk>
Subject: Re: SUMMARY: Partitions
Date: Thu, 05 Sep 96 09:20:35 -0400
> Hi,
>
> In your reply to Juergen Bock <FDV20_24_at_dbf-s1.dbf.ddb.de>, you
> said:
>
> } If you intend to use the "b" partition for swapping, it's a good
> } idea to not have it begin right at the beginning of the disk,
> } although the system software knows that the disk label will be in
> } a reserved location and will avoid over-writing it (which some
> } people don't understand -- at least, Digital UNIX is smarter than
> } that although some other UNIX implementations might not be). By
> } convention, the "c"
>
> Is this a new feature of the latest Digital Unix? The conventional
> wisdom is that you should never put swap onto the beginning of the
> disk to avoid wiping out the disklabel. I'm sure this has been
> repeated many times on this list. Have I been dreaming this?
It certainly is the conventional wisdom that you should not put swap
at the beginning of a disk because the vm subsystem would fail to
preserve the disk label. In fact, there is a section of code in the
vm_swap.c routine (which is where the swapping is implemented, for the
most part) that explicitly has the feature of making the first page of
any swap space unavailable for use by the swapping code. If the swap
area begins in cylinder zero of a disk, the first page is where the
disklabel would be. The comment in front of this section of code (and
the code itself) says this:
/*
* HACK ALERT ! This code makes the first page of the newly
created * swap space unavailable. This hack prevents the
system from * clobbering the disk label if a user does a
swapon to a disk * partition that contains block 0 of the
physical disk. * * In addition, allocating the first swap
cell makes swap mangagement * simpler. To determine if swap
is allocated for an anon it suffices * to check non-zero swap
offset. */
newsp->vs_free = maplong = newsp->vs_bitmap;
*maplong |= 1L;
newsp->vs_freespace--;
I can't say for certain just how long this has been in the product --
it is in the source, in various forms, since V2.0 at least, and I
suspect that is has been there since the beginning, but I can't find
the sources on line for anything before V2.0.
You are correct that there have been many statements to the list
saying that you have to avoid using cylinder 0 for swap, and it
certainly doesn't hurt to avoid putting swap at the beginning of the
disk, but you can put it there and the system software still avoids
(or should avoid) wiping out the disk label.
Tom
**********************************************************************
Die Deutsche Bibliothek Juergen Bock
Zeppelinallee 4-8 069-7566-735
60325 Frankfurt bock_at_dbf.ddb.de
**********************************************************************
Received on Fri Sep 06 1996 - 13:57:07 NZST