From owner-freebsd-current Sat Nov 24 20: 5:32 2001 Delivered-To: freebsd-current@freebsd.org Received: from castle.jp.freebsd.org (castle.jp.FreeBSD.org [210.226.20.15]) by hub.freebsd.org (Postfix) with ESMTP id 47B0037B416 for ; Sat, 24 Nov 2001 20:05:29 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id NAA86797 for ; Sun, 25 Nov 2001 13:05:27 +0900 (JST) (envelope-from matusita@jp.FreeBSD.org) X-User-Agent: Mew/1.94.2 XEmacs/21.5 (alfalfa) X-FaceAnim: (-O_O-)(O_O- )(_O- )(O- )(- -)( -O)( -O_)( -O_O)(-O_O-) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Dispatcher: imput version 20000228(IM140) Lines: 36 From: Makoto Matsushita To: current@FreeBSD.org Subject: "swapfile" doesn't work if md driver is not pre-loaded Date: Sun, 25 Nov 2001 13:05:25 +0900 Message-Id: <20011125130525B.matusita@jp.FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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