*BSD News Article 5649


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!spool.mu.edu!umn.edu!noc.msc.net!uc.msc.edu!shamash!runyon.cim.cdc.com!pbd
From: pbd@runyon.cim.cdc.com (Paul Dokas)
Newsgroups: comp.unix.bsd
Subject: BEWARE:  stupid placement of swap space...
Keywords: (or:  Don't be stupid like me :-)
Message-ID: <47897@shamash.cdc.com>
Date: 25 Sep 92 14:24:58 GMT
Sender: news@shamash.cdc.com
Organization: ICEM Systems, Inc.
Lines: 42

Just a word of caution to anyone who installs swap space on extra
disk drives.  I learned this the hard way and don't want anyone
to be as stupid as I am ;-)

I borrowed a 1.0GB SCSI drive so that I could build X11R5 and have some
extra swap space.  But when I disklabeled the drive, I put partition
b (swap) in cylinders 0-19 and gave the rest to partition a.  I am also
running with Julian's SCSI subsystem (it's amazing!).  After about
2-3 hours of compiling X11R5, my machine would start giving "sd1: timeout"
errors and nothing but a reboot would bring back my filesystem.  Also,
after rebooting, my swap space would NOT come back.  swapon -a complained
about /dev/sd1b not being configured.

I originally thought that I might be having SCSI cable length problems.
But the solution turned out to be:

    1) repartitioning the 1.0GB drive so that partition a (ufs) came
       first.  The swap space is now at the end of the drive.
    2) adding "swap on sd1" to my kernel's configuration file and
       rebuilding the kernel.

Everything is now fine.  By the way, the reason for not putting swap
first was given to me by a gentleman from Germany (sorry I've forgotten
your name :-(  It turns out that the first few sectors of a SCSI drive
are used for partition information.  A filesystem will not use the first
few sectors of it's partition (knowing about the reserved blocks).  But
a swap space will eventually overwrite the partition information,  thus
causing strange things to happen.

BTW, I've now got X11R5 built with PEX and the Type1 stuff.  If anyone is
in need of something (object, executable or source) from this, just drop
me an email and I'll do what I can for you.  Please understand that I'm
doing this from work and that company business MUST come first.  I will
try to respond as fast as I can to any reasonable request, please be
patient.  Also, don't even think of asking for me to email the entire
source or executables.  If there is enough demand for this, then I will
try to place it in an anon-ftp server.
-- 
#include <std.disclaimer>
#define FULL_NAME                          "Paul Dokas"
#define EMAIL                              "pbd@runyon.cim.cdc.com"
/* we are realizing infinite possibilities in exchange for our soul */