Add no_prefetch_block_bitmaps for external USB drive via udisks

After long searching I stumbled across the reason why after migrating to 15.4 all of my external USB drives are just playing with themselves immediately after mounting ( Mounting External Hard Drives in Docking Station Caues Temporary “Thrashing” After 15.4 Upgrade )

I’d like to add the option “no_prefetch_block_bitmaps” to the automount processing of all USB drives, but somehow that seems not possible via udisks. I’ve tried to do that by adding a new file

/etc/udisks2/mount_options.conf

with this content

[defaults]
defaults=no_prefetch_block_bitmaps

but that doesn’t work and just locks out any USB drive from being mounted.

Is it simply that this option cannot be used with udisks yet or what am I doing wrong here?

Thanx a ton
tuxEvangelist

Your USB drives are formatted as ext4?

That’s one more annoying thing - No!

They are formatted in ext3, so from my understanding ext4lazyinit should not bother those drives anyway?!?

I do not know what “bother” means in this context, but you have invalid mount option that is not supported by filesystem, so mounting fails. Check dmesg output.

After plugging in the USB drive, dmesg shows

[25725.408447] sd 2:0:0:0: [sda] Synchronizing SCSI cache
[25725.687362] sd 2:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[25995.702241] usb 2-4: new SuperSpeed USB device number 3 using xhci_hcd
[25995.723291] usb 2-4: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 2.09
[25995.723300] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[25995.723303] usb 2-4: Product: USB3.0 Device
[25995.723305] usb 2-4: Manufacturer: Intenso
[25995.723307] usb 2-4: SerialNumber: 201914137F4CE
[25995.727504] scsi host2: uas
[25995.728206] scsi 2:0:0:0: Direct-Access     Intenso  SCSI             0209 PQ: 0 ANSI: 6
[25995.729897] sd 2:0:0:0: Attached scsi generic sg0 type 0
[25999.797028] sd 2:0:0:0: [sda] 1220942646 4096-byte logical blocks: (5.00 TB/4.55 TiB)
[25999.797221] sd 2:0:0:0: [sda] Write Protect is off
[25999.797224] sd 2:0:0:0: [sda] Mode Sense: 53 00 00 08
[25999.797649] sd 2:0:0:0: [sda] Disabling FUA
[25999.797652] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[25999.798044] sd 2:0:0:0: [sda] Optimal transfer size 33550336 bytes
[25999.853968]  sda: sda1
[25999.871396] sd 2:0:0:0: [sda] Attached SCSI disk

Then, after trying to mount the drive via the GUI, I get the error popup saying

“This device cannot be mounted”

dmesg does not show any new entry after I try to mount.

When I comment the line containing the no_prefetch option in /etc/udisks2/mount_options.conf everything works again.

bor@10:~> udisksctl mount -b /dev/sdd1
Error mounting /dev/sdd1: GDBus.Error:org.freedesktop.UDisks2.Error.OptionNotPermitted: Mount option `no_prefetch_block_bitmaps' is not allowed
bor@10:~> cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.4"

OK, thanks, copy that.

Do you see any other possibility to give that mount-option generally to all external USB-drives (present and future ones)?
Basically I do not care if this is done via udisks or some other mechanism.

What I’d like to avoid is having to configure every single one of theses devices manually in /etc/fstab. This is bound to be forgotten when the next new device comes along in some weeks or so :open_mouth:

If you insist …

bor@10:~> sudo cat /etc/udisks2/mount_options.conf
[defaults]
defaults=no_prefetch_block_bitmaps
allow=no_prefetch_block_bitmaps
bor@10:~> 

Hi arvidjaar,

OK, getting closer :slight_smile:

That works for the external HDDs plugged in via USB.

It does not work for SD cards plugged in via an USB adapter, there I get this error message:

kernel: [ 1754.345947][ T5489] FAT-fs (sdb1): Unrecognized mount option "no_prefetch_block_bitmaps" or missing value

Is there an option to decide between a HDD and a SD card plugged in via USB? Maybe via the file system used on the device?

Regards
tuxEvangelist

You stubbornly refuse to understand that it has nothing to do with physical media technology.

You wanted this option for all filesystems, you got this option for all filesystems. You got exactly what you asked for, even though I hinted several times that this option is filesystem specific.

ext3_defaults=... in /etc/udisks2/mount_options.conf.

Thanks, works as desired now, can be marked as solved.

Regards
tuxEvangelist