During the past week, I've been tracking -STABLE (daily) & -CURRENT (about
2 days out of 3) on a new laptop.  (More stuff about that in the recent
-mobile archives, for folks who might have an interest.)

Although I realize that there are significant differences between the
FreeBSD mfs vs. the Sun tmpfs, using an mfs-based, swap-backed /tmp has
generally been working well for me over the last 3 years of using FreeBSD.
(I tend to be generous with swap diskspace allocations, which helps.)

And on this laptop, I have 3 different bootable "root" (& associated /usr)
partitions, so I can run -CURRENT, as well as run either of a couple of
-STABLEs.  But since I'm running no more than one at a time, it made sense
to me to have the swap space be common to all three environments, and to
make /tmp be swap-backed.

In -STABLE, I merely stuffed an appropriate entry in /etc/fstab, and It
Just Worked.  However, based on the example in the mdconfig man page on
-CURRENT, I get the impression that the process is a little more

Accordingly, I created the following shell script to accomplish a
similar objective, based upon the above-mentioned example in the
mdconfig man page.  At present, I have it sitting in
/usr/local/etc/rc.d, which isn't ideal, but I wanted to find out if
anyone had better approaches for doing this, suggestions for
improvement, or arguments that what I'm trying to do is misguided and
shouldn't be done:


size=512M       # Plugged directly in to the mdconfig command,
                # so use an expression that's compatible with that.

case "$1" in
        # Taken from the mdconfig man page, then lightly hacked:
        #     To create and mount a 128MByte swap backed filesystem on /tmp:
        if [ -x /sbin/mdconfig ]; then
                /sbin/mdconfig -a -t swap -s $size -u 10 && \
                /sbin/disklabel -r -w md10 auto && \
                /sbin/newfs /dev/md10c && \
                /sbin/tunefs -n enable /dev/md10c && \
                /sbin/mount /dev/md10c /tmp && \
                /bin/chmod 1777 /tmp && \
                exit 0
        dev=`/sbin/mount | /usr/bin/awk '/ \/tmp / {print $1}'` || exit 1
        /sbin/umount /tmp && [ -c $dev ] && /sbin/mdconfig -d -u $dev
        exit 0
        echo "Usage: `basename $0` {start|stop}" >&2

exit 2

David H. Wolfskill                              [EMAIL PROTECTED]
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to