On Mon, May 17, 2021 at 10:29:06AM +0300, Andrei POPESCU wrote:
> On Lu, 17 mai 21, 08:32:28, tomas@tuxteam.de wrote:
> > On Mon, May 17, 2021 at 08:59:43AM +0300, Andrei POPESCU wrote:
> >
> > [...]
> >
> > > I'll raise you 'cp':
> > >
> > > cp foo.iso /dev/sdb
> > >
> > >
> > > which is both fast and short to type (apparently it's smart about using
> > > the correct block size).
> >
> > I'll be sure to try that some day :)
> >
> > > Unfortunately it's missing dd's equivalent of status=progress.
> >
> > and oflags=sync.
>
> Hmm, would you (or anyone else) know what is the difference between
> oflags=sync and conv=fsync?
Let me put the docs next to each other (this is from the info page,
which sometimes is more complete than the man page):
* conv=fsync:
‘conv=CONVERSION[,CONVERSION]...’
Convert the file as specified by the CONVERSION argument(s). (No
spaces around any comma(s).)
[...]
The following “conversions” are really file flags and don’t affect
internal processing:
[...]
‘fsync’
Synchronize output data and metadata just before finishing.
This forces a physical write of output data and metadata.
* oflag=sync:
‘oflag=FLAG[,FLAG]...’
Access the output file using the flags specified by the FLAG
argument(s). (No spaces around any comma(s).)
[...]
‘dsync’
Use synchronized I/O for data. For the output file, this
forces a physical write of output data on each write. For the
input file, this flag can matter when reading from a remote
file that has been written to synchronously by some other
process. Metadata (e.g., last-access and last-modified time)
is not necessarily synchronized.
‘sync’
Use synchronized I/O for both data and metadata.
I'd say "conv=fsync" does a sync at the end of the whole thing, while
"oflag=sync" open(2)s the file with O_SYNC (likewise "oflag=dsync"
translates to an open(2) with O_DSYNC), so the sync happens after each
block write. That's what I want, since it gives me much more predictability
as to when I can plop out my usb stick :)
Cheers
- t
Attachment:
signature.asc
Description: Digital signature