Shop OBEX P1 Docs P2 Docs Learn Events
unix dd confusion — Parallax Forums

unix dd confusion

Ray0665Ray0665 Posts: 231
edited 2012-04-28 01:13 in General Discussion
i was attempting to use dd to get a Rpi image onto a 4Gb sdcard but my copy of dd does not accept bs=1m.
but it does accept "k" now for the senior moment of confision...
is 1M 1024K or 1000K?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-04-27 10:22
    Have you tried using "M"? "M" is "mega"; "m" is "milli".

    -Phil
  • Ray0665Ray0665 Posts: 231
    edited 2012-04-27 10:37
    Ah the magic incantation, M is the answer (I didnt try because the man page used m)
    Thanks a M.
  • Mark_TMark_T Posts: 1,981
    edited 2012-04-27 15:29
    Ray0665 wrote: »
    i was attempting to use dd to get a Rpi image onto a 4Gb sdcard but my copy of dd does not accept bs=1m.
    but it does accept "k" now for the senior moment of confision...
    is 1M 1024K or 1000K?

    For dd purposes everything is likely to be a power of 2, so 1024, but as people have pointed out "M" is mega...

    I wonder if modern versions of dd (are there any?) would accept "Mi" and "Ki" for Mebi and Kibi...

    I also have to say I have a bit of an aversion to being slack with case with prefixes - things like "mHz" when "MHz" is meant (or the confusion between kb/s and kB/s that no journalist ever seems to get right!)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-28 01:13
    dd is an very old Unix software. You should be able to look on the internet for a Linux website that fully explains the application and offers up a copy in C for modification.

    "Linux in a Nutshell" only mentions "k". "b", and "w" as multipliers of 1024, 512, and 2 respectively. I've no idea where "M" and "m" crept in, but the link below.

    Having said that, most likely you won't find "Mi" and "Ki" in a standard verson. Mega and Milli are a source of endless confusion, but so are attempts to revise an old standard. Mill is actually 1/1000th whilst Kilo is actually 1000. Mega is one million to add to the Mill confusion. Somewhere, somehow people are forgeting that there are different prefixes for fractions and multipliers.

    Go here and read ==> http://www.unix.com/man-page/FreeBSD/1/dd/ (The last part has clear explanation of all the available multipliers including "m" and "g")

    If you can locate and look in the original c code, the "n" parameter would have details on conversions of various suffices.

    There is always free up-to-date documentation on line, but it is at many various websites. Generally I rely on Ubuntu Forums for up-to-date help on helping interpret documentation. Why so? I use Ubuntu AND it is one of the most active Linux distributions so the help is fresh.
Sign In or Register to comment.