patch to mount(8) to support optional filesystem mounts

Matthew Dillon dillon at apollo.backplane.com
Thu Jan 22 21:48:31 PST 2004


:Hi,
:
:I don't know if this is useful in any way to anyone besides myself, but
:attached is a simple patch to /usr/src/sbin/mount/mount.c to support
:optional filesystem mounts at boot.
:
:Basically it works like this: during a "mount -a", mount will *not* exit
:with an error if it cannot mount an entry in /etc/fstab, *if* that entry
:has "optional" listed in its options.
:
:The practical upshot of this is that it makes it easier to swap out
:drives.  I can put two entries for the same device in /etc/fstab, one
:with a "msdos" fstype and the other with a "ufs" fstype, and depending
:on which (if any) 2nd HDD is in my machine today, the appropriate
:mountpoint will get mounted at boot time without me having to mutter
:under my breath, edit /etc/fstab, and restart.
:
:Feedback is much appreciated (I have little idea what the peripheral
:ramifications of this change might be, but I can't think of anything...
:if this change does violate [DragonFly]BSD Design Sanity, I'd really
:like to know before I shoot myself in the foot in some unforseen way :)
:
:-Chris

    Hmm.  Well, a better solution might be to not mount those partitions
    from /etc/fstab at all but instead mount them in /etc/rc.local, or
    create a /usr/local/rc.d script, which can do more sophisticated checks
    to determine which drive you've loaded into the bay.

						-Matt






More information about the Submit mailing list