Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2001 13:05:25 +0900
From:      Makoto Matsushita <matusita@jp.freebsd.org>
To:        current@FreeBSD.org
Subject:   "swapfile" doesn't work if md driver is not pre-loaded
Message-ID:  <20011125130525B.matusita@jp.FreeBSD.org>

next in thread | raw e-mail | index | archive | help

In /etc/rc, there is a "swapfile" feature, to configure a file to use
swap device.  Here is a script for that.


# Add additional swapfile, if configured.
#
case ${swapfile} in
[Nn][Oo] | '')
	;;
*)
	if [ -w "${swapfile}" -a -c /dev/mdctl ]; then
		echo "Adding ${swapfile} as additional swap"
		mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev}
	fi
	;;
esac


In this shell script, checking that /dev/mdctl file is present as a
character device before configureing swap.  It seems there is no
problem, but it'll fail in some cases, such as:

* kernel doesn't have 'md' driver,
* loader doesn't load 'md' module, and
* /boot/${kernel}/md.ko is present.

If kernel doesn't know md, /dev/mdctl is not there, however, if md.ko
is available, mdconfig(8) loads the module, then configure md device
so "mdconfig && swapon" will success without any problem.

Are there any other reason to check the presense of /dev/mdctl?  If
not, can we remove /dev/mdctl testing?

-- -
Makoto `MAR' Matsushita

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011125130525B.matusita>