tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mount(8) enhancement



> 	mount /dev/dk0:bart /mnt
> 	mount /dev/dk0%lisa /mnt
> 	mount /dev/dk0@maggy /mnt

> Our current mount(8) and all other file systems uses pathadj() from
> sbin/mount/pathadj.c that is really a wrapper around realpath(3).

> My proposal is to adjust
> 	pathadj(const char *input, char *adjusted)
> into
> 	pathadj(const char *input, char *adjusted, char *tail)

> It first copies the tail from the input with the tail defined as
> anything after one of [$%@:&].

Well...I have no skin in this game; if this goes in, it will be in a
NetBSD version I don't run.  But, that said, I dislike it.  It
conflicts with traditional NFS syntax, as you note, and, more
generally, what you are doing here is taking a parameter to the
filesystem ("bart", "lisa", "maggy") and shoehorning it into the device
pathname.

I would much prefer to use the existing mechanisms to specify
filesystem-specific parameters more generally.  There is prior art here
in the -s option to mount_mfs, leading to mount commands such as (to
quote one manpage) "mount -t mfs -o nosuid,-N,-s=32m swap /tmp".  I
don't see any reason why what you give above couldn't be done as

	mount -t foo -o -x=bart /mnt
	mount -t foo -o -x=lisa /mnt
	mount -t foo -o -x=maggy /mnt

or whatever option mount_foo uses instead of -x.

On a separate note, as long ago as 5.2, mount(8) says

     In addition, if special contains a colon (`:') or at sign (`@'),
     then the nfs type is inferred, but this behaviour is deprecated,
     and will be removed in a future version of mount.

You're now coming up on NetBSD 10.  If you decide you really do want to
overload the device path for this, I'd suggest getting rid of the : and
@ NFS inference; it's been over a decade and coming up on five
releases, which strikes me as long enough.  But, as I say, I'd rather
do it via mount_whatever-specific options.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index