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
nixos/doc: bs=1000000 for dd args #54280
nixos/doc: bs=1000000 for dd args #54280
Conversation
Not all dd implementations take ‘bs=1m’. Better to just list it out fully to reduce potential for problems. Fixes NixOS#54181.
@@ -23,7 +23,7 @@ $ diskutil list | |||
[..] | |||
$ diskutil unmountDisk diskN | |||
Unmount of all volumes on diskN was successful | |||
$ sudo dd bs=1m if=nix.iso of=/dev/rdiskN | |||
$ sudo dd bs=1000000 if=nix.iso of=/dev/rdiskN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to just suggest cp
: sudo cp nix.iso /dev/rdiskN
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cool! Didn't know. Does it work for darwin as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not 100% sure, @LnL7 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't control cp's buffer size, which might be relevant to performance here. dd
, when used with a byte-size is more universal. Though here the instructions are darwin-specific. Do we know whether all expected darwin dd
fail with 1m
? The linked issue seems to suggest it would handle only lowercases?
(cp
could be more performant if the system does the right things I guess)
(final edit) an unknown revision of macOS has this in its man page:
Where sizes are specified, a decimal, octal, or hexadecimal number of bytes is expected. If the number ends with a b, k, m, g, or w, the number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G) or the number of bytes in an integer, respectively. Two or more numbers can be separated by an x to indicate a product.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
darwin dd supports 1m but some users will have coreutils dd installed through Nixpkgs. I don't think there's really a way to support both without just avoiding the "M" part altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone can verify the cp command, that would be fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using cp seems to work but fails at the end, this can be avoided with -X
but that's a bsd/apple specific flag so it has the same problem as dd bs=1m
vs dd bs=1M
.
cp: could not copy extended attributes to /dev/rdisk3: Operation not permitted
Have you checked that this value works? I am not familiar with BSD, but I though that |
Oops that might be right. I think I have done this before but it doesn't really make sense in this context. The value should probably be 1048576. At the same time, maybe we should just leave off the bs value altogether? It defaults to 512 which will be support slow but at least it works. More advanced users can specify their own value. |
Not all dd implementations take ‘bs=1m’. Better to just list it out
fully to reduce potential for problems.
Fixes #54181.