PSA PSA PSA: if you use LVM with USB drives you will get absolutely *abysmal* performance by default (especially on HDDs). You must use `pvcreate --dataalignment 2048s` to fix it. Fix requires re-creating PV and copying all data.
-
Show this thread
-
Seriously, on most current drives (512e) random write performance will be *abso-fucking-lutely atrocious* unless you fix this, and SSDs will have increased wear.
1 reply 3 retweets 6 likesShow this thread -
This happens because the USB drive maximum transfer size is 65535 sectors, and LVM in its infinite wisdom decides that's a good alignment value for PVs, thus de-aligning the physical sectors/FS blocks completely, causing read-modify-write cycles for every single small write.
2 replies 2 retweets 20 likesShow this thread -
Replying to @marcan42
Apparently querying /sys/block/$disk/queue/physical_block_size was too hard??
1 reply 0 retweets 0 likes -
Replying to @rsroobre
The problem is they queried /sys/block/$disk/queue/optimal_io_size and trusted it over physical_block_size. And: # sg_inq -p 0xb0 /dev/sda [...] Optimal transfer length granularity: 8 blocks Maximum transfer length: 65535 blocks Optimal transfer length: 65535 blocks
1 reply 0 retweets 0 likes -
Replying to @marcan42
Is that normal for USB drives? My SanDisk Extreme reports 0 as optimal_io_size.
1 reply 0 retweets 0 likes
I think it might be mostly UAS drives, perhaps only SATA bridges. I have at least two that do it from different vendors.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.