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


Groups > comp.sys.raspberry-pi > #10332

Re: Failure to clone SD card with compression

Subject Re: Failure to clone SD card with compression
Newsgroups comp.sys.raspberry-pi
References <n6mgh4$3r6$2@dont-email.me> <n6qmj6$d1q$1@dont-email.me>
From Dom <domafp@blueyonder.co.uk>
Message-ID <wc6ky.846024$EE2.192319@fx33.am4> (permalink)
Organization virginmedia.com
Date 2016-01-09 11:31 +0000

Show all headers | View raw


On 09/01/16 10:17, Russell Gadd wrote:
> I should have tried to run without suppressing errors. I think The
> Natural Philosopher is right about Chinese whispers, I used these
> options without looking into dd options carefully. Actually it's odd I
> used conv=noerror as I usually like to check for errors.
>
> The conv=sync was also a bad idea as it fills out short inputs with
> zeroes. When I ran the restore without conv=noerror it gave me this
> warning:
> dd: warning: partial read (32768 bytes); suggest iflag=fullblock
>
> So I think what it was doing was filling the rest of the block with
> zeroes on each partial read then writing the output. I also think the
> operation completed more quickly without this argument which would have
> been because it would have been reading only 32k then writing a whole
> 1M. However this is just an impression, I didn't time it.
>
> The number of whispers saying the same thing misled me into assuming it
> was gold information. Damn Chinese! (joke - nothing against the
> Chinese). I was obviously a bit lazy.
>
> So I tried the following lines which worked:
> # dd bs=1M count=3752 if=/dev/sdc | gzip -c >/backfile.img.gz
> # gunzip -c /backfile.img.gz | dd bs=1M count=3752 iflag=fullblock
> of=/dev/sdc
>
> Actually it now strikes me that I should also use iflag=fullblock on the
> intial SD card read. Thinking about it, whenever you use a count it
> would seem that iflag=fullblock should always be used, otherwise the
> count is a count of read operations.
>
> The reason for the block count is that the SD card I used was 16GB but
> the partitions were much smaller - about 3.8GB - so there was no point
> writing beyond this. Also if you read the whole SD card you'd get a much
> larger file unless you first filled the empty space with zeroes. I used
> a spreadsheet to check the figures reported by fdisk. There were 2
> partitions but the first started 4MB into the card.
>
> So problem solved, thanks for all the replies.
>
> Final solution:
> # dd bs=1M count=3752 iflag=fullblock if=/dev/sdc | gzip -c
>  >/backfile.img.gz
> # gunzip -c /backfile.img.gz | dd bs=1M count=3752 iflag=fullblock
> of=/dev/sdc
>
Also, you don't need the count on the last dd that is doing the writing. 
It will just write the contents of the file, which is the correct length.

Back to comp.sys.raspberry-pi | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-07 20:09 +0000
  Re: Failure to clone SD card with compression Roger Bell_West <roger+csrp201601@nospam.firedrake.org> - 2016-01-08 00:05 +0000
    Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-08 00:49 +0000
      Re: Failure to clone SD card with compression Adam Funk <a24061@ducksburg.com> - 2016-01-08 11:17 +0000
        Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-08 12:58 +0000
          Re: Failure to clone SD card with compression Adam Funk <a24061@ducksburg.com> - 2016-01-11 14:14 +0000
        Re: Failure to clone SD card with compression ray carter <ray@zianet.com> - 2016-01-08 17:19 +0000
          Re: Failure to clone SD card with compression Rob Morley <nospam@ntlworld.com> - 2016-01-08 17:30 +0000
  Re: Failure to clone SD card with compression ray carter <ray@zianet.com> - 2016-01-08 01:31 +0000
  Re: Failure to clone SD card with compression "A. Dumas" <alexandre@dumas.fr.invalid> - 2016-01-08 03:00 +0100
  Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-09 10:17 +0000
    Re: Failure to clone SD card with compression Dom <domafp@blueyonder.co.uk> - 2016-01-09 11:31 +0000
      Re: Failure to clone SD card with compression "A. Dumas" <alexandre@dumas.fr.invalid> - 2016-01-09 14:02 +0100
    Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-09 12:07 +0000
      Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-09 20:10 +0000
        Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-09 20:34 +0000
          Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-10 18:52 +0000
            Re: Failure to clone SD card with compression Dom <domafp@blueyonder.co.uk> - 2016-01-10 21:25 +0000
  Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-09 20:09 +0000
    Re: Failure to clone SD card with compression Dom <domafp@blueyonder.co.uk> - 2016-01-09 20:27 +0000
      Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-10 01:40 -0800
        Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-10 15:37 +0000
        Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-10 15:41 +0000
          Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-10 09:18 -0800
    Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-10 18:51 +0000
  Re: Failure to clone SD card with compression Anssi Saari <as@sci.fi> - 2016-01-12 11:46 +0200
    Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-13 12:18 +0000
      Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-13 13:31 +0000
      Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-13 11:19 -0800
        Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-13 19:33 +0000
        Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-13 20:55 +0000
          Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-13 21:48 -0800
            Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-13 21:58 -0800
              Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-14 06:44 +0000
              Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-14 09:24 +0000
                Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-14 09:40 +0000
                Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-14 10:35 +0000
    Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-14 21:58 +0000
      Re: Failure to clone SD card with compression Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-15 00:29 +0000
        Re: Failure to clone SD card with compression fruit <fruit@invalid.org.uk> - 2016-01-15 06:25 +0000
        Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-15 07:46 +0000
        Re: Failure to clone SD card with compression Rob Morley <nospam@ntlworld.com> - 2016-01-15 08:34 +0000
      Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-15 09:47 +0000
        Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-15 16:53 +0000
      Re: Failure to clone SD card with compression CPMDude <nospam@somewhere.net> - 2016-01-16 01:03 -0800
        Re: Failure to clone SD card with compression Rob <nomail@example.com> - 2016-01-16 10:00 +0000
          Re: Failure to clone SD card with compression Russell Gadd <russ.mail.lists@gmail.com> - 2016-01-16 20:10 +0000
          Re: Failure to clone SD card with compression druck <news@druck.org.uk> - 2016-01-17 11:52 +0000
            Re: Failure to clone SD card with compression Ahem A Rivet's Shot <steveo@eircom.net> - 2016-01-17 12:16 +0000
              Re: Failure to clone SD card with compression Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-17 13:49 +0000
                Re: Failure to clone SD card with compression The Natural Philosopher <tnp@invalid.invalid> - 2016-01-17 14:22 +0000
                Re: Failure to clone SD card with compression Alan Adams <alan@adamshome.org.uk> - 2016-01-17 15:00 +0000
                Re: Failure to clone SD card with compression Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-17 16:00 +0000
                Re: Failure to clone SD card with compression Ahem A Rivet's Shot <steveo@eircom.net> - 2016-01-17 15:44 +0000

csiph-web