LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-10-2006, 09:24 PM   #1
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Rep: Reputation: 15
missing /dev/sda* device files


Hi,

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:
Code:
$ ls -l /dev/sda* 
brw-rw---- 1 root plugdev 8, 0 2006-09-10 07:48 /dev/sda 
brw-rw---- 1 root plugdev 8, 1 2006-09-10 11:48 /dev/sda1 
$
From my /etc/fstab:
Code:
/dev/sda1 /media/cardreader0 vfat auto,user 0 0
 
Old 09-10-2006, 09:41 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
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
 
Old 09-10-2006, 10:47 PM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Is HAL enabled?
 
Old 09-10-2006, 10:54 PM   #4
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by cs-cam
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:
Code:
> SCSI device sda: 3910656 512-byte hdwr sectors (2002 MB)
> sda: Write Protect is off
> sda: Mode Sense: 03 00 00 00
> sda: assuming drive cache: write through
> SCSI device sda: 3910656 512-byte hdwr sectors (2002 MB)
> sda: Write Protect is off
> sda: Mode Sense: 03 00 00 00
> sda: assuming drive cache: write through
>  sda: sda1
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.

Any idea why this is happening and how to fix it?
 
Old 09-10-2006, 11:25 PM   #5
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
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
 
Old 09-11-2006, 02:48 PM   #6
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Original Poster
Rep: Reputation: 15
lsmod output

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.

The output is as follows:

Code:
$ diff module.list.withoutcard.txt module.list.withcard.txt
45c45
< ipv6                  265728  17
---
> ipv6                  265728  25
56,57c56,57
< nls_cp437               5888  1
< nls_iso8859_1           4224  1
---
> nls_cp437               5888  2
> nls_iso8859_1           4224  2
75c75
< sd_mod                 19984  0
---
> sd_mod                 19984  2
79c79
< snd                    55268  18 snd_emux_synth,snd_seq_virmidi,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
---
> snd                    55268  17 snd_emux_synth,snd_seq_virmidi,snd_seq_oss,snd_seq,snd_emu10k1,snd_rawmidi,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_device,snd_timer,snd_hwdep
82c82
< snd_emu10k1           117284  4 snd_emu10k1_synth
---
> snd_emu10k1           117284  3 snd_emu10k1_synth
88c88
< snd_pcm                89864  4 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
---
> snd_pcm                89864  3 snd_emu10k1,snd_ac97_codec,snd_pcm_oss
113,114c113,114
< usb_storage            74176  0
< vfat                   13440  1
---
> usb_storage            74176  2
> vfat                   13440  2
$
 
Old 09-11-2006, 04:23 PM   #7
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Original Poster
Rep: Reputation: 15
also note -- can manually create device

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.
 
Old 09-11-2006, 05:23 PM   #8
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
That should be done by udev and hal, do you have them both installed?
 
Old 09-11-2006, 05:42 PM   #9
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
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.

http://indiboi.com/history/2005/09/16/2887535
https://www.fsfe.org/en/card/howto/c...der_howto_udev # i think this is for encrypted cards or something?
 
Old 09-11-2006, 07:00 PM   #10
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Original Poster
Rep: Reputation: 15
udev or hal? Any more info?

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.
 
Old 09-11-2006, 07:10 PM   #11
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
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:
Code:
pidof udevd
 
Old 09-11-2006, 07:32 PM   #12
monkeyman2000
Member
 
Registered: Oct 2003
Posts: 68

Original Poster
Rep: Reputation: 15
Code:
$ pidof udevd
2309
$
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/sda is not a valid block device C++ Linux - Hardware 23 03-24-2008 10:07 AM
Missing Block Device /dev/hdc1 !?! whishkah Linux - Hardware 2 09-06-2006 09:31 AM
where is my serial device??? /dev/ttyS* is missing! mrchaos Linux - Hardware 2 03-11-2006 02:50 PM
/dev/sda is not a valid block device craig467 Linux - General 23 02-17-2006 04:50 PM
USB flash device (sda missing) TroelsSmit Linux - Newbie 13 02-06-2006 09:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration