[kwlug-disc] udisksd slow to mount USB stick

Khalid Baheyeldin kb at 2bits.com
Thu Mar 24 11:30:07 EDT 2016


I am having a problem when I insert a USB disk in the laptop.

It takes a long time between when the partitions are recognized, to
when KDE notifies me that a partition has been mounted.

This is an older flash USB stick, but one that has not seen much use.
It is used as a sneaker net to scan documents from the multifunction
printer, and little else.

Look at the time stamps here

Mar 24 10:47:39 mylaptop kernel: [101321.648166] usb 2-2: new
high-speed USB device number 25 using ehci-pci
Mar 24 10:47:39 mylaptop kernel: [101321.780906] usb 2-2: New USB
device found, idVendor=08ec, idProduct=0016
Mar 24 10:47:39 mylaptop kernel: [101321.780911] usb 2-2: New USB
device strings: Mfr=1, Product=2, SerialNumber=3
Mar 24 10:47:39 mylaptop kernel: [101321.780914] usb 2-2: Product:
DataTraveler 2.0
Mar 24 10:47:39 mylaptop kernel: [101321.780917] usb 2-2: Manufacturer: Kingston
Mar 24 10:47:39 mylaptop kernel: [101321.780919] usb 2-2:
SerialNumber: SOMETHING
Mar 24 10:47:39 mylaptop kernel: [101321.781355] usb-storage 2-2:1.0:
USB Mass Storage device detected
Mar 24 10:47:39 mylaptop kernel: [101321.782098] scsi7 : usb-storage 2-2:1.0
Mar 24 10:47:40 mylaptop kernel: [101322.780683] scsi 7:0:0:0:
Direct-Access     Kingston DataTraveler 2.0 6.16 PQ: 0 ANSI: 0 CCS
Mar 24 10:47:40 mylaptop kernel: [101322.785012] sd 7:0:0:0: Attached
scsi generic sg2 type 0
Mar 24 10:47:40 mylaptop kernel: [101322.787310] sd 7:0:0:0: [sdb]
Attached SCSI removable disk
Mar 24 10:47:44 mylaptop kernel: [101326.425315] sd 7:0:0:0: [sdb]
2004991 512-byte logical blocks: (1.02 GB/978 MiB)
Mar 24 10:47:44 mylaptop kernel: [101326.426571] sd 7:0:0:0: [sdb] No
Caching mode page found
Mar 24 10:47:44 mylaptop kernel: [101326.426575] sd 7:0:0:0: [sdb]
Assuming drive cache: write through
Mar 24 10:47:44 mylaptop kernel: [101326.428810] sd 7:0:0:0: [sdb] No
Caching mode page found
Mar 24 10:47:44 mylaptop kernel: [101326.428813] sd 7:0:0:0: [sdb]
Assuming drive cache: write through
Mar 24 10:47:44 mylaptop kernel: [101326.430340]  sdb: sdb1
Mar 24 10:49:18 mylaptop udisksd[2398]: Mounted /dev/sdb1 at
/media/blah/FOO on behalf of uid 1000

>From 10:47:44 when sdb1 is listed, to 10:49:18 when udisksd mounts it,
which is 94 seconds

When I type mount I see:

/dev/sdb1 on /media/blah/FOO type vfat
(rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,flush,uhelper=udisks2)

Another newer USB disk mounts instantly:

Mar 24 11:12:10 mylaptop kernel: [102792.384052] usb 2-2: new
high-speed USB device number 27 using ehci-pci
Mar 24 11:12:11 mylaptop kernel: [102793.094641] usb 2-2: New USB
device found, idVendor=05dc, idProduct=a813
Mar 24 11:12:11 mylaptop kernel: [102793.094647] usb 2-2: New USB
device strings: Mfr=1, Product=2, SerialNumber=3
Mar 24 11:12:11 mylaptop kernel: [102793.094650] usb 2-2: Product: USB
Flash Drive
Mar 24 11:12:11 mylaptop kernel: [102793.094653] usb 2-2: Manufacturer: Lexar
Mar 24 11:12:11 mylaptop kernel: [102793.094655] usb 2-2:
SerialNumber: SOMETHING
Mar 24 11:12:11 mylaptop kernel: [102793.095050] usb-storage 2-2:1.0:
USB Mass Storage device detected
Mar 24 11:12:11 mylaptop kernel: [102793.095882] scsi9 : usb-storage 2-2:1.0
Mar 24 11:12:13 mylaptop kernel: [102795.406556] scsi 9:0:0:0:
Direct-Access     Lexar    USB Flash Drive  1100 PQ: 0 ANSI: 0 CCS
Mar 24 11:12:13 mylaptop kernel: [102795.407033] sd 9:0:0:0: Attached
scsi generic sg2 type 0
Mar 24 11:12:15 mylaptop kernel: [102797.181296] sd 9:0:0:0: [sdb]
31326208 512-byte logical blocks: (16.0 GB/14.9 GiB)
Mar 24 11:12:15 mylaptop kernel: [102797.182438] sd 9:0:0:0: [sdb]
Write Protect is off
Mar 24 11:12:15 mylaptop kernel: [102797.182447] sd 9:0:0:0: [sdb]
Mode Sense: 43 00 00 00
Mar 24 11:12:15 mylaptop kernel: [102797.183567] sd 9:0:0:0: [sdb] No
Caching mode page found
Mar 24 11:12:15 mylaptop kernel: [102797.183576] sd 9:0:0:0: [sdb]
Assuming drive cache: write through
Mar 24 11:12:15 mylaptop kernel: [102797.559164] sd 9:0:0:0: [sdb] No
Caching mode page found
Mar 24 11:12:15 mylaptop kernel: [102797.559172] sd 9:0:0:0: [sdb]
Assuming drive cache: write through
Mar 24 11:12:15 mylaptop kernel: [102797.560434]  sdb: sdb1
Mar 24 11:12:15 mylaptop kernel: [102797.566541] sd 9:0:0:0: [sdb] No
Caching mode page found
Mar 24 11:12:15 mylaptop kernel: [102797.566549] sd 9:0:0:0: [sdb]
Assuming drive cache: write through
Mar 24 11:12:15 mylaptop kernel: [102797.566555] sd 9:0:0:0: [sdb]
Attached SCSI removable disk
Mar 24 11:12:15 mylaptop udisksd[2398]: Mounted /dev/sdb1 at
/media/blah/BAR on behalf of uid 1000

It gets mounted in the same second as when the partition is recognized.

Mount is:

/dev/sdb1 on /media/blah/BAR type vfat
(rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,flush,uhelper=udisks2)

Note that there are no errors reported at all.

One guess is that the old flash drive has too many allocated sectors.
Could that account for this annoying lag?

If that is the case, how do I go about verifying that this is the cause?

If not, then what else could it be?
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple,
and wrong." -- H.L. Mencken





More information about the kwlug-disc mailing list