DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got a debian 4 (etch) system with kde. Every time I stick in a usb flashdrive it auto-mounts and asks if I want to open it or not. I have no problems with it.
However, I want to change the way it mounts so that I can use the uuid of the flash drive to assign it a static mount point (ie: always mount flashdrive with uuid=7586-3937 to /media/flashdrive1). I haven't gotten the chance to see what happens if I insert two flashdrives at once... but I think it would be random which flashdrive would mount where.
My question is: where does all this magic happen? I have no mentions of the flashdrive in my fstab. I've tried putting a line including the uuid and mount point in my fstab which leads to permission problems when I try to mount it. Another thing I find strange is that the current mount point for the flashdrive gets created on the fly when I insert the flashdrive. /media/disk does not exist when the usb flashdrive is not mounted - but it does exist when it is mounted. I always thought the directory had to exist before the usb flashdrive was mounted.
Can anyone point me in the direction of where to find where all this magic happens so I can poke around and try to configure it to my liking?
This is one possibility:
plug in stick
"dmesg" look for the device, let's say it's sdc:sdc1
"udevinfo -a -p `udevinfo -q path -n /dev/sdc` | grep serial" #get the serial, for me: ATTRS{serial}=="0602101948231"
add to the top of /etc/udev/rules.d/60-persistent-storage.rules the following line:
BUS=="usb", KERNEL=="sd?1", SYSFS{serial}=="0602101948231", NAME="kingston", SYMLINK="kingston%n"
use any name, I have kingston there
add to /etc/fstab the following line:
/dev/kingston1 /media/kingston vfat noauto,users,exec,noatime,umask=000 0 0
make a dir under media:
drwxrwx--- 2 root users 4096 2008-08-24 13:15 kingston
Plenty more on google for usb and udev.
Edit: You might have to do "/etc/init.d/udev restart" before it works, can't remember.
Last edited by makuyl; 08-24-2008 at 05:54 AM.
Reason: Added command
Thank you guys. I found the udev stuff earlier, but I was scared - it looked deep and important. I will read a little about it and give it a try. I didn't know that was where it all happend. Good to know.
Worked like a charm. Now it always mounts where I want it. Fantastic. Makes it easier to write a backup script or something... haven't really done anything yet. But I'm happy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.