Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

SD card not detected unless inserted at boot time

Need help with peripherals or devices?
Message
Author
User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: SD card not detected unless inserted at boot time

#21 Post by bw123 »

the way i follow the conversation in the bug reports, udev maintainer rules out udev as the culprit like this

Code: Select all

# udevadm monitor --kernel --udev
insert card, no response from kernel = not a udev problem.

i've read somewhere there used to be a way to make a device node manually but didn't really look into it.

anyway, you ruled out hardware problem for me, and i'm not worried about automount, so thanks. hope you get it working the way you want.
resigned by AI ChatGPT

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: SD card not detected unless inserted at boot time

#22 Post by Jerome »

Here's what I get:

Code: Select all

#udevadm monitor --kernel --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
If I plug the card, nothing happens.

If I

Code: Select all

/sbin/blkid /dev/sde
I get following lines:

Code: Select all

KERNEL[9188.599001] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
KERNEL[9188.630762] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
KERNEL[9188.630867] add      /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde1 (block)
KERNEL[9188.631157] add      /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde2 (block)
UDEV  [9188.847623] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
UDEV  [9189.052552] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
UDEV  [9189.163935] add      /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde1 (block)
UDEV  [9189.294987] add      /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde2 (block)
If I unplug, nothing happens. If I blkid, I get

Code: Select all

KERNEL[9223.320549] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
KERNEL[9223.324177] remove   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde1 (block)
KERNEL[9223.325025] remove   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde2 (block)
KERNEL[9223.325052] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
UDEV  [9223.335318] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
UDEV  [9223.336438] remove   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde1 (block)
UDEV  [9223.337207] remove   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde/sde2 (block)
UDEV  [9223.351193] change   /devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1.2/1-1.2:1.0/host6/target6:0:0/6:0:0:3/block/sde (block)
Same if I use the eject function of the GUI.

I could open a bug, but against which packet ?

I don't think it is only the kernel. I think it is another packet. I tried old kernels, same issue, even with kernels I'm sure used to work. And when I used a recent knoppix I think it worked.

I could try with live-CDs from other distros, see if it works. If so, what should I note ?
- Kernel options ?
- Packages versions ? Which packages ?

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: SD card not detected unless inserted at boot time

#23 Post by bw123 »

I don't know where the problem is, but like i said it's down deep somewhere, maybe it's whatever is assigning device to the floppy group? floppies don't have partitions from what i remember?
resigned by AI ChatGPT

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#24 Post by olivierb2 »

Hi Everybody,

Same issue there, using blkit /dev/sde force the detection of the SD card reader. Anyone as found from were is issue is coming?

Thanks.

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: SD card not detected unless inserted at boot time

#25 Post by Jerome »

As far as I remember, it works correctly with Knoppix.

What I wanted to do, but haven't done yet, is boot on knoppix and keep a log of what happens there (dmesg, syslog, whatever). Maybe you'll get the time to do that before me...

We may also want to compare kernel compilation options. (No idea what to expect there, just shooting in the dark.) Those may be found in

Code: Select all

/boot/config-$(uname -r)
(https://wiki.debian.org/KernelFAQ)

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#26 Post by olivierb2 »

Fine, I will try with knoppix this evening.

Thanks.

Olivier.

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#27 Post by olivierb2 »

I've tried Knoppix, and all is working fine. But also, it's seems that Knoppix is based on Debian stable (Wheezy). I have an other instance with Wheezy on my computer, and all is working fine.

Just discover that this is the same issue with DVD drive. May be a package is missing on my system?

I'm currently compare the kernel option, I let you know if I find something.

Thanks.

Olivier.

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#28 Post by olivierb2 »

Also discovered that running update-initramfs -u "rescans" and mount my SD card if present.

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: SD card not detected unless inserted at boot time

#29 Post by Jerome »

I can't tell whether this begun on my computer after or before the release of Wheezy.

I also checked with Knoppix and didn't really find interesting stuff in dmesg:

Insert SD card

Code: Select all

[  752.096877] sd 6:0:0:3: [sde] 3932160 512-byte logical blocks: (2.01 GB/1.87 GiB)
[  752.107116] sd 6:0:0:3: [sde] No Caching mode page present
[  752.107120] sd 6:0:0:3: [sde] Assuming drive cache: write through
[  752.126120] sd 6:0:0:3: [sde] No Caching mode page present
[  752.126123] sd 6:0:0:3: [sde] Assuming drive cache: write through
[  752.128012]  sde: sde1
Mount

Code: Select all

[  784.954178] FAT-fs (sde1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
Eject

Code: Select all

[  813.866424] sde: detected capacity change from 2013265920 to 0
I also have the kernel compile options to compare. I haven't done the comparison yet. (Can't embed them in this message. Too long, I guess.)

It's great that you have a working Wheezy. Perhaps could you try it with a recent kernel from testing/unstable to see if it comes from the kernel.

I'd say no, as I tried with older kernels and it didn't work either. But then I'm clueless.

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#30 Post by olivierb2 »

I tested kernel 3.2-0-2 from wheezy on my sid, and even if the graphical interface doesn't start (issue with nvidia module build), the kernel shows the detection of the SD card. The issue is definitely coming from the kernel.

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: SD card not detected unless inserted at boot time

#31 Post by Jerome »

Just tried here with 3.2.0-4-amd64 from Wheezy on my Jessie installation and it didn't work. I had to blkid /dev/sde.

Looks trickier. What kind of machine is it you have ?

Maybe should I investigate the hal related advice here: http://forums.debian.net/viewtopic.php? ... 62#p512396

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: SD card not detected unless inserted at boot time

#32 Post by llivv »

Jerome wrote:Just tried here with 3.2.0-4-amd64 from Wheezy on my Jessie installation and it didn't work. I had to blkid /dev/sde.

Looks trickier. What kind of machine is it you have ?

Maybe should I investigate the hal related advice here: http://forums.debian.net/viewtopic.php? ... 62#p512396
Or you could try an older Debian Live CD like an early squeeze version.
I have the issue too.
What I noticed was that my older 1GB and smaller SD cards stopped working about a year ago in my USB 2 reader.
But I had been using some 512 MB to 4GB micro SD cards for about a year too before wheezy went stable.
So that leaves about a 2 year window in which the issue could have started for me when I was paying attention to other issues.

I got a new usb 3 card reader and it works fine plugged into my usb 2 ( ten year old i386 machines ) and mounts and reads my newer 8 GB SD cards without issue in wheezy.
My older USB 2 card reader is giving me issues all the time both auto mounting and manually mounting, if I can mount from it at all.

edit:
dmesg and manual mount of SD card

Code: Select all

 [53.252127] device eth0 ----
[ 5992.653382] perf samples too long (2546 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
[ 8068.188026] usb 1-3: new high-speed USB device number 4 using ehci-pci
[ 8068.648020] usb 3-1: new full-speed USB device number 3 using uhci_hcd
[ 8068.787230] usb 3-1: Parent hub missing LPM exit latency info.  Power management will be impacted.
[ 8068.791229] usb 3-1: not running at top speed; connect to a high speed hub
[ 8068.818226] usb 3-1: New USB device found, idVendor=05e3, idProduct=0732
[ 8068.818231] usb 3-1: New USB device strings: Mfr=3, Product=4, SerialNumber=5
[ 8068.818235] usb 3-1: Product:  USB3 Reader
[ 8068.818239] usb 3-1: Manufacturer: Genesys 
[ 8068.818242] usb 3-1: SerialNumber: 000000000390
[ 8068.821335] usb-storage 3-1:1.0: USB Mass Storage
[ 8068.821485] scsi5 : usb-storage 3-1:1.0
[ 8069.824098] scsi 5:0:0:0: Direct-Access     Generic  STORAGE DEVICE   0567 PQ: 0 ANSI: 6
[ 8069.827091] scsi 5:0:0:1: Direct-Access     Generic  STORAGE DEVICE   0567 PQ: 0 ANSI: 6
[ 8069.830096] scsi 5:0:0:2: Direct-Access     Generic  STORAGE DEVICE   0567 PQ: 0 ANSI: 6
[ 8069.833095] scsi 5:0:0:3: Direct-Access     Generic  STORAGE DEVICE   0567 PQ: 0 ANSI: 6
[ 8069.833688] sd 5:0:0:0: Attached scsi generic sg5 type 0
[ 8069.834168] sd 5:0:0:1: Attached scsi generic sg6 type 0
[ 8069.834576] sd 5:0:0:2: Attached scsi generic sg7 type 0
[ 8069.835060] sd 5:0:0:3: Attached scsi generic sg8 type 0
[ 8069.986123] sd 5:0:0:1: [sde] Attached SCSI removable disk
[ 8069.994010] sd 5:0:0:0: [sdd] Attached SCSI removable disk
[ 8070.008176] sd 5:0:0:2: [sdf] Attached SCSI removable disk
[ 8070.016136] sd 5:0:0:3: [sdg] Attached SCSI removable disk

Code: Select all

me@me:~$ su -c 'mount /dev/sde1 /m'
me@me:~$  ls -la /m
total 132
drwxr-xr-x  5 root root 32768 Dec 31  1969 .
drwxr-xr-x 27 root root  4096 Oct 22 16:40 ..
drwxr-xr-x 11 root root 32768 Sep 30 15:39 DCIM
drwxr-xr-x  2 root root 32768 Aug 31 20:15 MISC
drwxr-xr-x  4 root root 32768 Aug 31 20:15 PRIVATE
edit 2:
looks like 3.11 kernel is getting even more picky them 3.10
and the usb reader is connecting at usb 1 speed now
from the above code

Code: Select all

[ 5992.653382] perf samples too long (2546 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
[ 8068.188026] usb 1-3: new high-speed USB device number 4 using ehci-pci
[ 8068.648020] usb 3-1: new full-speed USB device number 3 using uhci_hcd
[ 8068.787230] usb 3-1: Parent hub missing LPM exit latency info.  Power management will be impacted.
[ 8068.791229] usb 3-1: not running at top speed; connect to a high speed hub
arrrrr
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#33 Post by olivierb2 »

For my self, I tried to install hal, but I got this error several time during the startup :

Code: Select all

udevd[2463]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory

olivierb2
Posts: 13
Joined: 2012-05-18 11:46

Re: SD card not detected unless inserted at boot time

#34 Post by olivierb2 »

I finally found my solution here :

http://ignorantguru.github.io/udevil/#polling

I added the following command to my /etc/rc.local and now my card reader work like a charm :D

Code: Select all

echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: SD card not detected unless inserted at boot time

#35 Post by llivv »

I think that the issue is a combination of kernel version, card reader and SD card.

I saved a bunch of dmesg while testing my usb2 and usb3 card readers
with a 512 mb, 2 partition, SD card and the 8 gb SD card from my camera
using wheezy default gnome and 3.2.0-4-686-pae kernel

nautilus behaved differently almost every time I changed either the SD card or the card reader.
and would not detect my 8gb SD card from the usb2 card reader.

I haven't gotten a chance to test
bw123's mounting script yet, thanks bw123
or olivierb2 workaround either
echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs

but that is why I posted in the thread in the first place.
I wanted to test some stuff, as I missed how it broke on my box too.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

flabdablet
Posts: 24
Joined: 2011-11-22 10:37
Location: Bruthen, Australia

Re: SD card not detected unless inserted at boot time

#36 Post by flabdablet »

I've seen this behavior on a Dell Vostro 200 desktop running jessie/sid Xfce with kernel 3.10. SD cards and optical discs just don't get detected on insertion, with nothing happening in dmesg until an attempt is made to read from the card reader or disc drive concerned. Anything that performs a read will trigger detection and associated dmesg output: dd if=/dev/sdX count=1 of=/dev/null is enough, and fdisk -l or parted -l or blkid work equally well, as does explicitly triggering udev with udevadm trigger.

Olivierb2's solution (enabling kernel polling for device media) fixed it for me. I did that by editing GRUB_CMDLINE_LINUX="" inside /etc/default/grub to read GRUB_CMDLINE_LINUX="block.events_dfl_poll_msecs=2000" and then running update-grub (all as root of course).

The box concerned belongs to a customer and I won't have access to it again for some weeks, but having read the udevil documentation olivierb2 linked to,I suspect that the udisks package is not installed on it and that simply doing that would remove the need for kernel polling. I will certainly try that next time I do have access because as I left it, selecting the Xfce removable media options for auto-mounting inserted media resulted in successful auto-mounting on only about one try in four. The Debian package for xfce4-power-manager suggests udisks, so if it works it's probably the Right Thing.

flabdablet
Posts: 24
Joined: 2011-11-22 10:37
Location: Bruthen, Australia

Re: SD card not detected unless inserted at boot time

#37 Post by flabdablet »

OK, so I've just seen this issue again, this time on a box that does already have udisks installed, and enabling kernel polling for device media fixed it.

Jerome
Posts: 54
Joined: 2011-07-18 20:57
Location: France

Re: SD card not detected unless inserted at boot time

#38 Post by Jerome »

I realized today that this problem has mysteriously disappeared from my machine.

I'm running an up-to-date Jessie with 3.13 kernel from experimental. udisks is installed. I don't know if it was, back then.

Great.

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: SD card not detected unless inserted at boot time

#39 Post by llivv »

it's not really that mysterious when you realize what the variables are,
which comes with practice and at least two different era - usb1 usbe2 usbe3 - card readers
and a few different era cards to be read by them.

either the kernel sees the combination or something else happens.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

Pinyaka
Posts: 2
Joined: 2014-03-10 14:25

Re: SD card not detected unless inserted at boot time

#40 Post by Pinyaka »

Enabling polling fixed this for my MMC card as well. Thanks for posting.

Post Reply