Date: 21 Sep 2002 12:51:04 -0000 From: lonewolf@earthmagic.org To: FreeBSD-gnats-submit@FreeBSD.org Cc: lonewolf@earthmagic.org Subject: conf/43167: Ability to have vnode based file systems mounted on boot Message-ID: <20020921125104.44273.qmail@helios.earthmagic.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020921125104.44273.qmail>