Thursday, November 15, 2007

Mounting floppy, zip, cd, and usb pen drives as a regular user

This howto shows how you can allow regular users to mount removable media such as floppies, zip disks, cd's, and usb pen drives. First, as root, create the mount points, create the ones that apply to you:

# mkdir /mnt/floppy
# mkdir /mnt/zip
# mkdir /mnt/cdrom
# mkdir /mnt/usbdrive

Depending on your Linux distro, some of these may already be present. Now you have to create the fstab entry for each device you want regular users to be able to mount, and include the "users" option. These /dev entries might be different depending on your configuration. For usb pen drives, you may have to enable hotplugging and scsi emulation in your kernel, depending if it is enabled or not. Now, I have a fairly common setup, my zip drive is the slave device on the first IDE channel, my CDROM is the primary device on the second IDE channel. The fstab entries are as follows:

/dev/fd0                /mnt/floppy     vfat            noauto,users            0 0
/dev/hdb4 /mnt/zip vfat noauto,users 0 0
/dev/hdc /mnt/cdrom iso9660 noauto,ro,users 0 0
/dev/sda1 /mnt/usbstick vfat noauto,users 0 0

No comments: