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


Groups > comp.sys.mac.system > #57759

Re: Block vs file level copy

From Martin Frost me at invalid stanford daht edu <nospam@stanford.edu.invalid>
Newsgroups comp.sys.mac.system
Subject Re: Block vs file level copy
Date 2014-03-08 22:14 -0700
Message-ID <mylhwkhs2c.fsf@Sunburn.Stanford.EDU> (permalink)
References <lffu94$shm$1@dont-email.me> <slrnlhn889.1k6v.g.kreme@amelia.local>

Show all headers | View raw


Lewis <g.kreme@gmail.com.dontsendmecopies> writes:

> In message <lffu94$shm$1@dont-email.me> 
>   Király <me@home.spamsucks.ca> wrote:
> > We had a discussion a while back about the speed of a block level vs a 
> > file level copy of one volume to another. It's generally considered 
> > that a block-level copy is faster, but some argued that a file-level 
> > copy will be faster if the volume contains a lot of free space. There 
> > was more disagreement about whether a block-level copy copies that free 
> > space or not.  I had the chance to test it over the last two days.
> 
> > I had a 2TB volume that was only 25% full (of Time Machine backups.) I 
> > wanted to copy it to a 3TB volume.
> 
> > Disk Utility's Restore function, which unmounts both the volumes and 
> > does a block-level copy, took 16 hours over FW800.
> 
> > SuperDuper, which leaves the volumes mounted and does a file-level copy, 
> > took 5 hours.
> 
> > That settled it for me.
> 
> A block level copy is always faster if the block size is set properly.
> The smaller the block size, the slower the copy (but the more the copy
> can cover for errors, which is why you might want to use a small block
> size).
> 
>  $ dd if=/dev/zero bs=1 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 1024 bytes transferred in 0.007203 secs (142166 bytes/sec)
>  $ dd if=/dev/zero bs=1024 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 1048576 bytes transferred in 0.007179 secs (146061124 bytes/sec)
> 
> So, 0.13MB/s versus 140MB/s, or 1000 times slower with a block size of 1
> (512 bytes) instead of 512K.

Just want to point out that the bs option of dd takes its argument (1
and 1024 above) in bytes (not multiples of 512 bytes).  So the above
copied 1-byte and 1024-byte blocks.  Note the totals at the end of
each run: 
  1024 bytes transferred  [1byte x 1024]
  1048576 bytes transferred [1024bytes x 1024]
(Perhaps you've confused dd with dump.)

Martin

> But it gets worse:
> 
>  $ dd if=/dev/zero bs=2048 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 2097152 bytes transferred in 0.008700 secs (241048286 bytes/sec)
>  $ dd if=/dev/zero bs=4096 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 4194304 bytes transferred in 0.014646 secs (286377764 bytes/sec)
> 
> 2MB block size and we're up to almost 275MS/s
> 
>  $ dd if=/dev/zero bs=8192 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 8388608 bytes transferred in 0.017961 secs (467045054 bytes/sec)
>  $ dd if=/dev/zero bs=16384 count=1024 of=test
> 1024+0 records in
> 1024+0 records out
> 16777216 bytes transferred in 0.110376 secs (152000743 bytes/sec)
> 
> OK, so we peaked at 445MB/s with a blocksize of 8MB and doubling the
> blocksize again really slowed us down.
> 
> So, 0.13MBs or 445MB/s?
> 
> Disk Utility uses what block size?
> 
> -- 
> Rincewind had always been happy to think of himself as a racist.  The
> One Hundred Meters, the Mile, the Marathon -- he'd run them all.

Back to comp.sys.mac.system | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Block vs file level copy me@home.spamsucks.ca (Király) - 2014-03-08 20:24 +0000
  Re: Block vs file level copy Alan Browne <alan.browne@FreelunchVideotron.ca> - 2014-03-08 16:09 -0500
    Re: Block vs file level copy JF Mezei <jfmezei.spamnot@vaxination.ca> - 2014-03-08 16:33 -0500
      Re: Block vs file level copy Lewis <g.kreme@gmail.com.dontsendmecopies> - 2014-03-08 23:01 +0000
      Re: Block vs file level copy Oregonian Haruspex <bob_davis_retired@yahoo.com> - 2014-03-10 04:32 +0000
      Re: Block vs file level copy Siri Cruz <chine.bleu@yahoo.com> - 2014-03-09 22:34 -0800
    Re: Block vs file level copy Tom Stiller <clusterfux.upmon@gmail.com> - 2014-03-09 13:08 +0000
      Re: Block vs file level copy Alan Browne <alan.browne@FreelunchVideotron.ca> - 2014-03-09 11:41 -0400
  Re: Block vs file level copy Lewis <g.kreme@gmail.com.dontsendmecopies> - 2014-03-08 23:00 +0000
    Re: Block vs file level copy billy@MIX.COM - 2014-03-08 23:48 +0000
    Re: Block vs file level copy Martin Frost me at invalid stanford daht edu <nospam@stanford.edu.invalid> - 2014-03-08 22:14 -0700
      Re: Block vs file level copy Lewis <g.kreme@gmail.com.dontsendmecopies> - 2014-03-09 07:20 +0000
    Re: Block vs file level copy Siri Cruz <chine.bleu@yahoo.com> - 2014-03-09 22:55 -0800
  Re: Block vs file level copy Siri Cruz <chine.bleu@yahoo.com> - 2014-03-09 22:11 -0800

csiph-web