cdrom mount

Oliver Fromme olli at haluter.fromme.com
Tue Dec 21 08:51:41 PST 2004


Steve O'Hara-Smith <steve at xxxxxxxxxx> wrote:
 > Brian Reichert <reichert at xxxxxxxxxxx> wrote:
 > > Would it be meaningful to have a 'mnt' directory in one's home
 > > directory?
 > 
 >        That's exactly what I do on my boxes with usermount enabled.

Personally, I have several mountpoints in my home directory
with meaningful names:  ~/cdrom is for CDs, ~/flash is for
my USB memory stick, and ~/cf is for my compact flash card
adapter.  I also have a ~/floppy mountpoint, but I haven't
used it for ages.  :-)

I haven't added those mounts to /etc/fstab, because I don't
think they belong there.  Those entries would rather belong
in a file like ~/.fstab or ~/.mountrc, but mount(8) doesn't
support that.

My solution was to write a small shell function "mount"
which is a wrapper for mount(8).  Now I can simply type
"mount flash", and it mounts the flash stick and -- if
successful -- cd's into ~/flash.  Another wrapper function
"umount" (no argument required) cd's out of the current
mount and then umounts it.  Quite convenient.

Best regards
   Oliver

PS:  Just to sum up, there are three conditions that _must_
be fulfilled for user mounts to work:

1. sysctl vfs.usermount=1
2. The user must OWN the mountpoint.
3. The user must have READ+WRITE access to the device
   being mounted (e.g. by chgrp'ing it to a special group,
   or use the existing operator group, and then chmod g+rw).
   The user doesn't have to (and shouldn't) own the device,
   though.  Also, making the device world-writable is pro-
   bably a bad idea, so use a group.

Maybe those three points should be mentioned clearly in the
mount(8) manpage.

-- 
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)





More information about the Users mailing list