MountTero - Mount USB, Camera, DVD, Hard Disk and CDROM Automatically
USB drives, DVDs, CDROMs and other drives must be mounted before they are used. This article explains how any drive can be mounted automatically when it is needed. For most Linux distributions, such as Fedora Core, automounting works by just installing mounttero, a generic configuration for aufofs.
Benefits of method described here: works with or without graphical desktop, uses standard software (mounttero is an autofs map), configuration works for many users out-of-the-box, no need to install new software. Fedora RPM available.
For example, when user opens directory /mnt/auto/usb/, digital camera is automatically mounted and all the pictures shown in the directory. After four seconds of inactivity, device is unmounted and can be detached.
Fedora and Red Hat
If you want it to just work,
to root, install the rpm and start autofs automounting daemon:
# rpm -Uvh http://www.iki.fi/karvinen/linux/doc/automatic-mounting-autofs-files/mounttero-0.4-4.i386.rpm # /etc/init.d/autofs restart # chkconfig autofs on
On some systems you must specifically allow normal users to use /mnt/auto:
# chmod -R a+rx /mnt/auto
Insert a cdrom in drive and
. That’s it, you just installed mounttero.
Mounttero is availble for other Linuxes as a tarball. I have heard that Debian package is on the way. Once that is done, mounttero hopefully finds it way to Ubuntu too.
Programmers might want to read about mounttero technical details.
Sundaram 2002: Automount mini-Howto
Mntd “is an automount daemon and shared library written in C for automatically mount hotplug devices like USB sticks, Compact Flash cards or other mountable devices on linux 2.6.x kernels.” GPL. fm pop 0,12%, vit 0,00%, rat nr.
Usb-mount adds icons of usb devices on desktop when hotplug notices them.
Amount “mounts all the partitions mentioned in a command line, runs the command, and then unmounts them again.”
Virtualfs virtual file system mounter with plugins for various things. GPL. pop 0,19% vit 0,00%, rat nr
Gnome automounter. Can pop up a window when a medium is inserted to drive. Implemented on window manager/desktop, so that it does not work on text only mode. Does not work if you are not using Gnome. For me, it (gnome, nautilus?) sometimes refuses to eject cdrom even though no program seems to use the drive: “Device busy”. Fixed with
kill -9 123456
, where 123456 is the process number.
Ribeiro: Autofs no Slackware. Fix for Slackware 9 problem with rc.autofs “Unknown system, please port and contact firstname.lastname@example.org”.
Mounttero on the Press
Fresmeat record on mounttero, published 2004-05-30.
Notes and Copyright
Todo: screenshot of automounted camera in nautilus or konqueror. Change cdrom fstype from iso9660 to auto in rpm too, or dvds won’t work. Remove “dvd” entry that duplicates cdrom or cdrom1 unnecessarily. Recompile rpm to include more usb partitions.
Thanks to Lauri Sandelin for usb partitions fix and Kosti Kartano for bugreport. Thanks to alias “xlynx” for Slackware 9 autofs fix.
Copyright Tero Karvinen http://www.iki.fi/karvinen
2003 (initial release of configuration files only)
2004-05-29 (html file, explanations, RPM)
2004-05-30 (Quick RPM installation instructions, links to tutorial and alternative automounters)
2004-09-19 (more usb partitions, link to Slackware 9 fix).
2005-11-07 (Web page clean up)
GNU Free Document License with no Invariant Sections, with the Front-Cover Texts and Back-Cover Texts being “Contains a document by Tero Karvinen http://www.iki.fi/karvinen“.