Subject: swap on cgd(4)
To: None <tech-kern@NetBSD.ORG>
From: Roland Dowdeswell <elric@imrryr.org>
List: tech-kern
Date: 04/17/2003 13:30:37
So,

I've an interesting issue with cgd(4) which has been brought to my
attention by Lubomir Sedlacik.  That is: if cgdconfig(8) configures
up a cgd with a randomkey then the device does not have a disklabel.
This is all good for ffs because the default disklabel has a default
type for the RAW_PART partition which is of type 4.2BSD but it
poses a problem for swapping.  I've thought of a few ways to solve
this issue and wanted to propose some of them for feedback.

The first way to deal with this that I thought of was to change
dk_size() [in sys/dev/dksubr.c] to return a size for the RAW_PART
of a disk which does not have an on-disk disklabel.  This would
allow you to directly swap to an unlabeled disk.

Another way to deal with it would be to populate the default
generated label with a `b' partition that is of type FS_SWAP and
consists of the entire disk.

Or we could modify cgdconfig(8) to put a disklabel on the disk
[optionally].

I'm leaning towards one of the first two methods because cgdconfig(8)
is starting to have too many options and abilities.

Anyway, though, comments?

Thanks,

--
    Roland Dowdeswell                      http://www.Imrryr.ORG/~elric/