Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 1997 11:58:04 +0200 (MET DST)
From:      Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
To:        kkenn@bns.com.au (Kris Kennaway)
Cc:        questions@freebsd.org
Subject:   Re: Corrupted swapspace
Message-ID:  <199704060958.LAA00798@helbig.informatik.ba-stuttgart.de>
In-Reply-To: <199704060322.MAA22496@topdown.bns.com.au> from Kris Kennaway at "Apr 6, 97 12:52:57 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> I've just been playing around with my hard disk partitions (resized the 
> primary DOS partition on my first hard drive using partition magic and 
> changed the cluster size), which is the only thing I can think of that 
> was actually changed in the meantime. I added another FreeBSD partition 
> on a second drive and moved around some directories, but I can't think 
> how that could have caused the problem below:
> 
> The FreeBSD swap space on my first hard drive seems to be corrupt: this 
> is what disklabel -r /wd0s2a makes of it:
> 
> [morden] 11:55 ~ disklabel -r /dev/wd0s2a
> # /dev/wd0s2a:
> type: ESDI
> disk: wd0s2
> label:
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 64
> sectors/cylinder: 4032
> cylinders: 354
> sectors/unit: 1427328
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # milliseconds
> track-to-track seek: 0  # milliseconds
> drivedata: 0
> 
> 8 partitions:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:    65536        0    4.2BSD        0     0     0   # (Cyl.    0 - 16*)
>   b:    88256    65536      swap                        # (Cyl.   16*- 38*)
>   c:  1427328        0    unused        0     0         # (Cyl.    0 - 353)
>   e:    61440   153792    4.2BSD        0     0     0   # (Cyl.   38*- 53*)
>   f:  1212096   215232    4.2BSD        0     0     0   # (Cyl.   53*- 353*)
> 
> [morden] 11:57 ~ disklabel -r /dev/wd0s2b
                                     ^ rwd0s2b
> Bad pack magic number (label is damaged, or pack is unlabeled)

That is ok, the swap partition does not have a disklabel, only the slice
has, e. g. 

disklabel -r /dev/rwd0s2

is the disklabel for the second slice.

BTW use raw devices as argument for disklabel(8). I know, disklabel(8) tries
to be smart and will automagically include the "r", but this "feature"
breaks my golden rule:

Use a raw device argument for fstab(8), disklabel(8), newfs(8).
Use the block device for mount(8).

> 
> By contrast, disklabel -r on my other swap partition on the second hard 
> drive correctly gives me the disklabel summary for the drive.
> 
That is strange! I think your second drive is not o. k.

> By rights, I should have 88M total swap with these two partitions, but 
                           ^^^
You have already 88M on your first swap partition, so the total should
be greater.

> top was reporting it as 133M total. Presumably as a consequence, my 
> processes kept on dying with signal 10 and 11 (I'm assuming this is what 
> hapened when they tried to enter the phantom swap-space). I've removed 
> the first swapon entry from fstab and it seems to be working fine so far.
> 

Use pstat -s to see what the systems thinks it should use as swap space
and compare to what you think it should use.

Good luck

Wolfgang



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704060958.LAA00798>