Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235250

Re: OT: minimum bs for dd?

From <tomas@tuxteam.de>
Newsgroups linux.debian.user
Subject Re: OT: minimum bs for dd?
Date 2021-05-17 08:40 +0200
Message-ID <CfF50-3vP-5@gated-at.bofh.it> (permalink)
References (2 earlier) <Cft3P-4x9-1@gated-at.bofh.it> <CftQd-527-1@gated-at.bofh.it> <CftZT-55d-3@gated-at.bofh.it> <CfwEq-6M4-5@gated-at.bofh.it> <CfxAx-7ko-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, May 16, 2021 at 06:33:57PM -0400, Stefan Monnier wrote:
> >> On Sun, May 16, 2021 at 01:31:49PM -0500, Richard Owlett wrote:
> >> > I'll bite ;}
> >> > When is it the right tool?
> >> 
> >> When you're using it to convert ebcdic to ascii, while swapping bytes and
> >> reblocking an ancient file from a barely readable archival tape.
> >> 
> >> > When is it not?
> >> 
> >> When copying a file.
> >> 
> > When copying a file and writing it to another medium, perhaps eg when writing
> > a DVD .iso file directly to a USB stick, it's ideal.
> 
> Not sure about ideal:
> 
>     cat <foo.iso >/dev/sdb
> 
> is one char longer than
> 
>     dd <foo.iso >/dev/sdb
> 
> but it's often faster (you can speed up `dd` by providing a larger
> `bs=` argument, but then you've lost the length advantage ;-)

Agreed. When writing to USB flash media I've the impression that
there's a sweet spot somewhere between 64K and 1M block size.

The maximum is pretty flat, so I just use 1M (easier to remember),
but it's significant wrt the default 512B. It possibly depends on
the rest of the hardware.

This is one point. The other, which adds more convenience is that
dd has an explicit argument for (input and) output file name, whereas
cat relies on redirection. This becomes relevant when you try to

  sudo cat thing > that_other_thing

and realise that the ">" is *not* in the sudo context (and what
you would have to do to "fix" that).

Instead,

  sudo dd if=thing of=this_other_thing

Just Works out of the box. More relevant when doing ">>" (use
dd's oflag=append then).

Another nice thing is oflag=sync: when writing to big media, it
makes sure that data doesn't end up in the buffer cache making
you wait during the final sync.

And oh, 'status=progress' in combination with the above.

So... yay, dd.

Cheers
 - t

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OT: minimum bs for dd? Bob Bernstein <poobah@ruptured-duck.com> - 2021-05-15 22:30 +0200
  Re: OT: minimum bs for dd? The Wanderer <wanderer@fastmail.fm> - 2021-05-15 22:40 +0200
  Re: OT: minimum bs for dd? IL Ka <kazakevichilya@gmail.com> - 2021-05-15 22:40 +0200
    Re: OT: minimum bs for dd? Bob Bernstein <bob@fanatick.org> - 2021-05-16 09:40 +0200
    Re: OT: minimum bs for dd? Michael Stone <mstone@debian.org> - 2021-05-16 19:50 +0200
      Re: OT: minimum bs for dd? Richard Owlett <rowlett@cloud85.net> - 2021-05-16 20:40 +0200
        Re: OT: minimum bs for dd? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-05-17 00:40 +0200
          Re: OT: minimum bs for dd? The Wanderer <wanderer@fastmail.fm> - 2021-05-17 00:50 +0200
            Re: OT: minimum bs for dd? "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-17 09:00 +0200
              Re: OT: minimum bs for dd? The Wanderer <wanderer@fastmail.fm> - 2021-05-17 12:30 +0200
            Re: OT: minimum bs for dd? Greg Wooledge <greg@wooledge.org> - 2021-05-17 13:20 +0200
          Re: OT: minimum bs for dd? Andrei POPESCU <andreimpopescu@gmail.com> - 2021-05-17 08:10 +0200
            Re: OT: minimum bs for dd? <tomas@tuxteam.de> - 2021-05-17 08:40 +0200
              Re: OT: minimum bs for dd? Andrei POPESCU <andreimpopescu@gmail.com> - 2021-05-17 09:30 +0200
                Re: OT: minimum bs for dd? David <bouncingcats@gmail.com> - 2021-05-17 10:00 +0200
                Re: OT: minimum bs for dd? Andrei POPESCU <andreimpopescu@gmail.com> - 2021-05-17 14:10 +0200
                Re: OT: minimum bs for dd? <tomas@tuxteam.de> - 2021-05-17 10:10 +0200
                Re: OT: minimum bs for dd? Andrei POPESCU <andreimpopescu@gmail.com> - 2021-05-17 14:30 +0200
                Re: OT: minimum bs for dd? <tomas@tuxteam.de> - 2021-05-17 15:00 +0200
                info pages WHERE? -- was [Re: OT: minimum bs for dd?] Richard Owlett <rowlett@cloud85.net> - 2021-05-17 15:00 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] <tomas@tuxteam.de> - 2021-05-17 15:10 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Richard Owlett <rowlett@cloud85.net> - 2021-05-17 15:20 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] IL Ka <kazakevichilya@gmail.com> - 2021-05-17 15:30 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Richard Owlett <rowlett@cloud85.net> - 2021-05-17 16:00 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Greg Wooledge <greg@wooledge.org> - 2021-05-17 15:40 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-17 16:10 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Greg Wooledge <greg@wooledge.org> - 2021-05-17 17:10 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] "Thomas Schmitt" <scdbackup@gmx.net> - 2021-05-17 18:00 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Brian <ad44@cityscape.co.uk> - 2021-05-17 20:30 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Greg Wooledge <greg@wooledge.org> - 2021-05-17 20:50 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] Brian <ad44@cityscape.co.uk> - 2021-05-17 21:00 +0200
                Re: info pages WHERE? -- was [Re: OT: minimum bs for dd?] <tomas@tuxteam.de> - 2021-05-17 16:10 +0200
            Re: OT: minimum bs for dd? Brian <ad44@cityscape.co.uk> - 2021-05-17 16:20 +0200
          Re: OT: minimum bs for dd? <tomas@tuxteam.de> - 2021-05-17 08:40 +0200
            Re: OT: minimum bs for dd? Richard Hector <richard@walnut.gen.nz> - 2021-05-17 13:40 +0200
        Re: OT: minimum bs for dd? Michael Stone <mstone@debian.org> - 2021-05-16 20:50 +0200
          Re: OT: minimum bs for dd? "Andrew M.A. Cater" <amacater@einval.com> - 2021-05-16 23:40 +0200

csiph-web