Mounting USB drives: hit and miss

I am quite certain that your issues relate to how you mount your devices maybe even how you intialize your device.

If you install the package gvfs - it pulls in - among others the udisks2 package.

On my system - using the above - mounting issues never happens unless the device is malconfigured.

One way to create issues like yours is if you have misconfigured your device by e.g. running mkfs on the device itself instead of the partition - examples below

Never do

 mkfs.ext4 /dev/sdy

Always do

mkfs.ext4 /dev/sdyX

It’s already there:

$ pacman -Q gvfs
gvfs 1.48.1-1

I will reformat after I receive my replacement.

Thanks

Isn’t this an intermittent issue? You said it works, but then sometimes it does not.

Or has it changed, and now it never works?

What did your recent kernel messages reveal shortly after plugging in the USB drive?

It’s intermittent

Aug 11 08:40:39 el-tadpole kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
Aug 11 08:40:39 el-tadpole kernel: sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR>
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: new high-speed USB device number 13 using xhci_hcd
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: New USB device found, idVendor=2109, idProduct=0711, bcdDevice= 1>
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: Product: USB3.0 SATA Bridge
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: Manufacturer: VIA Labs,Inc.
Aug 11 08:40:40 el-tadpole kernel: usb 1-2: SerialNumber: 000000000026
Aug 11 08:40:40 el-tadpole kernel: scsi host0: uas
Aug 11 08:40:40 el-tadpole mtp-probe[20024]: checking bus 1, device 13: "/sys/devices/pci0000:00/0000:00:08.1>
Aug 11 08:40:40 el-tadpole mtp-probe[20024]: bus: 1, device: 13 was not an MTP device
Aug 11 08:40:40 el-tadpole mtp-probe[20048]: checking bus 1, device 13: "/sys/devices/pci0000:00/0000:00:08.1>
Aug 11 08:40:40 el-tadpole mtp-probe[20048]: bus: 1, device: 13 was not an MTP device
Aug 11 08:40:43 el-tadpole kernel: scsi 0:0:0:0: Direct-Access              VirtualDisk           PQ: 0 ANSI:>
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_OK driver>
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Sense Key : Illegal Request [current] 
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Add. Sense: Invalid command operation code
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] 0-byte physical blocks
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Test WP failed, assume Write Enabled
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Asking for cache data failed
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of p>
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_OK driver>
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Sense Key : Illegal Request [current] 
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Add. Sense: Invalid command operation code
Aug 11 08:40:43 el-tadpole kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Aug 11 08:40:48 el-tadpole kernel: usb 2-1.1: new SuperSpeed USB device number 7 using xhci_hcd
Aug 11 08:40:48 el-tadpole kernel: usb 2-1.1: New USB device found, idVendor=174c, idProduct=5106, bcdDevice=>
Aug 11 08:40:48 el-tadpole kernel: usb 2-1.1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
Aug 11 08:40:48 el-tadpole kernel: usb 2-1.1: Product: AS2105
Aug 11 08:40:48 el-tadpole kernel: usb 2-1.1: Manufacturer: ASMedia

and another worked

Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: new SuperSpeed USB device number 4 using xhci_hcd
Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: New USB device found, idVendor=174c, idProduct=5106, bcdDevice= 0.01
Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: Product: AS2105
Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: Manufacturer: ASMedia
Aug 11 08:56:29 el-tadpole kernel: usb 2-1.1: SerialNumber: 00000000000000000000
Aug 11 08:56:29 el-tadpole mtp-probe[1617]: checking bus 2, device 4: "/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb2/2-1/2-1.1"
Aug 11 08:56:29 el-tadpole mtp-probe[1617]: bus: 2, device: 4 was not an MTP device
Aug 11 08:56:30 el-tadpole kernel: usb 2-1.1: UAS is ignored for this device, using usb-storage instead
Aug 11 08:56:30 el-tadpole kernel: usb-storage 2-1.1:1.0: USB Mass Storage device detected
Aug 11 08:56:30 el-tadpole kernel: scsi host0: usb-storage 2-1.1:1.0
Aug 11 08:56:30 el-tadpole kernel: usbcore: registered new interface driver usb-storage
Aug 11 08:56:30 el-tadpole kernel: usbcore: registered new interface driver uas
Aug 11 08:56:30 el-tadpole mtp-probe[1652]: checking bus 2, device 4: "/sys/devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb2/2-1/2-1.1"
Aug 11 08:56:30 el-tadpole mtp-probe[1652]: bus: 2, device: 4 was not an MTP device
Aug 11 08:56:31 el-tadpole kernel: scsi 0:0:0:0: Direct-Access     ASMT     2105             0    PQ: 0 ANSI: 6
Aug 11 08:56:31 el-tadpole kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Aug 11 08:56:39 el-tadpole kernel: sd 0:0:0:0: [sda] 732566646 4096-byte logical blocks: (3.00 TB/2.73 TiB)
Aug 11 08:56:39 el-tadpole kernel: sd 0:0:0:0: [sda] Write Protect is off
Aug 11 08:56:39 el-tadpole kernel: sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Aug 11 08:56:39 el-tadpole kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Aug 11 08:56:39 el-tadpole kernel:  sda: sda1
Aug 11 08:56:39 el-tadpole kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Aug 11 08:56:43 el-tadpole kernel: EXT4-fs (sda1): warning: checktime reached, running e2fsck is recommended
Aug 11 08:56:43 el-tadpole udisksd[1163]: Mounted /dev/sda1 at /run/media/froggy/drive-b on behalf of uid 1000
Aug 11 08:56:43 el-tadpole kernel: EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.

