CFT: rc.d/mdconfig{,2} - ramdisk rc.d script extension to support all md(4) devices

Florent Thoumie flz at FreeBSD.org
Sat May 13 05:36:39 PDT 2006


These scripts are supposed to extend the existing ramdisk rc.d script to
vnode-backed md(4) devices. I added some features as well (mostly
proposed by Anders).

Malloc/Swap md(4) devices are created by mdconfig (as early as possible).
Vnode md(4) devices created from files located on root partition are
created by mdconfig. The others md(4) devices are created by mdconfig2.

Assuming there's an fstab entry for the md(4) device, they'll be fsck'ed
 (if !swap/malloc) or newfs'ed and mounted.

Use as follows :

mdconfig_md0="-t malloc -s 10m" -> created by mdconfig
mdconfig_md1="-t swap -s 5m" -> created by mdconfig
mdconfig_md2="-t vnode -f /boot/foo.img" -> created by mdconfig
mdconfig_md3="-t vnode -f /boot/foo.uzip" -> created by mdconfig
mdconfig_md4="-t vnode -f /usr/local/test.img" -> created by mdconfig2
mdconfig_md6="this one won't work since there's no mdconfig_md5"

Additionally you can use the following options :

mdconfig_mdX_owner, mdconfig_mdX_perms -> perms and owner changed by
mdconfig2
mdconfig_mdX_newfs -> additional flags to pass to newfs for malloc/swap
backed md(4) device
mdconfig_mdX_files -> files to copy to the mounted mdX device by mdconfig2
mdconfig_mdX_cmd -> command run to populate the mounted mdX device by
mdconfig2 (note that it's passed to eval, so you can use \${_mp} and
\${_dev} to reference both the device and the mount point.

There's currently no doc, I'll do it while people (you readers) are
testing them. I might have forgotten to say something, so ask just in
case you need some other information.

Scripts are here:

http://people.freebsd.org/~flz/local/mdconfig
http://people.freebsd.org/~flz/local/mdconfig2

You'll need the additional patch to rc.subr as well:

http://people.freebsd.org/~flz/local/rcsubr-seq.diff

-- 
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20060513/4024ef04/signature.pgp


More information about the freebsd-rc mailing list