Skip to content

Add oflag=sync to the dd command line #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

fwyzard
Copy link

@fwyzard fwyzard commented Mar 18, 2018

Using only status=progress conv=fsync will result in a seemingly very fast copy, much faster than the write speed of the SD card, followed by a long delay as the data is actually written to the SD card.
Using status=progress conv=fsync oflag=sync will show a slower progress, roughly matching the write speed of the SD card, but once it is done the command will complete immediately.

I think the second approach is more intuitive and less likely to cause users to think the copy is hung.

Using only `status=progress conv=fsync` will result in a seemingly very fast copy, much faster than the write speed of the SD card, followed by a long delay as the data is actually written to the SD card.
Using `status=progress conv=fsync oflag=sync` will show a slower progress, roughly matching the write speed of the SD card, but once it is done the command will complete immediately.

I think the second approach is more intuitive and less likely to cause users to think the copy is hung.
@JamesH65 JamesH65 self-assigned this Mar 18, 2018
@JamesH65
Copy link
Contributor

Hmm, nice idea. Once I've confirmed it's all OK will merge.

@fwyzard
Copy link
Author

fwyzard commented Mar 19, 2018

In fact, I suspect conv=fsync can be dropped altogether if using oflag=sync,

And by the way, dd(1) suggests also oflag=direct, but I haven't tried it.

@lurch
Copy link
Contributor

lurch commented May 31, 2018

@fwyzard As you've noted, this is (apparently) only an issue when using the status=progress option in newer versions of dd. So perhaps this oflag=sync should only be used with the last dd command, and not with all three dd commands as this PR is currently doing?

(from what you're describing, it sounds like the conv=fsync does one big file-sync at the end, but the oflag=sync does lots of smaller file-syncs as the file is being written? Note that I've not tested any of these options myself)

@fwyzard
Copy link
Author

fwyzard commented May 31, 2018

OK.

Though it may be harder to explain why one uses different flags when showing the progress.

@aallan
Copy link
Contributor

aallan commented Jun 7, 2021

In light of #1911 and the lack of progress in a long while I'm marking this PR as 7 day closure.

@aallan aallan added the conflict Pull Request has a merge conflict label Jun 8, 2021
@aallan
Copy link
Contributor

aallan commented Jun 17, 2021

No one picked this up inside the 7 day closure window. So closing due to #1911.

@aallan aallan closed this Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflict Pull Request has a merge conflict requires technical check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants