You are not logged in.

#1 2021-02-08 09:31:19

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

[soIved] Issue disconnecting USB drives from cardreaders, extenders

When using either an extender cable, a hub a cardreader or even just the front panel USB ports (which is an extender I guess) I get errors when disconnecting any thumbdrive or sdcard. That doesn't happen when working on the USB ports directly on the motherboard on the rear IO panel. I thought it was a problem with my drives, but I tried a dozen of them and it's very consistent.

I must say, apart from the error, the drives seem to be working without problems. Any suggestion?

Errors as follow:

journalctl

kernel: blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
kernel: Buffer I/O error on dev sdc, logical block 0, async page read
kernel: blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
kernel: Buffer I/O error on dev sdc, logical block 0, async page read
kernel: blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
kernel: Buffer I/O error on dev sdc, logical block 0, async page read
kernel: blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
kernel: Buffer I/O error on dev sdc, logical block 0, async page read
kernel: blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
kernel: Buffer I/O error on dev sdc, logical block 0, async page read

dmesg

[ 1421.859001] scsi 1:0:0:0: Direct-Access     SanDisk  Cruzer Blade     1.26 PQ: 0 ANSI: 6
[ 1421.871582] sd 1:0:0:0: [sdc] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[ 1421.874574] sd 1:0:0:0: [sdc] Write Protect is off
[ 1421.874576] sd 1:0:0:0: [sdc] Mode Sense: 43 00 00 00
[ 1421.876579] sd 1:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 1421.937340]  sdc: sdc1
[ 1421.950629] sd 1:0:0:0: [sdc] Attached SCSI removable disk
[ 1673.380230] sd 1:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 1673.380233] sd 1:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] 
[ 1673.380234] sd 1:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[ 1673.380235] sd 1:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 1673.380237] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1673.380240] Buffer I/O error on dev sdc, logical block 0, async page read
[ 1673.607242] sd 1:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 1673.607246] sd 1:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] 
[ 1673.607248] sd 1:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[ 1673.607250] sd 1:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 1673.607252] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1673.607256] Buffer I/O error on dev sdc, logical block 0, async page read
[ 1673.607290] ldm_validate_partition_table(): Disk read failed.
[ 1673.847236] sd 1:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 1673.847240] sd 1:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] 
[ 1673.847242] sd 1:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[ 1673.847245] sd 1:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 1673.847247] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1673.847252] Buffer I/O error on dev sdc, logical block 0, async page read
[ 1674.087266] sd 1:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 1674.087270] sd 1:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] 
[ 1674.087272] sd 1:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[ 1674.087274] sd 1:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 1674.087277] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1674.087281] Buffer I/O error on dev sdc, logical block 0, async page read
[ 1674.354233] sd 1:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 1674.354238] sd 1:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] 
[ 1674.354240] sd 1:0:0:0: [sdc] tag#0 Add. Sense: Medium not present
[ 1674.354242] sd 1:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 1674.354244] blk_update_request: I/O error, dev sdc, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1674.354249] Buffer I/O error on dev sdc, logical block 0, async page read
[ 1674.354283]  sdc: unable to read partition table
[ 1701.128510] usb 1-3: USB disconnect, device number 5

PS1: I tried with ferrite rings.
PS2: Fixing the drives with fsck doesn't report errors

Last edited by Matt3o (2021-03-22 16:17:37)

Offline

#2 2021-02-11 07:38:57

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

It turned out that if I do "unpower device" instead of "eject" I get no error, but this still doesn't explain why it works with the back panel IO USB...

Offline

#3 2021-02-11 08:52:31

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

What is "eject"? /usr/bin/eject? (which operates tray of optical drives…)
Is this related to some filemanger?

You're supposed to sync+umount the device, the hub might be mistaken for a removable device (ie. eject passes w/o "-F" because it doesn't know what's behind)

Offline

#4 2021-02-11 10:35:29

tpfkanep
Member
From: South Africa
Registered: 2009-12-15
Posts: 121

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

What is "eject"? /usr/bin/eject? (which operates tray of optical drives…)

from man page:

eject  allows  removable  media  (typically a CD-ROM, floppy disk, tape, JAZ, ZIP or USB disk) to be ejected under software control.

I have had no issues with ejecting USB drives... but mine is never connected to a hub. OTOH, I had mixed results with extender cables, so I try and avoid those cables.

Offline

#5 2021-02-11 13:11:40

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

seth wrote:

What is "eject"? /usr/bin/eject? (which operates tray of optical drives…)
Is this related to some filemanger?

PCManFM and udiskie mostly.

Offline

#6 2021-02-11 15:02:54

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Do you get the same errors when running "eject -F /dev/sdb1" on the "good" port?

Offline

#7 2021-02-11 20:02:03

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

seth wrote:

Do you get the same errors when running "eject -F /dev/sdb1" on the "good" port?

nope, all good

udisksd[759]: Mounted /dev/sda at /run/media/matteo/7206-45B1 on behalf of uid 1000
udisksd[759]: Cleaning up mount point /run/media/matteo/7206-45B1 (device 8:0 is not mounted)
udisksd[759]: Unmounted /dev/sda on behalf of uid 1000

Offline

#8 2021-02-11 22:44:05

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Looked at pcmanfm sources, it uses udisks, so let's compare

qdbus --system org.freedesktop.UDisks /org/freedesktop/UDisks/devices/sda  org.freedesktop.UDisks.Device.DriveIsMediaEjectable

on a good and a bad port.

Offline

#9 2021-02-12 08:12:54

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Thanks for your continued support seth.

I'm not able to execute the command you posted. I can do this

qdbus --system org.freedesktop.UDisks2 /org/freedesktop/UDisks2/block_devices/sda

and options from there are:

org.freedesktop.UDisks2.Block.Configuration          -- read {D-Bus type "a(sa{sv})"}
org.freedesktop.UDisks2.Block.CryptoBackingDevice    -- read QDBusObjectPath
org.freedesktop.UDisks2.Block.DeviceNumber           -- read qulonglong
org.freedesktop.UDisks2.Block.Device                 -- read QByteArray
org.freedesktop.UDisks2.Block.Drive                  -- read QDBusObjectPath
org.freedesktop.UDisks2.Block.HintAuto               -- read bool
org.freedesktop.UDisks2.Block.HintIconName           -- read QString
org.freedesktop.UDisks2.Block.HintIgnore             -- read bool
org.freedesktop.UDisks2.Block.HintName               -- read QString
org.freedesktop.UDisks2.Block.HintPartitionable      -- read bool
org.freedesktop.UDisks2.Block.HintSymbolicIconName   -- read QString
org.freedesktop.UDisks2.Block.HintSystem             -- read bool
org.freedesktop.UDisks2.Block.IdLabel                -- read QString
org.freedesktop.UDisks2.Block.Id                     -- read QString
org.freedesktop.UDisks2.Block.IdType                 -- read QString
org.freedesktop.UDisks2.Block.IdUsage                -- read QString
org.freedesktop.UDisks2.Block.IdUUID                 -- read QString
org.freedesktop.UDisks2.Block.IdVersion              -- read QString
org.freedesktop.UDisks2.Block.MDRaidMember           -- read QDBusObjectPath
org.freedesktop.UDisks2.Block.MDRaid                 -- read QDBusObjectPath
org.freedesktop.UDisks2.Block.PreferredDevice        -- read QByteArray
org.freedesktop.UDisks2.Block.ReadOnly               -- read bool
org.freedesktop.UDisks2.Block.Size                   -- read qulonglong
org.freedesktop.UDisks2.Block.Symlinks               -- read {D-Bus type "aay"}
org.freedesktop.UDisks2.Block.UserspaceMountOptions  -- read QStringList
org.freedesktop.UDisks2.Filesystem.MountPoints       -- read {D-Bus type "aay"}
org.freedesktop.UDisks2.Filesystem.Size              -- read qulonglong
org.freedesktop.UDisks2.Block.Format                  -- void(QString type, QVariantMap options)
org.freedesktop.UDisks2.Block.GetSecretConfiguration  -- {D-Bus type "a(sa{sv})"}(QVariantMap options)
org.freedesktop.UDisks2.Block.OpenDevice              -- QDBusUnixFileDescriptor(QString mode, QVariantMap options)
org.freedesktop.UDisks2.Block.OpenForBackup           -- QDBusUnixFileDescriptor(QVariantMap options)
org.freedesktop.UDisks2.Block.OpenForBenchmark        -- QDBusUnixFileDescriptor(QVariantMap options)
org.freedesktop.UDisks2.Block.OpenForRestore          -- QDBusUnixFileDescriptor(QVariantMap options)
org.freedesktop.UDisks2.Block.Rescan                  -- void(QVariantMap options)
org.freedesktop.UDisks2.Filesystem.Check              -- bool(QVariantMap options)
org.freedesktop.UDisks2.Filesystem.Mount              -- QString(QVariantMap options)
org.freedesktop.UDisks2.Filesystem.Repair             -- bool(QVariantMap options)
org.freedesktop.UDisks2.Filesystem.Resize             -- void(qulonglong size, QVariantMap options)
org.freedesktop.UDisks2.Filesystem.SetLabel           -- void(QString label, QVariantMap options)
org.freedesktop.UDisks2.Filesystem.TakeOwnership      -- void(QVariantMap options)
org.freedesktop.UDisks2.Filesystem.Unmount            -- void(QVariantMap options)