Thanks

That’s the output from the same device? Did you try on a different computer?

If this intermittent issue is happening with different drives, different ports, and different USB enclosures, something is amiss…

If you have another computer to test this on, it might narrow down the issue.


Anyone reading this thread familiar with the above error messages for the USB device? Usually when I see something like,

[sda] 0 512-byte logical blocks: (0 B/0 B)
[sda] 0-byte physical blocks

…it indicates a hardware problem.

Here’s a shot in the dark, perhaps try increasing the initialization wait time, ala this ten-year old post from the Arch BBS.

You can make your own custom .conf file under /etc/modprobe.d/

sudo nano /etc/modprobe.d/99-usb-storage-delay.conf

With the following entry added inside:

options usb_storage delay_use=5

This tells it to wait 5 seconds for the drive to initialize. (You can try a longer wait time if you prefer.) I’m assuming you know how to use nano.


Reboot with the new changes and try plugging in a drive again?


To check if the option has been applied, after rebooting (or manually unloading/re-loading the kernel module),

cat /sys/module/usb_storage/parameters/delay_use

Did you check the USB cable? Try connecting with a different one?

Yes. 2 different usb toasters with 2 different cables.

I have no tried another laptop. I will try that over the weekend when I can borrow one.

Thanks

Did you try the steps from post #10?

Not yet. Tonight, I’m receiving a brand new 4tb western digital, then I’ll be able to test if the problem is old drive against the brand new one.

Thanks

Further info.

It looks like it’s Manjaro related. I downloaded Opensuse Leap kde 15.3 live, it’s fairly small live system. I tried this afternoon with most of the possible combinations (2 usb toasters + cables) and I didn’t have any problem.

What detects the USB and the end device? Is it the kernel or something else?

leap 15.3 runs 5.3.18.xxx with many things backported from 5.4.

I have tested Manjaro with 5.10 a couple of times and it worked (but not fully tested yet).

Rule out the initialization wait time. Doesn’t hurt to try. :wink:

Different distros might ship with different parameters.

Will do

Thanks

Just confirmed, and you’re correct. openSUSE LEAP feels more “enterprise-y” to me. They even ship out with Firefox ESR, which is Firefox’s “LTS” channel, currently on version 78.

So after ruling out the initialization wait time, if even 5 seconds doesn’t work, then two other things to try and narrow this down:

  • Try with kernel 5.4 on Manjaro
    – Does it seem fully resolved under this environment?
  • Try with openSUSE Tumbleweed live ISO, which uses the latest kernel
    – Does it occur intermittently under this environment?

EDIT:

This is another indication that it might be related to kernel 5.13.

If it works fully under LTS kernel 5.10, then you don’t need to test this again with LTS kernel 5.4.

This indicates your filesystem needs repair.

First unmount

sudo umount /dev/sda1

Then run fsck - if the filesystem is severely damaged you will be asked a lot of times if you want to fix it - so I recommend using the -y argument

sudo fsck /dev/sda1 -y

This should fix your device without your intervention

Always sync your device before unplugging - only when the command has executed and the prompt returns - it is safe to unplug the device

sync

Or if you eject it from the filemanager - always wait until cache has been flushed to device.

If you forget the above it will lead to filesystem errors because the write is interrupted when you unplug the device.

1 Like

Did try, it did not work at all. 5.4 on Manjaro only boot then I could switch to console 2 and reboot:

