Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my Debian Squeeze laptop I am unable to auto mount pen drive or external hard drive. Here is the content of my /etc/fstab

#commented following line to just support vfat
#/dev/sdb1       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdb1       /media/usb0   udf,vfat user,noauto     0       0

The problem is when I plugin a USB drive I see two icons for one USB drive. One is labled usb0 and other is the actual label of the pen drive for example sandisk or kingston. I can browse files in usb0 but sandisk/kingston is not accessible. If I unmount the usb0 I can access sandisk/kingston ladled folders and they are read/writeable by a normal user.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I found this neat little howto based on udev. It mounts and unmounts a specified disk's partitions to known locations set up by you.

The part with the sample configuration is hard to read, so here it is again:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{serial}=="57583", SYMLINK+="wd%n"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{serial}=="57583", RUN+="/bin/mkdir /media/wd"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{serial}=="57583", RUN+="/bin/mount -t auto -o defaults /dev/wd1 /media/wd", OPTIONS="last_rule"
ACTION=="remove", SUBSYSTEMS=="usb", ATTRS{serial}=="57583", RUN+="/bin/umount /media/wd"
ACTION=="remove", SUBSYSTEMS=="usb", ATTRS{serial}=="57583", RUN+="/bin/rmdir /media/wd", OPTIONS="last_rule"
share|improve this answer
    
late to accept but thanks for sharing the link. :-) –  Kumar Dec 31 '11 at 13:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.