On Mon, Sep 02, 2024 at 01:49:03PM -0400, Michael Stone wrote:
> On Mon, Sep 02, 2024 at 01:11:24PM -0400, The Wanderer wrote:
> > I have always treated the *nix equivalent to "eject", for the purpose of
> > a USB flash drive, as being 'umount /path/to/mount/location' - which, if
> > I'm not mistaken, does include an implicit sync operation.
> 
> Yes. Windows actually does have an option to eliminate the eject step by
> performing all writes synchronously (I think it may even be the default in
> current versions) but it makes working with removable media painfully slow.
> Linux has a similar option (mount with the "sync" option) but it is
> generally not used because of the really significant performance impact, and
> because it can cause much faster wear on flash devices (because there is no
> opportunity to coalesece small writes into larger writes).

This is exactly why I'm always trying to "sell" the "oflag=sync" option of
dd. You are going to write each block exactly once, then plop the medium
out. So whithout, it'll take you 10 sec, with it'll take you as much. But
it's more transparent with, because without, the OS is flushing cache in
the background.

I know, I repeat myself:

  dd if=/path/to/image of=/path/to/device bs=1M oflag=sync status=progress

In my experience, block sizes between a couple of hundred K and a couple
of M do well on flash drives. The default of 512 is very bad, and above
a couple of M it starts to degrade again. It's a very "flat" maximum.
YMMV on that.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature

Reply via email to