SUMMARY: swap on partition A ???

From: <"Dave>
Date: Fri, 27 Oct 1995 16:49:00 EDT

Followup-To: poster
Precedence: bulk
Original question:

Is there any danger of overwriting the disklabel if I use partition A for swap?

Thanks to all who replied:

jmh_at_rto.dec.com (Jan Mark Holzer) Shen Bing Shiung <b.shen_at_qut.edu.au>
joe_at_resptk.bhp.com.au olle_at_cb.uu.se (Olle Eriksson)
Hellebo Knut <Knut.Hellebo_at_nho.hydro.com>
David Warren <warren_at_atmos.washington.edu>
"Paul E. Rockwell" <rockwell_at_rch.dec.com>
Pat Huber <pat_at_krl.caltech.edu> <swatson_at_ultrix6.cs.csubak.edu>
Anthony D'Atri <aad_at_nwnet.net> David R Courtade <drc_at_amherst.com>
gaich_at_Sales.TGV.COM (Dragan Gaich) Mike Matthews, Mike_Matthews_at_sgate.com
Anne Henderson <a.henderson_at_dem.csiro.au>
"Bernt Christandl" <beb_at_rosat.mpe-garching.mpg.de>
<shollen_at_valhalla.cs.wright.edu>
Tom Blinn <tpb_at_zk3.dec.com>

Answer:

The overwhelming majority of people advised me to NOT use partition A for swap,
because:

    The disklabel is written to block 0 of the disk. The default partiton A
    begins at block 0, so there is a real danger that the swap space will
    overwrite the disk partition, and you won't be able to mount any filesystems
    on that disk. This may not happen for a long time, but the general
    consensus was is that it will eventually, particularly when swap space is
    heavily used.

    ( I received definite confirmations of this problem from people using
      SunOS 4.0 and ULTRIX, but no one was absolutely sure about Digital Unix.)

---------------------
      Quoting Sean Watson:
      At least under Ultrix, there was a message a while back about a swap
partition which uses block 0 of a disk overwritting the partition table. As I
understand it, a filesystem puts its superblock at block 0 when it is used on
such a partition and knows to build it "around" the partition table. The
kernel's pager (which reads/writes virtual memory to and from the swap
partitions) in Ultrix wasn't smart enough to avoid the partition table.
---------------------
      and Anne Henderson:
NEVER put swap partitions, or partitions that are to be used as raw devices,
at the start of the disk. Always have filesystems or unused buffer zones.
---------------------
      and Olle Eriksson:
You can use the whole disk (ie the c partition) as swapspace without any
a-partition because in that case it doesn't matter that the disk is un-labeled.
---------------------
Other solutions included making a small A partition (a few blocks) and using
partition B for swap; or, just make sure that your swap partition does not
start at block 0, but some later block (is block 1 safe?).
---------------------
One alternate solution, from Paul E. Rockwell:
Another idea is to put the disk under the control of LSM (if you're already
running LSM, that is), create a volume
for non-file system use, and set up secondary swap to that volume.
Yes, you can do this (see the LSM documentation for particulars). That way
you don't worry about the disk label, and you don't lose that much in
performance. You can also do stuff like mirror the swap, move it to another
disk (if the original is going bad), resize it, etc...
---------------------

-Dave Wolinski, University of Michigan Physics
Received on Fri Oct 27 1995 - 22:25:36 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT