From owner-freebsd-current@FreeBSD.ORG Mon Dec 18 20:39:03 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7721816A47B for ; Mon, 18 Dec 2006 20:39:03 +0000 (UTC) (envelope-from vincent@xtra-net.org) Received: from ns1.xtra-net.be (ns1.xtra-net.be [195.162.200.90]) by mx1.FreeBSD.org (Postfix) with SMTP id 4177143CA2 for ; Mon, 18 Dec 2006 20:39:00 +0000 (GMT) (envelope-from vincent@xtra-net.org) Received: (qmail 4578 invoked from network); 18 Dec 2006 20:12:11 -0000 Received: from unknown (HELO sbepfkaa.srv.xtra-net.be) (172.16.66.66) by 0 with SMTP; 18 Dec 2006 20:12:11 -0000 Received: (qmail 44357 invoked from network); 18 Dec 2006 20:09:17 -0000 Received: from wbedllfs.intranet.xtra-net.be (HELO wbemfkaa.net.xtra-net.be) (172.16.66.1) by 0 with SMTP; 18 Dec 2006 20:09:17 -0000 From: Vincent Blondel To: freebsd-current@freebsd.org Content-Type: text/plain Date: Mon, 18 Dec 2006 21:11:06 +0100 Message-Id: <1166472667.903.23.camel@wbemfkaa.net.xtra-net.be> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: vincent@xtra-net.org Subject: /etc/rc.d/mdconfig2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2006 20:39:03 -0000 Hello all, I discovered yesterday the existence of /etc/rc.d/mdconfig2. I am trying to use this script to automate the creation of a vnode disk at system boot but I encounter some problems. First of all I created a simple test vnode disk like this ... dd if=/dev/zero of=/var/squid/cache0 bs=1k count=512k mdconfig -a -t vnode -f /var/squid/cache0 -u 0 bsdlabel -w md0 auto newfs md0c mount /dev/md0c /mnt This is working perfectly. I can attach/detach the memory disk, mount/unmount this vnode device with no problem. But when I try to automate this procedure, I get some problems. So I first added these two lines in /etc/rc.conf. mdconfig_md0="-t vnode -f /var/squid/cache0" mdconfig_md0_cmd="mount \${_dev} /mnt" First part happens correctly and I get my device mounted as /dev/md0 but due the fact the device is labeled, I also get /dev/md0a and /dev/md0c and this occurs a problem. When debugging the script you can see the script is trying to make an fsck on /dev/md0 and not /dev/md0c. + mdconfig -l -u md0 + echo Creating md0 device (vnode). Creating md0 device (vnode). + mdconfig -a -t vnode -f /var/squid/cache0 -u md0 + [ /var/squid/cache0 != /var/squid/cache0 ] + checkyesno background_fsck + eval _value=$background_fsck + _value=YES + debug checkyesno: background_fsck is set to YES. + return 0 + _fsck_cmd=fsck -F + eval fsck -F -p /dev/md0 + fsck -F -p /dev/md0 fsck: Could not determine filesystem type + echo Fsck failed on /dev/md0, not mounting the filesystem. Fsck failed on /dev/md0, not mounting the filesystem. + continue + _return=0 + [ 0 -ne 0 ] + [ -n ] + return 0 So, is really mdconfig_mdX_cmd the right way to mount this vnode device or is there another way to do it ? Vincent.