I looked around I can't find anything about "ejectable"

UPDATE.

So I found this instead

qdbus --system org.freedesktop.UDisks2 /org/freedesktop/UDisks2/drives/***DRIVENAME*** org.freedesktop.UDisks2.Drive.Ejectable

which gives me true from all USB ports

Last edited by Matt3o (2021-02-12 08:30:41)

Offline

#10 2021-02-12 08:23:25

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Meh.

lsblk -Ppno NAME,LABEL,MOUNTPOINT,FSTYPE,SIZE,TYPE,RM,MODEL,UUID

Edit: for good and bad port.

Last edited by seth (2021-02-12 08:23:52)

Offline

#11 2021-02-12 08:48:09

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

it seems to be this for all of them

NAME="/dev/sdb" LABEL="" MOUNTPOINT="/run/media/matteo/7206-45B1" FSTYPE="vfat" SIZE="7.5G" TYPE="disk" RM="1" MODEL="Trans-It_Drive" UUID="7206-45B1"

okay looking at that message I had an idea.. I use these drives and cards mostly for 3d printers so they have to be FAT... could that be the problem. I installed all I think that is necessary to handle those drives (dosfstools, exfat-utils, ...). I'll make some tests with other partitions

Offline

#12 2021-02-12 09:11:27

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

could that be the problem.

No.
And nothing there looks like the drive would be "ejectable".

qdbus --system org.freedesktop.UDisks2 /org/freedesktop/UDisks2/drives/<yourdrivehere> org.freedesktop.UDisks2.Drive.Ejectable

Offline

#13 2021-02-12 09:17:35

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

% qdbus --system org.freedesktop.UDisks2 /org/freedesktop/UDisks2/drives/TDKMedia_Trans_It_Drive_07990A03DA891CAE org.freedesktop.UDisks2.Drive.Ejectable 
true
% lsblk -Ppno NAME,LABEL,MOUNTPOINT,FSTYPE,SIZE,TYPE,RM,MODEL,UUID /dev/sda
NAME="/dev/sda" LABEL="" MOUNTPOINT="/run/media/matteo/7206-45B1" FSTYPE="vfat" SIZE="7.5G" TYPE="disk" RM="1" MODEL="Trans-It_Drive" UUID="7206-45B1"

Last edited by Matt3o (2021-02-12 09:18:27)

Offline

#14 2021-03-05 07:57:43

l0tek
Member
Registered: 2018-12-28
Posts: 29

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Same issue when disconnecting an sd card in gnome, kernel 5.11.2:

[ 4650.495265]  sdb: sdb1
[ 4650.500295] sd 1:0:0:1: [sdb] Attached SCSI removable disk
[ 4886.836046] sd 1:0:0:1: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 4886.836051] sd 1:0:0:1: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 4886.836055] sd 1:0:0:1: [sdb] tag#0 Add. Sense: Medium not present
[ 4886.836057] sd 1:0:0:1: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 4886.836059] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4886.836063] Buffer I/O error on dev sdb, logical block 0, async page read
[ 4886.836998] sd 1:0:0:1: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 4886.837004] sd 1:0:0:1: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 4886.837008] sd 1:0:0:1: [sdb] tag#0 Add. Sense: Medium not present
[ 4886.837012] sd 1:0:0:1: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 4886.837015] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4886.837020] Buffer I/O error on dev sdb, logical block 0, async page read
[ 4886.837031] ldm_validate_partition_table(): Disk read failed.
[ 4886.837919] sd 1:0:0:1: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 4886.837924] sd 1:0:0:1: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 4886.837927] sd 1:0:0:1: [sdb] tag#0 Add. Sense: Medium not present
[ 4886.837930] sd 1:0:0:1: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 4886.837932] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4886.837936] Buffer I/O error on dev sdb, logical block 0, async page read
[ 4886.838963] sd 1:0:0:1: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 4886.838966] sd 1:0:0:1: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 4886.838969] sd 1:0:0:1: [sdb] tag#0 Add. Sense: Medium not present
[ 4886.838972] sd 1:0:0:1: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 4886.838973] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4886.838976] Buffer I/O error on dev sdb, logical block 0, async page read
[ 4886.839857] sd 1:0:0:1: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=0s
[ 4886.839860] sd 1:0:0:1: [sdb] tag#0 Sense Key : Not Ready [current] 
[ 4886.839863] sd 1:0:0:1: [sdb] tag#0 Add. Sense: Medium not present
[ 4886.839865] sd 1:0:0:1: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 4886.839867] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4886.839870] Buffer I/O error on dev sdb, logical block 0, async page read
[ 4886.839901]  sdb: unable to read partition table
[ 4886.841969] sdb: detected capacity change from 0 to 62521344

Offline

#15 2021-03-15 14:24:07

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

unfortunately I can't seem to be able to fix this issue.

The best thing I can do is unmount the volume first and the eject it (or use eject from command line). I think the problem here is udisk... I'll try to contact them and report if anything comes out.

Offline

#16 2021-03-15 14:59:21

giannis-arch
Member
Registered: 2017-09-20
Posts: 20

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

I made some tests.  LXDE (pcmanfm without udiskie    and pcmanfm with udiskie)
The problem there is even without being installed the udiskie package.
But in an other system with XFCE and thunar (not with pcmanfm), there is not the problem.
So i believe it is a pcmanfm's bug and you can to ignore it.
I used a SanDisk Cruzer Blade USB stick 32GB in NTFS

Last edited by giannis-arch (2021-03-15 14:59:59)

Offline

#17 2021-03-15 22:25:38

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

giannis-arch wrote:

But in an other system with XFCE and thunar (not with pcmanfm)

if I use udisksctl from command line I get the same issue, so I tend to believe the problem is still udisk. Maybe thunar does something different (like it uses eject instead of udisk)

Offline

#18 2021-03-16 07:27:14

seth
Member
Registered: 2012-09-03
Posts: 49,986

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

https://archlinux.org/packages/community/any/udiskie/ is not "udisks" but an automount service, it is unrelated to anything here.
The thing that actually handles the mounts is gvfs

udisks2 considers regular usb keys "ejectable", so that's not the problem either.

[ 1673.607290] ldm_validate_partition_table(): Disk read failed.

It looks like the device is probed immediately after being "ejected" and the drive isn't quite ready to respond (ie. a race condition) - I guess gvfs should™ not partprobe "ejected" drives but do so when the (re-)appear?

https://gitlab.gnome.org/GNOME/gvfs/-/issues

Offline

#19 2021-03-22 16:16:14

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: [soIved] Issue disconnecting USB drives from cardreaders, extenders

Okay, this is the darn weirdest thing...

I changed monitor (the previous one was also an USB hub) and now all ports work as normal. I can use extensions, hubs, card readers with no issue whatsoever.

The new monitor is also an USB hub but it doesn't cause any issue. I would have never imagined....

Offline

Board footer

Powered by FluxBB