Memory-based filesystems using md(4) Posted August 1, 2003
(FreeBSD 5)
This makes a 64-megabyte filesystem in swap space, mounted at /cache .
In /usr/local/etc/rc.d/md.sh ...
#!/bin/sh
echo -n ' md '
case "$1" in
start)
md=`mdconfig -a -t swap -s 64m`
newfs "/dev/$md"
mount /dev/$md /cache
;;
stop)
u=`mount|egrep '^/dev/md. on /cache'`
u=${u%% on *}
u=${u#/dev/md}
umount /cache
mdconfig -d -u "$u"
;;
esac
To start this automatically at boot time:
chmod +x /usr/local/etc/rc.d/md.sh
|