Something very weird and dangerous happened today on my Ubuntu 24.04 laptop.
First I used normally all my USB drives, including creating startup disks on one USB stick.
Then I inserted an almost new Kingston Data Traveller 32GB. Format it with ext4 + LUKS using:
gnome-disk-utility 46.0
UDisks 2.10.1 (built against 2.10.1)
It got stuck during the formatting, and the the Drive just disappeared from everywhere. It's not there even using fdisk or gparted. Nothing.
What is worst is that now the system can't read any USB drive at all. It's like the formatting operation messed up deeply with the ability to even read - not mount - USB storage.
I am confident that all would be fixed with a reboot, but I would really like to understand what happened as it's the worst thing I've seen on happening on Ubuntu/Linux since a very very long time.
--- Update
Collecting more data. I've reboot, now it all works.
I'm following dmesg and here is when I connect the drive
[ 231.076775] usb 4-2: new SuperSpeed USB device number 6 using xhci_hcd
[ 231.092357] usb 4-2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[ 231.092362] usb 4-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 231.092363] usb 4-2: Product: DataTraveler 3.0
[ 231.092365] usb 4-2: Manufacturer: Kingston
[ 231.092365] usb 4-2: SerialNumber: E0D55E6B646416A088301608
[ 231.094095] usb-storage 4-2:1.0: USB Mass Storage device detected
[ 231.094256] scsi host1: usb-storage 4-2:1.0
[ 232.152947] scsi 1:0:0:0: Direct-Access Kingston DataTraveler 3.0 0000 PQ: 0 ANSI: 6
[ 232.153402] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 232.155981] sd 1:0:0:0: [sdb] 60538881 512-byte logical blocks: (31.0 GB/28.9 GiB)
[ 232.156313] sd 1:0:0:0: [sdb] Write Protect is off
[ 232.156319] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 232.156486] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 232.160723] sd 1:0:0:0: [sdb] Attached SCSI removable disk
And then I open file manager, select drive, get prompted for the password, insert password and BOOM:
[ 256.877406] gvfs-udisks2-vo[3433]: segfault at 6353346a10a8 ip 000076e53a7034dd sp 00007ffef7adff90 error 4 in libgio-2.0.so.0.8000.0[76e53a688000+117000] likely on CPU 3 (core 3, socket 0)
[ 256.877421] Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 55 48 89 e5 53 48 89 fb 48 83 ec 08 e8 4b fb ff ff 48 85 db 74 26 48 89 c6 <48> 8b 03 48 85 c0 74 05 48 39 30 74 0c 48 89 df e8 be ac f8 ff 85
[ 268.491624] usb 4-2: USB disconnect, device number 6
From now on, USB is no more :( If I insert another - fully working - drive, it says this:
[ 381.083454] usb 3-2: new high-speed USB device number 7 using xhci_hcd
[ 381.939522] usb 4-2: new SuperSpeed USB device number 8 using xhci_hcd
[ 381.962546] usb 4-2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.00
[ 381.962557] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 381.962560] usb 4-2: Product: DataTraveler 3.0
[ 381.962564] usb 4-2: Manufacturer: Kingston
[ 381.962566] usb 4-2: SerialNumber: 60A44C4252A8BEC1B993009F
[ 381.964704] usb-storage 4-2:1.0: USB Mass Storage device detected
[ 381.964882] scsi host1: usb-storage 4-2:1.0
[ 382.994556] scsi 1:0:0:0: Direct-Access Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[ 382.994943] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 383.314846] sd 1:0:0:0: [sdb] 61472768 512-byte logical blocks: (31.5 GB/29.3 GiB)
[ 383.315957] sd 1:0:0:0: [sdb] Write Protect is off
[ 383.315965] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 383.316913] sd 1:0:0:0: [sdb] No Caching mode page found
[ 383.316920] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[ 383.324153] GPT:Primary header thinks Alt. header is not at the end of the disk.
[ 383.324202] GPT:10105459 != 61472767
[ 383.324372] GPT:Alternate GPT header not at the end of the disk.
[ 383.324372] GPT:10105459 != 61472767
[ 383.324373] GPT: Use GNU Parted to correct GPT errors.
[ 383.324422] sdb: sdb1 sdb2 sdb3
[ 383.324760] sd 1:0:0:0: [sdb] Attached SCSI removable disk
So I try to format it again with Ext4/LUKS, and again it gets stuck and breaks USB until next reboot. Now I have the actual dmesg log of when it happened:
[ 1115.912238] usb 4-2: new SuperSpeed USB device number 12 using xhci_hcd
[ 1115.927852] usb 4-2: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[ 1115.927856] usb 4-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1115.927857] usb 4-2: Product: DataTraveler 3.0
[ 1115.927858] usb 4-2: Manufacturer: Kingston
[ 1115.927859] usb 4-2: SerialNumber: E0D55E6B646416A088301608
[ 1115.930130] usb-storage 4-2:1.0: USB Mass Storage device detected
[ 1115.930214] scsi host1: usb-storage 4-2:1.0
[ 1116.963490] scsi 1:0:0:0: Direct-Access Kingston DataTraveler 3.0 0000 PQ: 0 ANSI: 6
[ 1116.963922] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 1116.964937] sd 1:0:0:0: [sdb] 60538881 512-byte logical blocks: (31.0 GB/28.9 GiB)
[ 1116.965307] sd 1:0:0:0: [sdb] Write Protect is off
[ 1116.965314] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 1116.965521] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1116.970156] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[ 1231.108091] DMAR: DRHD: handling fault status reg 3
[ 1231.108116] DMAR: [DMA Read NO_PASID] Request device [00:14.0] fault addr 0xfd809000 [fault reason 0x06] PTE Read access is not set
[ 1251.605343] atkbd serio0: Unknown key pressed (translated set 2, code 0xf8 on isa0060/serio0).
[ 1251.605354] atkbd serio0: Use 'setkeycodes e078 <keycode>' to make it known.
[ 1252.963518] xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command
[ 1252.963555] xhci_hcd 0000:00:14.0: xHCI host controller not responding, assume dead
[ 1252.963577] xhci_hcd 0000:00:14.0: HC died; cleaning up
[ 1252.963604] usb 3-1: USB disconnect, device number 2
[ 1252.963826] usb 3-6: USB disconnect, device number 3
[ 1252.963869] usb 4-1: USB disconnect, device number 2
[ 1252.963872] usb 4-1.1: USB disconnect, device number 3
[ 1252.964439] usb 3-10: USB disconnect, device number 4
[ 1253.002848] usb 4-2: USB disconnect, device number 12
[ 1253.009807] device offline error, dev sdb, sector 32808 op 0x1:(WRITE) flags 0x104000 phys_seg 2048 prio class 0
[ 1253.009823] Buffer I/O error on dev dm-2, logical block 40, lost async page write
[ 1253.009828] Buffer I/O error on dev dm-2, logical block 41, lost async page write
[ 1253.009831] Buffer I/O error on dev dm-2, logical block 42, lost async page write
[ 1253.009834] Buffer I/O error on dev dm-2, logical block 43, lost async page write
[ 1253.009837] Buffer I/O error on dev dm-2, logical block 44, lost async page write
[ 1253.009840] Buffer I/O error on dev dm-2, logical block 45, lost async page write
[ 1253.009842] Buffer I/O error on dev dm-2, logical block 46, lost async page write
[ 1253.009845] Buffer I/O error on dev dm-2, logical block 47, lost async page write
[ 1253.009852] Buffer I/O error on dev dm-2, logical block 48, lost async page write
[ 1253.009856] Buffer I/O error on dev dm-2, logical block 49, lost async page write
[ 1253.012207] sdb: detected capacity change from 60538881 to 0
[ 1253.012208] dmcrypt_write/2: attempt to access beyond end of device
sdb: rw=1048577, sector=35245, nr_sectors = 1 limit=0
[ 1253.012220] dmcrypt_write/2: attempt to access beyond end of device
sdb: rw=1048577, sector=35246, nr_sectors = 1 limit=0