-- Journal begins at Mon 2021-08-09 06:51:50 PDT, ends at Thu 2021-08-12 07:54:50 PDT. --
Aug 12 07:27:39 el-tadpole kernel: cgroup2: Unknown parameter 'memory_recursiveprot'
Aug 12 07:27:39 el-tadpole kernel: snd_pci_acp3x 0000:04:00.5: Invalid ACP audio mode : 0
Aug 12 07:27:39 el-tadpole kernel: proc: Bad value for 'hidepid'
Aug 12 07:27:39 el-tadpole kernel: proc: Bad value for 'hidepid'
Aug 12 07:28:24 el-tadpole systemd-coredump[1113]: [🡕] Process 1094 (appimagelaunche) of user 1000 dumped cor>
                                                   
                                                   Stack trace of thread 1094:
                                                   #0  0x00007fdf8cbbe180 _ZNK4QDireqERKS_ (libQt5Core.so.5 +>
                                                   #1  0x000055637ea565ce n/a (appimagelauncherd + 0x215ce)
                                                   #2  0x000055637ea43a4f n/a (appimagelauncherd + 0xea4f)
                                                   #3  0x00007fdf8cce175b n/a (libQt5Core.so.5 + 0x2f075b)
                                                   #4  0x00007fdf8cce572b _ZN6QTimer7timeoutENS_14QPrivateSig>
                                                   #5  0x00007fdf8ccd741f _ZN7QObject5eventEP6QEvent (libQt5C>
                                                   #6  0x00007fdf8ccaa378 _ZN16QCoreApplication15notifyIntern>
                                                   #7  0x00007fdf8cd0234d _ZN14QTimerInfoList14activateTimers>
                                                   #8  0x00007fdf8cd02c4a n/a (libQt5Core.so.5 + 0x311c4a)
                                                   #9  0x00007fdf8deb310c g_main_context_dispatch (libglib-2.>
                                                   #10 0x00007fdf8df06b99 n/a (libglib-2.0.so.0 + 0xa7b99)
                                                   #11 0x00007fdf8deb0871 g_main_context_iteration (libglib-2>
                                                   #12 0x00007fdf8cd02fd6 _ZN20QEventDispatcherGlib13processE>
                                                   #13 0x00007fdf8cca8d1c _ZN10QEventLoop4execE6QFlagsINS_17P>
                                                   #14 0x00007fdf8ccb1284 _ZN16QCoreApplication4execEv (libQt>
                                                   #15 0x000055637ea42189 n/a (appimagelauncherd + 0xd189)
                                                   #16 0x00007fdf8c61bb25 __libc_start_main (libc.so.6 + 0x27>
                                                   #17 0x000055637ea4269e n/a (appimagelauncherd + 0xd69e)
Aug 12 07:28:42 el-tadpole kernel: watchdog: watchdog0: watchdog did not stop!

5.10 works right now.

Thanks

At this point, I don’t think so. I think that it’s something related to my crashes with connecting to the usb toaster.

Here’s the same drive current:

$ sudo e2fsck -n /dev/sda1
e2fsck 1.46.3 (27-Jul-2021)
drive-b: clean, 778555/183148544 files, 474838834/732566272 blocks

No write has been done to this drive in the last 5 days. But thank you for prompting me to check it again and putting my mind at ease.

Thanks

The over-arching problem might be related to the kernel and how it handles the USB bays, since this intermittent issue occurs with different drives, different cables, different bays:

:white_check_mark: Works under Manjaro, with LTS kernel 5.10 (so far, so good?)

:white_check_mark: Works under openSUSE LEAP, with kernel 5.3 + backports

:x: Intermittent issues under Manjaro, with kernel 5.13

:grey_question: Does increasing the initialization wait time make a difference in the intermittent environments?

:grey_question: Does this problem occur with openSUSE Tumbleweed, with kernel 5.13?


I left out LTS kernel 5.4, since LTS kernel 5.10 seems to be working (and is a more recent kernel), plus you had boot-related issues with 5.4 (which is probably unrelated to this.)


What USB bays / enclosures are you using? It might be useful to others that are facing a similar problem. :thinking:


I’ll leave it at that.

1 Like

I tried the delay on both with Manjaro 5.10 and Leap 5.3.8 and it seems not to affect the result 1 second delay vs 5 seconds delay

I’m not willing to try Tumbleweed. The last time, 3 years ago, I did use Tumbleweed and I had major crashes that corrupted my data.

I have 2 usb toasters:

  1. mediasonic
  2. thermaltake blackx

Thanks

That rules that out!


I didn’t suggest to use Tumbleweed, per se, but rather to try narrowing this down to perhaps kernel 5.13 (or anything later than LTS 5.10). Since it worked on openSUSE LEAP (kernel 5.3), yet the same intermittent issues occur under openSUSE Tumbleweed (kernel 5.13), it’s safe to say that the kernel (above LTS 5.10) is likely the culprit, regardless of distro.


I have neither of those particular USB bays, yet I do have two other brands I might test this out on. I only use LTS kernels, so color me lucky. :wink:

Maybe this is yet another reason to stick with the latest offerings of the LTS kernels, and jump from LTS to LTS.


EDIT: As it stands now, using LTS kernel 5.10 seems to be the “solution”.