At Mon, 06 Jun 2011 19:31:29 -0700 CentOS mailing list <centos at centos.org> wrote: > > I'm running a headless server, so no GUI, just ssh logins. I don't seem to > have the mechanism that automounts USB drives to a subdirectory of /media, > and from googling around I think that's a feature of a GUI-based system. > What implements it? Right now I manually create a mountpoint in /mnt and > then manually mount by label from /dev/disk/by-label after plugging the > drive in. It would be convenient if the drive automounted when plugged in. The problem is this: you also need some way to unmount the disk. And for FAT file systems, you need to somehow map the ownership. The GUI does the mount in the logged in user and the [GNome] desktop icon includes a right-click menu with an 'eject' / 'unmount' item. Delegate this functing to some daemon running as root or to a hotplug script (which would also be running as root), would be problematical for obvious reasons. Question are these random thumb drives? Or are they magnetic drives? Are then always connected? Regularly connected? FAT file systems? Ext2/3 file systems? There are several options: One option is to include a line in /etc/fstab like this: /dev/thumb /media/thumb auto noauto,user,rw 0 0 (/dev/thumb in this case is created by this udev rule: KERNEL=="sd[a-z]*", BUS=="scsi", SYSFS{device/vendor}=="Kingston", NAME="thumb" disk-by-label is not possible since this disk is formatted FAT) This disk is still manually mounted and dismounted, but a non-priviledged user can do the mount and unmount and only the mount point is used. The other option is to use automount with lines like this in an automount config file: /reposi386 -fstype=ext2 :LABEL=REPOSI386 /reposx86_64 -fstype=ext2 :LABEL=REPOSX86_64 (these are 16gig thumb drives reformatted with labeled ext2 file systems) These drives are mounted on-demand and auto dismount after period of idleness. > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos > > -- Robert Heller -- 978-544-6933 / heller at deepsoft.com Deepwoods Software -- http://www.deepsoft.com/ () ascii ribbon campaign -- against html e-mail /\ www.asciiribbon.org -- against proprietary attachments