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

2024-02-05 Thread Simon Farnsworth via devel
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 >

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

2024-02-02 Thread Dominique Martinet
Barry Scott wrote on Fri, Feb 02, 2024 at 08:07:46PM +: > > On 2 Feb 2024, at 17:58, Florian Weimer wrote: > > The second one is a standard SATA drive in an USB enclosure, and those > > have write-reordering caches, as far as I understand it. > > We need a kernel storage expert to tell us

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

2024-02-02 Thread Barry Scott
> On 2 Feb 2024, at 17:58, Florian Weimer wrote: > > The second one is a standard SATA drive in an USB enclosure, and those > have write-reordering caches, as far as I understand it. We need a kernel storage expert to tell us the definitive truth on this stuff. I may be out of date on this

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

2024-02-02 Thread Florian Weimer
* Barry Scott: > As I understand it the kernel will request that writes are not > cached. Which means that journaling file systems do in fact work well. The kernel messages I get look like this: kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0 kernel: sd 0:0:0:0: [sda] 15814656 512-byte

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

2024-02-02 Thread Barry Scott
> On 2 Feb 2024, at 11:30, Florian Weimer wrote: > > Yes, the kernel assumes that there are no such caches, but I think in > practice there are. I think this means that journaling file systems are > not working correctly, in the sense that you do not get just user data > loss if the device is

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

2024-02-02 Thread Simon Farnsworth via devel
On Wednesday, 31 January 2024 06:43:00 GMT Abyss Ether via devel wrote: > I created a simple PoC udev rule to mount USB Storage devices with the "sync > option. Available here : > https://github.com/larina3315/personal-stuff/blob/main/linux/10-usb-storage > .rules > Currently, USB Storage devices

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

2024-02-02 Thread Florian Weimer
>> On 31 Jan 2024, at 11:41, Florian Weimer wrote: >> >> I think this is somewhat counteracted by Linux treating USB mass storage >> devices as not having write caches (according to dmesg at least). >> Doesn't this mean that those costly barriers won't be used? > > Isn’t that a reference to

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

2024-02-02 Thread Roberto Ragusa
On 2/2/24 10:25, Lennart Poettering wrote: Another possible approach: run "sync -f" every 3 seconds. While that should make sure the unwritten data hits the disk it doesn't put the superblock in order to mark it as "this fs has been cleanly unmounted". That's quite limiting. Sure. Sounds

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

2024-02-02 Thread Lennart Poettering
On Fr, 02.02.24 10:10, Roberto Ragusa (m...@robertoragusa.it) wrote: > On 1/31/24 09:41, Lennart Poettering wrote: > > > This tanks performance when writing to the device though. There's a > > much better approach however: use an automount in between with a very > > short timeout (2s or so). This

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

2024-02-02 Thread Barry
> On 31 Jan 2024, at 11:41, Florian Weimer wrote: > > I think this is somewhat counteracted by Linux treating USB mass storage > devices as not having write caches (according to dmesg at least). > Doesn't this mean that those costly barriers won't be used? Isn’t that a reference to caches

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

2024-02-02 Thread Roberto Ragusa
On 1/31/24 09:41, Lennart Poettering wrote: This tanks performance when writing to the device though. There's a much better approach however: use an automount in between with a very short timeout (2s or so). This means the mount appears continously available from application PoV but the backing

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

2024-02-02 Thread Samuel Sieb
On 1/31/24 00:57, Larina Loriasel via devel wrote: We approach this problem from a different angle: the user is supposed to sync the filesystem before removing. Graphical environments have an "eject" button, and for non-graphical environments, the user just needs to do a sync manually. I am

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

2024-02-01 Thread Justin Forbes
On Wed, Jan 31, 2024 at 6:36 AM Leon Fauster via devel wrote: > > Am 31.01.24 um 09:57 schrieb Larina Loriasel via devel: > >> 'sync' has some strong downsides though: various operations become > >> painfully slow (this depends a lot on the hardware and its age, and > >> the history of previous

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

2024-02-01 Thread Larina Loriasel via devel
Such a way to dynamically mount and perform reads/writes to the device only when needed is truly an ideal solution, looking forward to udisks implementing such a feature. -- ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an

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

2024-02-01 Thread Roberto Ragusa
On 1/31/24 07:43, Abyss Ether via devel wrote: I created a simple PoC udev rule to mount USB Storage devices with the "sync option. Available here : https://github.com/larina3315/personal-stuff/blob/main/linux/10-usb-storage.rules Currently, USB Storage devices are mounted without the "sync"

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

2024-01-31 Thread Leon Fauster via devel
Am 31.01.24 um 09:57 schrieb Larina Loriasel via devel: 'sync' has some strong downsides though: various operations become painfully slow (this depends a lot on the hardware and its age, and the history of previous writes, etc.), write operations block read operations, and the total number of

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

2024-01-31 Thread Florian Weimer
* Zbigniew Jędrzejewski-Szmek: > On Wed, Jan 31, 2024 at 06:43:00AM -, Abyss Ether via devel wrote: >> I created a simple PoC udev rule to mount USB Storage devices with the "sync >> option. >> Available here : >>

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

2024-01-31 Thread Larina Loriasel via devel
> 'sync' has some strong downsides though: various operations become > painfully slow (this depends a lot on the hardware and its age, and > the history of previous writes, etc.), write operations block read > operations, and the total number of writes may be increased, leading > to more wear on

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

2024-01-31 Thread Lennart Poettering
On Mi, 31.01.24 06:43, Fedora Development ML (devel@lists.fedoraproject.org) wrote: > I created a simple PoC udev rule to mount USB Storage devices with the "sync > option. > Available here : > https://github.com/larina3315/personal-stuff/blob/main/linux/10-usb-storage.rules > > Currently, USB

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

2024-01-31 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jan 31, 2024 at 06:43:00AM -, Abyss Ether via devel wrote: > I created a simple PoC udev rule to mount USB Storage devices with the "sync > option. > Available here : > https://github.com/larina3315/personal-stuff/blob/main/linux/10-usb-storage.rules > > Currently, USB Storage

Mounting USB Storage devices with "sync" option ?

2024-01-30 Thread Abyss Ether via devel
I created a simple PoC udev rule to mount USB Storage devices with the "sync option. Available here : https://github.com/larina3315/personal-stuff/blob/main/linux/10-usb-storage.rules Currently, USB Storage devices are mounted without the "sync" option, causing their writes to be cached. This