unable to mount pen drive on usb port; /dev/sdb missing

Asked by thiru ramakrishnan

My Ubuntu 23.10 desktop behaved very strangely when i powered it on last evening (2024 May 05): It took about 20 minutes to boot. (I didn't mess with the system and did a normal shutdown in the morning of May 05.)

Since then I haven't been able to connect external memory (pen drive) because there isn't any /dev/sdb! There is only sda.

I browsed quite a few posts related to "sdb" but couldn't find any information i could use. In desperation (to debug and fix the problem) I ran several commands and saved their output:

lsusb
sudo lsblk
sudo parted -ls
usb-devices
partprobe
parted -l
sudo sfdisk -l
sudo dmesg | grep "ata\|scsi\|raid"
ls -al /sys/block/
sudo blkid
sudo dmesg

ls -al I am listing the output of just three commands here because i don't want to make this a "very long" post.

Today I upgraded to Ubuntu 24.04 LTS.

I'd be grateful if someone could help me find a solution.

Thank you.
----
lsusb resulted in the following output:

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0
Bus 001 Device 005: ID 046d:c077 Logitech, Inc. Mouse
Bus 001 Device 011: ID 214b:7250 Huasheng Electronics
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
----
sudo lsblk resulted in the following output (i deleted many lines starting with "loop", in order to shorten this message):

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 93.3M 1 loop /snap/bitwarden/107
loop2 7:2 0 9.8M 1 loop /snap/canonical-livepatch/264
loop3 7:3 0 93.3M 1 loop /snap/bitwarden/108
loop4 7:4 0 10.1M 1 loop /snap/canonical-livepatch/278
loop5 7:5 0 105.4M 1 loop /snap/core/16574
loop13 7:13 0 66.1M 1 loop /snap/cups/1044
loop15 7:15 0 268.3M 1 loop /snap/firefox/4090
loop16 7:16 0 269.6M 1 loop /snap/firefox/4136
loop17 7:17 0 10.7M 1 loop /snap/firmware-updater/127
loop18 7:18 0 515.3M 1 loop /snap/gimp/418
loop19 7:19 0 10.7M 1 loop /snap/firmware-updater/121
loop20 7:20 0 515.3M 1 loop /snap/gimp/428
loop21 7:21 0 140.7M 1 loop /snap/gnome-3-26-1604/104
loop33 7:33 0 140K 1 loop /snap/gtk2-common-themes/loop39 7:39 0 289.8M 1 loop /snap/kde-frameworks-5-core18/35
loop40 7:40 0 17.8M 1 loop /snap/pdftk/9
loop41 7:41 0 184.5M 1 loop /snap/signal-desktop/650
loop44 7:44 0 12.3M 1 loop /snap/snap-store/959
loop46 7:46 0 452K 1 loop /snap/snapd-desktop-integration/83
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda2 8:2 0 22.4G 0 part
├─sda3 8:3 0 172.9G 0 part /mnt/a1bf4772-99a9-41e8-98a0-b7adb8fc6743
├─sda4 8:4 0 1K 0 part
├─sda5 8:5 0 3.9G 0 part
├─sda6 8:6 0 19.5G 0 part
├─sda7 8:7 0 3.9G 0 part
├─sda8 8:8 0 171.9G 0 part
└─sda9 8:9 0 71.2G 0 part /var/snap/firefox/common/host-hunspell
                                 /
sr0 11:0 1 1024M 0 rom
----
lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

----
sudo dmesg produced a large output file; one of the lines in it is the following:

[ 1259.226903] /dev/sdb: Can't lookup blockdev
----

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
thiru ramakrishnan
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

I hope for meaningful output when doing the following:

Boot without the USB stick and let the system settle for a while.
Then insert the USB stick, wait half a minute and issue the command

sudo dmesg | tail -n 20

Copy/paste the output into this question document.

Revision history for this message
thiru ramakrishnan (parithi.ramki) said :
#2

Thank you for your message.
Here's the output you asked for ...
----
                exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
[ 328.734813] audit: type=1107 audit(1715039411.622:226): pid=1285 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.9" pid=3057 label="snap.snap-store.snap-store" peer_pid=1317 peer_label="unconfined"
                exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
[ 328.735434] audit: type=1107 audit(1715039411.622:227): pid=1285 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.PolicyKit1.Authority" member="CheckAuthorization" mask="send" name=":1.9" pid=3057 label="snap.snap-store.snap-store" peer_pid=1317 peer_label="unconfined"
                exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
[ 370.974460] audit: type=1400 audit(1715039453.860:228): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3952 comm="snap-confine" capability=12 capname="net_admin"
[ 370.974473] audit: type=1400 audit(1715039453.860:229): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3952 comm="snap-confine" capability=38 capname="perfmon"
[ 371.406430] audit: type=1400 audit(1715039454.292:230): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3977 comm="snap-confine" capability=12 capname="net_admin"
[ 371.406464] audit: type=1400 audit(1715039454.292:231): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3977 comm="snap-confine" capability=38 capname="perfmon"
[ 432.977762] loop53: detected capacity change from 0 to 191056
[ 438.732353] audit: type=1400 audit(1715039521.618:232): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/16928/usr/lib/snapd/snap-confine" pid=4271 comm="apparmor_parser"
[ 438.732365] audit: type=1400 audit(1715039521.618:233): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/16928/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=4271 comm="apparmor_parser"
[ 439.278580] audit: type=1400 audit(1715039522.164:234): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap-update-ns.bitwarden" pid=4273 comm="apparmor_parser"
[ 439.388626] audit: type=1400 audit(1715039522.274:235): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.bitwarden.bitwarden" pid=4274 comm="apparmor_parser"
[ 439.396499] audit: type=1400 audit(1715039522.282:236): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.core" pid=4278 comm="apparmor_parser"
[ 439.400046] audit: type=1400 audit(1715039522.285:237): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.core.hook.configure" pid=4279 comm="apparmor_parser"
[ 551.202419] audit: type=1400 audit(1715039634.088:238): apparmor="AUDIT" operation="userns_create" class="namespace" info="Userns create - transitioning profile" profile="unconfined" pid=4433 comm="firefox-bin" requested="userns_create" target="unprivileged_userns"
[ 551.202815] audit: type=1400 audit(1715039634.088:239): apparmor="DENIED" operation="capable" class="cap" profile="unprivileged_userns" pid=4438 comm="firefox-bin" capability=21 capname="sys_admin"
[ 1304.919565] audit: type=1107 audit(1715040387.800:240): pid=1285 uid=103 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/UPower" interface="org.freedesktop.UPower" member="EnumerateDevices" mask="send" name="org.freedesktop.UPower" pid=5867 label="snap.thunderbird.thunderbird" peer_pid=2200 peer_label="unconfined"
                exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

For ruling out defective hardware:
Have you tested whether the pen drive works on a different computer system?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Have you tried different USB ports?

Revision history for this message
thiru ramakrishnan (parithi.ramki) said :
#5

>>>
 Have you tested whether the pen drive works on a different computer system?
<<<

Yes, I tried it on a laptop and it worked there. Also, it's not just one pen drive but three.

>>>
Have you tried different USB ports?
<<<

Yes, I've tried all USB ports. External speaker, keyboard and mouse work when connected to those USB ports.

I think the only reason (memory devices don't get connected) is that /dev/sdb is missing. I don't know why it got deleted and how to create it.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

When you pull the device from the other systems, do you use the safe remove feature in the operating system before physically pulling the device out?

Revision history for this message
Manfred Hampl (m-hampl) said (last edit ):
#7

The missing /dev/sdb device entry is a symptom, not the cause.

The udev subsystem should start acting on a hardware change (in this case hotplugging an USB device) and should create the /dev/sdb (and /dev/sdb1 etc.) automatically for that event.

I am very astonished, that the "dmesg | tail" command does not show any reaction when inserting the thumb drive.
Did you really follow the instructions in comment #1 ? The time codes indicate that the timing was not as requested.

Revision history for this message
thiru ramakrishnan (parithi.ramki) said :
#8

>>>
When you pull the device from the other systems, do you use the safe remove feature in the operating system before physically pulling the device out?
<<<

Yes! I am always careful about this; i don't just pull the device out arbitrarily. I use the unmount option first.

>>>
The missing /dev/sdb device entry is a symptom, not the cause.

The udev subsystem should start acting on a hardware change (in this case hotplugging an USB device) and should create the /dev/sdb (and /dev/sdb1 etc.) automatically for that event.
<<<

I understand this now. (I used to think /dev/sdb was created by default and the pen drive got mounted on it.) Thank you.

>>>
Did you really follow the instructions in comment #1 ? The time codes indicate that the timing was not as requested.
<<<

I am quite sure i followed your instructions: I booted the system, logged in after a few minutes and then inserted the pen drive into a USB port and issued the dmesg command. I will try it again and capture the output and compare with the earlier output.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

if you cold boot with the usb device connected (before the bios loads), is it ok?

Revision history for this message
thiru ramakrishnan (parithi.ramki) said :
#10

I was going to try the last two suggestions:

1. (Manfred Hampl (m-hampl)) I am very astonished, that the "dmesg | tail" command does not show any reaction when inserting the thumb drive.
Did you really follow the instructions in comment #1 ? The time codes indicate that the timing was not as requested.

2. (actionparsnip (andrew-woodhead666)) if you cold boot with the usb device connected (before the bios loads), is it ok?

But, i just inserted a pen drive into a USB port and it got connected!

This is strange and unbelievable. Also, this doesn't mean there's no problem; only means that it works for now!

I will try the above suggestions when i run into this problem again.

Until then, thank you both very much for your help. I am going to select "Problem Solved" for now.