Subject: Re: kern/22774: there is no way to swapctl -a to a wrongly typed partition
To: None <tv@pobox.com>
From: Simon Burge <simonb@wasabisystems.com>
List: netbsd-bugs
Date: 09/15/2003 01:03:13
tv@pobox.com wrote:

> >Number:         22774
> >Category:       kern
> >Synopsis:       there is no way to swapctl -a to a wrongly typed partition

> [ ... ]  Problem is, the faked disklabel cannot be written to the disk,
> since swap does not typically leave the disklabel space alone at the start
> of the disk (unlike ffs).

This isn't true.  See the comments in uvm_swap.c:

	 * for block special files, we want to make sure that leave
	 * the disklabel and bootblocks alone, so we arrange to skip
	 * over them (arbitrarily choosing to skip PAGE_SIZE bytes).
	 * note that because of this the "size" can be less than the
	 * actual number of blocks on the device.

The raid1 set that I swap on is set up so that the swap partition
starts at the start of the "disk":

4 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 b:   4194176         0       swap                      # (Cyl.    0 - 4095*)
 c:   4194176         0     4.2BSD      0     0     0   # (Cyl.    0 - 4095*)
 d:   4194176         0     4.2BSD      0     0     0   # (Cyl.    0 - 4095*)

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/