Bug #11040

Document alternative between '16m' and '16M' for Mac dd command

Added by sajolida 2016-02-01 12:22:58 . Updated 2016-02-23 13:37:09 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Installation
Target version:
Start date:
2016-02-01
Due date:
% Done:

0%

Feature Branch:
doc/11040-mac-16m-vs-16M
Type of work:
End-user documentation
Blueprint:

Starter:
Affected tool:
Installation Assistant
Deliverable for:

Description

In the dd command line on Mac, according to 55f6527, people complained about both ‘16m’ and ‘16M’.

Then we reintroduced ‘16m’ to make /dev/rdisk work in Feature #8438.

Now people are complaining again about ‘16m’ in https://twitter.com/recifs/status/693909221008629765.

Maybe we should document an alternative: try ‘16m’ and if it doesn’t work try ‘16M’.

To be able to write this we need to know:

  • Which version works on the newer version of Mac OS X. This should be the first to be documented.
  • What happens on older versions of Mac OS X when the default version fails.

Subtasks


History

#1 Updated by sajolida 2016-02-01 12:23:14

  • Subject changed from Document alternative between '16m' and '16M' for Mac to Document alternative between '16m' and '16M' for Mac dd command

#2 Updated by sajolida 2016-02-02 14:05:44

  • Assignee set to muri
  • QA Check set to Info Needed

Muri: now that I know that you have El Capitan handy, which is the correct version for it? :)

#3 Updated by sycamoreone 2016-02-03 10:29:34

I asked a Mac user about that. One reason for the mess could be that some people installed GNU Coreutils (maybe just as a dependency, using brew for example) and now have the GNU dd before the Apple dd in their PATH.

#4 Updated by sycamoreone 2016-02-03 10:50:15

Apple’s dd is a version of FreeBSD’s dd which also used lower-case letters for multipliers.

POSIX only specifies the lower-case b and k multipliers, that acutally also work with GNU dd.

$ dd if=/dev/urandom of=FILE bs=1K count=1
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.000465822 s, 2.2 MB/s
$ dd if=/dev/urandom of=FILE bs=1m count=1
dd: invalid number `1m'

So writing 16384k instead of 16M should work everywhere. Maybe just saying something like 512k would also work. One would need to test how much of a speed difference this actually makes when writing to a USB stick.

At least without a USB stick the difference in speed is negligible:

$ dd if=/dev/urandom of=FILE bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 9.6322 s, 10.9 MB/s

$ dd if=/dev/urandom of=FILE bs=1k count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 10.3759 s, 10.1 MB/s

#5 Updated by muri 2016-02-03 10:51:58

here you go:

bash-3.2# time dd if=Downloads/tails-i386-2.0/tails-i386-2.0.iso of=/dev/rdisk2 bs=16m && time sync
67+1 records in
67+1 records out
1135089664 bytes transferred in 73.570107 secs (15428680 bytes/sec)

real    1m13.739s
user    0m0.002s
sys 0m0.690s

real    0m0.070s
user    0m0.001s
sys 0m0.053s
bash-3.2# time dd if=Downloads/tails-i386-2.0/tails-i386-2.0.iso of=/dev/rdisk2 bs=16M && time sync
dd: bs: illegal numeric value

real    0m0.004s
user    0m0.001s
sys 0m0.002s

so at least in 10.11.3, it has to be a small m

the manpage of os x isn’t sure itself
> 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 may be separated by an ``x’’ to indicate a product.

#6 Updated by muri 2016-02-03 10:53:39

  • Assignee changed from muri to sajolida

#7 Updated by sajolida 2016-02-04 10:02:19

  • QA Check changed from Info Needed to Dev Needed

Thank you all for your feedback! The GNU vs FreeBSD explanation from sycamoreone makes lots of sense and is confirmed by muri’s testing. So I think we should stick to ‘16m’ and add a note or something saying “If you get invalid number ‘16m’ (the error I get in GNU dd) then try with ‘16M’”.

I’ll do this.

#8 Updated by sajolida 2016-02-04 10:02:37

  • Target version set to Tails_2.2

#9 Updated by intrigeri 2016-02-04 19:36:37

> At least without a USB stick the difference in speed is negligible:

JFYI: you want to make sure dd sync’s data to disk, otherwise such benchmarks are not very useful.

#10 Updated by sajolida 2016-02-08 14:23:53

  • Type of work changed from Research to End-user documentation

#12 Updated by sajolida 2016-02-21 20:46:04

  • Status changed from Confirmed to In Progress
  • Assignee changed from sajolida to muri
  • QA Check changed from Dev Needed to Ready for QA
  • Feature Branch set to doc/11040-mac-16m-vs-16M

Ready! Muri, do you mind having a look?

#13 Updated by sajolida 2016-02-21 20:48:03

Note that I’m voluntarily only updating the instructions in the assistant, and not the ones in /doc/first_steps/installation/manual/mac.mdwn because they will be removed soon.

#14 Updated by muri 2016-02-22 10:24:37

  • Assignee changed from muri to sajolida

sajolida wrote:
> Ready! Muri, do you mind having a look?

you’re mixing tick and backtick (grave accent) in the dd error message. it should be:
> invalid number: ‘16m’
(pasted from the command; i think these are both forward ticks or something alike; i think for reading they should be the same before and after the 16m)
other than that is fine! thanks!

btw. i’ve now tested installing brew and the standard install installs coreutils dd to gdd

#15 Updated by sajolida 2016-02-23 13:37:09

  • Status changed from In Progress to Resolved
  • Assignee deleted (sajolida)
  • QA Check deleted (Ready for QA)

Thanks for review. I fixed the quotes in 9da9326 and merged.