UbuntuThis forum is for the discussion of Ubuntu 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 have a usb flash card reader attached to my computer. When I used Breezy, if I inserted a flash card into it, it was automounted, and kubuntu created an icon for it on my desktop.
Now I have upgraded my computer to Dapper, and my card reader no longer automounts. It seems to be the case that no /dev device file exists for the device.
If I insert a card into the reader and reboot my machine, a device is created, and the disk is mounted. If I remove the card and reboot, however, the device file no longer exists when ubuntu comes back on, and if I insert a card one is not created.
How can I tell Dapper ubuntu to make this work, so that when I insert a card into the reader, it gets automounted, like it used to work before?
------------------------------------
When booted with card inserted:
Boot without a card in there, insert one, wait a sec and run 'dmesg' and see if anything useful is printed. If you aren't sure post the last 20 lines or so but if linux is recognising the device at all, this is where you'll hear about it
Boot without a card in there, insert one, wait a sec and run 'dmesg' and see if anything useful is printed. If you aren't sure post the last 20 lines or so but if linux is recognising the device at all, this is where you'll hear about it
Nothing gets added to dmesg output when I insert a card after booting without one inserted.
When I boot with the card inserted, the dmesg output is slightly different; the relevant portion seems to be:
Bottom line, the system only creates the device file(s) when it boots with the card inserted. It seems it should either create the device files when a card is inserted, or already have the device file, and use it to automount the card, like it used to do before I upgraded to Dapper.
If nothing is appearing in dmesg then the kernel isn't even recognising it which is the problem, no userspace daemons like HAL or udev are going to make a difference.
Maybe the module isn't autoloading for the device unless there's a card in it, if you feel like rebooting a couple of times again then use lsmod to grab a list and loaded modules and compare them using diff.
Code:
# boot with card
lsmod | sort > ~/module-list1.txt
# reboot without
lsmod | sort > ~/module-list2.txt
diff ~/module-list1.txt ~/module-list2.txt
OK, I rebooted twice & ran lsmod both with the card inserted (/dev/sda1 created & card mounted) and without (no /dev/sda is created).
It looks like the same modules are loaded... the only differences seem to be in the number in the 'Used By' column of the lsmod output for some modules...I assume that's not significant.
Note that if I boot without the card inserted (no /dev/sda1 device file is created), I can then insert the card, and manually create the device file and mount the card:
Code:
$ cd /dev
$ sudo mknod sda1 b 8 1
$ mount /media/cardreader0/
When I reboot again without the card, though, the /dev/sda1 file is gone again.
I can then insert the card, and manually create the device file and mount the card
Ohh that's different then, I assumed it wasn't being recognised but I've never played with card readers, everything I've ever plugged in has turned up in dmesg.
You are indeed looking at a Udev problem, I found a few links but I'm not sure if any of them apply to you.
Thanks for the links, cs-cam... however, they don't really help that much. udev looks really complex and involved... and according to it's FAQ, it doesn't sound like its the right thing to look at (though I could be wrong depending on how ubuntu is set up):
Frequently Asked Questions about udev
Q: Can I use udev to automount a USB device when I connect it?
A: Technically, yes, but udev is not intended for this. All major distributions
use HAL (http://freedesktop.org/wiki/Software_2fhal) for this, which also
watches devices with removable media and integrates into the desktop software.
However, I don't really understand either udev or HAL, and both seem very complex and not so clearly documented, at least for non-programer users.
Can you (or anyone) give me some further advice on how to proceed? It seems like something that should 'just work,' particularly since it used to before I upgraded from Breezy to Dapper.
Frequently Asked Questions about udev
Q: Can I use udev to automount a USB device when I connect it?
A: Technically, yes, but udev is not intended for this. All major distributions
use HAL (http://freedesktop.org/wiki/Software_2fhal) for this, which also
watches devices with removable media and integrates into the desktop software.
Automount isn't what you're having a problem with (at this stage). Just a FYI, if sda1 was being created then chances are HAL would automatically mount it, it's udev not creating sda1 that is the problem. Just make sure udev is running:
So udevd is running. Possibly it lacks a proper 'rule' or configuration to create the /dev/sda1 (or 2,3, whatever) when a card is inserted. If so, I could use some help figuring out what it is.
I couldn't say if HAL is running, how would I determine that?
Note that when I insert the card into the reader, there is no usb event reported in dmesg output... I don't know if that's significant.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.