From owner-freebsd-bugs Sat Sep 21 6: 0:24 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65AE737B401 for ; Sat, 21 Sep 2002 06:00:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8DED43E6E for ; Sat, 21 Sep 2002 06:00:20 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8LD0KCo073961 for ; Sat, 21 Sep 2002 06:00:20 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8LD0KMI073960; Sat, 21 Sep 2002 06:00:20 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 707F337B401 for ; Sat, 21 Sep 2002 05:51:13 -0700 (PDT) Received: from helios.earthmagic.org (helios.earthmagic.org [198.78.66.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2518443E3B for ; Sat, 21 Sep 2002 05:51:13 -0700 (PDT) (envelope-from lonewolf@helios.earthmagic.org) Received: (qmail 44274 invoked by uid 1001); 21 Sep 2002 12:51:04 -0000 Message-Id: <20020921125104.44273.qmail@helios.earthmagic.org> Date: 21 Sep 2002 12:51:04 -0000 From: lonewolf@earthmagic.org Reply-To: lonewolf@earthmagic.org To: FreeBSD-gnats-submit@FreeBSD.org Cc: lonewolf@earthmagic.org X-Send-Pr-Version: 3.113 Subject: conf/43167: Ability to have vnode based file systems mounted on boot Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43167 >Category: conf >Synopsis: Ability to have vnode based file systems mounted on boot >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Sep 21 06:00:15 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Johny Mattsson >Release: FreeBSD 4.7-RC i386 >Organization: earthmagic.org >Environment: System: FreeBSD tank.zone2.earthmagic.org 4.7-RC FreeBSD 4.7-RC #2: Sat Sep 21 17:28:54 EST 2002 root@sarah.zone2.earthmagic.org:/usr/obj/usr/src/sys/TANK i386 >Description: While vn(4) based file systems offer great flexibility, the option to mount such filesystem on boot is currently missing. There is no way of getting vnconfig(8) to run in time to make the vn's available for mounting. This is a shame as I needed/wanted that functionality today. So I added it :) I'm hoping you'll find this to be a useful addition to include in future releases, or if nothing else, an inspiration for something even better. >How-To-Repeat: Well.. just try and stick a /dev/vn0c line in your /etc/fstab and you'll see how far you get on mounting that one at boot time. Which is to say nowhere at all. >Fix: I've tweaked /etc/rc and added two knobs to /etc/default/rc.conf to provide the mechanism for running vnconfig(8), fsck:ing the fs'es, and mounting them at boot time. I'm not 100% the place in /etc/rc where I added it is the most optimal, but it needs to be somewhere after having had NFS fs'es mounted (in case the fs file is located on an NFS mount), and before starting up our own nfsd (if we're sharing a "vn-fs"). As I put it, it's right before network_pass2 gets invoked. It could possibly be moved to even earlier, especially if we want to use it as /tmp and want it to be cleared on boot. Not that I see much use for it, but maybe someone else might. I guess right after the NFS mounts would be an okay location as well. Cheers, /Johny Diffs inline below: --- rc.old Sat Sep 21 22:36:29 2002 +++ rc Sat Sep 21 23:06:35 2002 @@ -422,6 +422,28 @@ fi fi +# Set up vnconfig's and mount vnode based file systems +# +case "${vnmount_enable}" in +[Yy][Ee][Ss]) + echo -n 'Configuring vnodes:' + vnconfig -a -f "${vnmount_tab}" + echo ' done.' + echo 'Automatic vnode based file systems checks:' + grep '^/dev/vn' /etc/fstab | awk '{print $1}' | while read device + do + fsck -p "$device" + done + echo -n 'Mounting vnode based file systems:' + grep '^/dev/vn' /etc/fstab | awk '{print $2}' | while read mountpoint + do + echo -n " $mountpoint" + mount "$mountpoint" + done + echo '.' + ;; +esac + if [ -n "${network_pass1_done}" ]; then network_pass2 fi --- defaults/rc.conf.old Sat Sep 21 22:39:22 2002 +++ defaults/rc.conf Sat Sep 21 22:52:31 2002 @@ -375,6 +375,11 @@ update_motd="YES" # update version info in /etc/motd (or NO) start_vinum="NO" # set to YES to start vinum unaligned_print="YES" # print unaligned access warnings on the alpha (or NO). +vnmount_enable="NO" # Enable automatic mounting of vn(4) based file systems. +vnmount_tab="/etc/vntab" + # Config file for vnconfig(8) (if vnmount is enabled). + # File systems must be listed in /etc/fstab with the + # "noauto" option to make them mount properly. ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message