Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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 am trying to get Ubuntu to automatically mount my attache USB drive using udev.
After inserting the drive, I expect to see the name "attache" (based on the rule) in the /dev directory, but I get nothing. However, I can mount the drive manually using the /dev/sda1 device.
===============
This is the output of: uname -a
Linux lepton 2.6.17-10-generic #2 SMP Fri Oct 13 18:45:35 UTC 2006 i686 GNU/Linux
===============
This is my Distro:
Ubuntu, kernel 2.6.17-10-generic
===============
This is the output of: udevinfo -a -p /block/sda/sda1
udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.
I think I used the wrong terminology. I didn't mean that I'm expecting udev to mount the device (though that is what I said, isn't it). I mean, udev is not assigning the device name that I am asking it to. Based on the rule I show below, I'm expecting the name "attache" to be listed, rather than /dev/sda1. (Or maybe in addition to?)
Just out of curiosity why you think Linux must call it "attache" and not /dev/sda1?
There are thousands USB devices out there and the drivers in Linux is always generic. Remember you don't need to feed a manufacturer's driver to a Linux in such case.
To Linux your USB device is just a block device. Do you have a problem using it? or rather to mount it on /attache in the filing system after making the directory /attache? Although generally one would mount it as /mnt/attache.
When you are actually working files in the device the /dev/<whatever name> is not used.
I don't so much care what the device is named. I realize I can name the symlink to the device whatever I want and use that to mount the drive. In this case, I was just naming the device for practice and using a name that sticks out. After a LOT of digging, I found that my rules had a plethora of syntax errors. So, I fixed them and it works now.
Thanks for the help, though!
Just for posterity, here's my "newer and better" rules:
The Petito is strange. When it's plugged in, two "sd" devices show up. So, the only unique attribute I could find between the two was the SYSFS{size} attribute. I've never seen that before.
I solved the same problem you did, but (I hope) in a more generic way that is not relying on a particular device type. Here's how I did it:
Find an existing udev rule that is launched after the your usb partition node is created. For me, the rule was in /etc/udev/rules.d/60-persistent-storage.rules, and it looked like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.