RFC: swapon(8) vnode-backed md and gbde/geli encryption support

Hiroki Sato hrs at FreeBSD.org
Sat Jun 22 18:56:39 UTC 2013


 I created a patchset to add support of automatic generation of
 vnode-backed md(4) devices and gbde/geli geom providers to swapon(8)
 via /etc/fstab.  We already have equivalent functionality by using
 rc.d scripts.  This simplifies rc.d scripts and fixes a race between
 mdconfig/gbde/geli and swapon/swapoff by using /etc/fstab.

 More specifically, the following specification will be supported:

 /dev/ada1p1.bde	none	swap	sw		0 0
 /dev/ada1p2.eli	none	swap	sw		0 0
 md	none	swap	sw,file=/swap.bin		0 0
 md10	none	swap	sw,file=/swap10.bin		0 0
 md12	none	swap	sw,file=/usr/swap12.bin,late	0 0

 Currently, rc.d/swap1, rc.d/encswap handles entries with FSTAB_SW and
 then rc.d/addswap for additional swap space specified in rc.conf.
 The rc.d/addswap script runs before NETWORKING, so it is difficult to
 add a swap space by using a file via NFS on a diskless client.  The
 "late" keyword in /etc/fstab will give more flexibility in such a

 So, the changes to rc.d scripts are the following:

  rc.d/encswap -> (removed)
  rc.d/swap1 -> rc.d/swap
  rc.d/swaplate -> (added)

 rc.d/addswap is not removed in the patchset, but is it still
 necessary?  I do not think using combination of rc.d scripts to
 support md(4) device generation for swap spaces is robust, and I
 believe /etc/fstab is sufficient for the same functionality.

 Any comments are welcome.  Thank you.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swap_20130622-1.diff
Type: text/x-patch
Size: 21126 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130623/77b24350/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130623/77b24350/attachment.sig>

More information about the freebsd-current mailing list