Flexible. Another program can be substituted for submountd if the system in
question has particular needs. One could even use a shell script that calls
the regular mount and umount utilities.
No configuration needed, except fstab.
Problems:
Not quite as fast as a permanently mounted filesystem, since the dentry cache
is purged on unmounting. Directories must be read again each time they are
called after unmounting even though the disk hasn't changed.
Errors are registered quietly. If the user makes a typo in the mount command,
or in the fstab file, it may be necessary to read the system log to discover
it. (Perhaps mount could be made to do some syntax checking when a subfs
filesystem is mounted?)
Programs which automatically mount a cdrom directory from fstab can mount a
second subfs directory over the filesystem mounted by the first. This could
be checked for in subfs, but it would be better to do it in the mount utility.
Installation and usage:
The sources, both kernel and userspace, can be downloaded from
http://sourceforge.net/projects/submount/ . The userspace program is built in
the usual way, and a makefile is provided for building the kernel module.
To mount a drive under subfs, use the usual syntax, except put subfs in the
filesystem type field, and add the option fs=<fstype> in the options list.
for example mount -t subfs /dev/scd0 /mnt/cdrom -o fs=iso9660,ro
or for fstab /dev/scd0 /mnt/cdrom subfs fs=iso9660,ro
I've copied the function to find the filesystem type by reading the superblock
from mount, so fs=auto will work. It can, however, cause a noticeable pause,
particularly on floppies, so there is another method for using multiple
filesystems. If a keyword is used in the fs= option, submountd will attempt
to mount filesystems from a list. Currently there are two options:
fs=floppyfss attempts vfat and ext2, and fs=cdfss tries iso9660 and udf.
Submountd will strip the options "codepage", "iocharset" and "umask" from
filesystems that don't take them, so these can be included in list mounts, or
auto-detected mounts.
These fstab lines should work:
/dev/scd0 /mnt/cdrom subfs fs=cdfss,ro,iocharset=iso8859-1,umask=0 0 0
/dev/fd0 /mnt/floppy subfs fs=floppyfss,iocharset=iso8859-1,sync,umask=0 0 0
Once this is done, just access the mountpoint directory as usual.
Eugene Weiss <eweiss@NOSPAM.sbcglobal.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/