Re: Mounting USB Storage devices with "sync" option ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, 2 February 2024 21:47:00 GMT Dominique Martinet wrote:
> So I think Florian is correct in that barriers won't be issued on
> these disks, and if they internally have such a cache it'd probably be
> unsafe...
> 
> Now does the disk itself know that it's in such an enclosure and
> properly behaves as write through?
> I think we'd have a lot more corruptions on our hands if it was
> incorrect here, btrfs in particular is very sensitive to disks that
> lie with barriers but I'm not sure how much it's used on such drivers.
> 
As far as I can tell, having owned such an enclosure in the past, it doesn't 
tell the drive anything - it relies on the fact that SATA drives write back 
fairly aggressively when the command interface is idle, and thus the cache is 
fully written back to the medium when it's idle for a few seconds. If you go 
through the sequence "remove safely", then wait for UI confirmation, then 
unplug the USB port, it'll usually have written back the cache before you 
physically move your hands to the USB cable.

As these enclosures aren't particularly fast (for example, commands must 
complete in issue order, rather than being able to complete out of order as in 
TCQ/NCQ), I suspect most users of them don't use btrfs or xfs on them (I'd 
expect ext4 if Linux-only, FAT32, exFAT or NTFS if shared between OSes); 
they're basically intended to let you have a huge "thumb drive" for machine-
to-machine transfer, and they're fine in that use case.

On the other hand, turning on the "sync" mount option doesn't help with these 
enclosures; if anything, it'll make things worse by increasing the number of 
commands in flight which have to be handled before the drive switches to 
cleaning its cache.
-- 
Simon Farnsworth

--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux