SUMMARY: Can you have swap partitions starting at cylinder 0?

From: Chris Metcalf (metcalf@catfish.LCS.MIT.EDU)
Date: Wed Jan 08 1992 - 19:41:06 CST


In article <21281@life.ai.mit.edu> I wrote:
>My understanding has always been that
>if you had a swap partition at the beginning of a disk, you would
>eventually get your disk label (and partition info) swapped on, and die
>horribly, so I've always avoided this configuration.

It turns out that since SunOS 4.0 (at least), swapping has been handled
carefully by the kernel: the first block of every partition is
skipped, so it's no longer possible to clobber the label. (However,
if you use cylinder zero as a raw device, e.g. for a database, it *is*
still possible to wipe out the label.)

The following piece of kernel comment from swap_init() bears this out:

    /*
     * To prevent swap I/O requests from crossing the boundary
     * between swap areas, we erect a "fence" between areas by
     * not allowing the first page of each swap area to be used.
     * (This also prevents us from scribbling on the disk label
     * if the swap partition is the first partition on the disk.)
     * This may not be strictly necessary, since swap_blksize also
     * prevents requests from crossing the boundary.
     */

Thanks to the following for sending me facts (and opinions):

        Tad Guy <tadguy@ab00.larc.nasa.gov>
        dupuy@hudson.cs.columbia.edu (Alexander Dupuy)
        Thomas Weihrich <Thomas.Weihrich@arbi.informatik.uni-oldenburg.de>
        essick@i88.isc.com (Raymond Essick)
        chinson@cs.ucla.edu (Chinson Yi)
        Mike.Sullivan@ebay.sun.com (Mike Sullivan { Nowhere Man })

-- 
			Chris Metcalf, MIT Laboratory for Computer Science
			metcalf@catfish.lcs.mit.edu // (617) 253-7766



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:33 CDT