Mounting USB drives: hit and miss

Sometimes my system mount the drive and sometimes it doesn’t. The external drive is ext4.

Sometimes it mounts the drive. Sometimes it sees the drive but doesn’t mount it, then I use.

udisksctl mount -b /dev/sda1

Here is one when it doesn’t mount:

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   2.7T  0 disk 
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0 460.1G  0 part /
└─nvme0n1p3 259:3    0  16.6G  0 part [SWAP]

and

$ inxi -Fxxx
System:    Host: el-tadpole Kernel: 5.13.8-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
           Desktop: KDE Plasma 5.22.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM Distro: Manjaro Linux 
           base: Arch Linux 
Machine:   Type: Convertible System: LENOVO product: 81X2 v: IdeaPad Flex 5 14ARE05 
           serial: <superuser required> Chassis: type: 31 v: IdeaPad Flex 5 14ARE05 
           serial: <superuser required> 
           Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN serial: <superuser required> UEFI: LENOVO 
           v: EECN36WW date: 05/17/2021 
Battery:   ID-1: BAT0 charge: 31.4 Wh (59.8%) condition: 52.5/52.5 Wh (100.0%) volts: 11.4 min: 11.5 
           model: Celxpert L19C3PD6 type: Li-poly serial: 3876 status: Unknown cycles: 1 
CPU:       Info: 8-Core model: AMD Ryzen 7 4700U with Radeon Graphics bits: 64 type: MCP arch: Zen 2 
           rev: 1 cache: L2: 4 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 31948 
           Speed: 3226 MHz min/max: 1400/2000 MHz boost: enabled Core speeds (MHz): 1: 3226 2: 3720 
           3: 2435 4: 2447 5: 2709 6: 3967 7: 2585 8: 3278 
Graphics:  Device-1: AMD Renoir vendor: Lenovo driver: amdgpu v: kernel bus-ID: 04:00.0 chip-ID: 1002:1636 
           class-ID: 0300 
           Device-2: Syntek Integrated Camera type: USB driver: uvcvideo bus-ID: 1-4:3 chip-ID: 174f:243f 
           class-ID: 0e02 serial: 200901010001 
           Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: loaded: amdgpu 
           resolution: 2560x1080~60Hz s-dpi: 96 
           OpenGL: renderer: AMD RENOIR (DRM 3.41.0 5.13.8-1-MANJARO LLVM 12.0.1) v: 4.6 Mesa 21.1.6 
           direct render: Yes 
Audio:     Device-1: AMD driver: snd_hda_intel v: kernel bus-ID: 04:00.1 chip-ID: 1002:1637 class-ID: 0403 
           Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor vendor: Lenovo driver: N/A 
           bus-ID: 04:00.5 chip-ID: 1022:15e2 class-ID: 0480 
           Device-3: AMD Family 17h HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel 
           bus-ID: 04:00.6 chip-ID: 1022:15e3 class-ID: 0403 
           Sound Server-1: ALSA v: k5.13.8-1-MANJARO running: yes 
           Sound Server-2: JACK v: 1.9.19 running: no 
           Sound Server-3: PulseAudio v: 15.0 running: yes 
           Sound Server-4: PipeWire v: 0.3.33 running: no 
Network:   Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter vendor: Lenovo 
           driver: rtw_8822ce v: N/A port: 2000 bus-ID: 02:00.0 chip-ID: 10ec:c822 class-ID: 0280 
           IF: wlp2s0 state: up mac: dc:e9:94:8b:d2:cf 
           Device-2: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 bus-ID: 2-1.4:3 
           chip-ID: 0bda:8153 class-ID: 0000 serial: 000001 
           IF: enp4s0f3u1u4 state: down mac: 00:24:32:50:06:15 
Bluetooth: Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8 bus-ID: 3-4:3 
           chip-ID: 0bda:c123 class-ID: e001 serial: 00e04c000001 
           Report: rfkill ID: hci0 rfk-id: 3 state: down bt-service: disabled rfk-block: hardware: no 
           software: yes address: see --recommends 
Drives:    Local Storage: total: 3.19 TiB used: 74.08 GiB (2.3%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB512HBJQ-000L2 size: 476.94 GiB speed: 31.6 Gb/s 
           lanes: 4 type: SSD serial: S4DYNX0NC97066 rev: 3L1QEXF7 temp: 39.9 C scheme: GPT 
           ID-2: /dev/sda type: USB vendor: Western Digital model: WD30EFRX-68EUZN0 size: 2.73 TiB 
           type: HDD rpm: 5400 serial: WD-WCC4N1EFVRS2 scheme: GPT 
Partition: ID-1: / size: 451.77 GiB used: 74.06 GiB (16.4%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /boot/efi size: 299.4 MiB used: 17.2 MiB (5.8%) fs: vfat dev: /dev/nvme0n1p1 
Swap:      ID-1: swap-1 type: partition size: 16.58 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 50.9 C mobo: 40.0 C gpu: amdgpu temp: 43.0 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 217 Uptime: 19m wakeups: 5 Memory: 15.01 GiB used: 2.15 GiB (14.3%) Init: systemd 
           v: 248 Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: pacman: 1445 Shell: Bash v: 5.1.8 
           running-in: konsole inxi: 3.3.06 

it didn’t find /dev/sda1

BTW, the same thing happens on multiple drives and multiple external hard drive toaster and multiple usb ports.

How do I track this down?

Thanks

when your device partition table is not found then it is probably misconfigured.

Check dmesg shortly after plugging in the drive and waiting long enough to accept that it “failed” to properly mount and/or detect the partitions.

So perhaps 30 seconds after you plug in the drive and nothing happens:

sudo dmesg | tail -n 100

Change -n 100 to however many lines of text (from the most recent messages) you think is enough.

1 Like
  1. This was created with gparted. GPT and all the drive as ext4
  2. The problem is that it’s intermittent. Sometimes the partition table is found, sometimes not.

Thanks

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