Find the answer to your Linux question:
Results 1 to 5 of 5
Partition backup image created as follows: Code: dd if=/dev/hda3 conv=sync,noerror bs=64K | gzip -c > nc6000_linux_system.img.gz Trying to restore the partition from the image as follows: Code: gunzip -c nc6000_linux_system.img.gz ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170

    Arrow [SOLVED] Need help with dd !!!


    Partition backup image created as follows:
    Code:
    dd if=/dev/hda3 conv=sync,noerror bs=64K | gzip -c > nc6000_linux_system.img.gz
    Trying to restore the partition from the image as follows:
    Code:
    gunzip -c nc6000_linux_system.img.gz | dd of=/dev/hda3 conv=sync,noerror bs=64K
    The dd operation fails with the following message:
    Code:
    dd: writing '/dev/hda3': No space left on device
    3673+348340 records in
    352012+0 records out
    23069491200 bytes (23 GB) copied, 713.275 s, 32.3 MB/s
    Why is there no space left? I'm restoring the same partition, from which the image is made.
    What am I doing wrong?
    Can someone help me please? I do not understand if my partition image is faulty, or I do not know how to restore it.
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  2. #2
    Just Joined!
    Join Date
    Nov 2009
    Location
    San Diego, CA
    Posts
    13
    linuxforums.org/forum/misc/54070-dd-command.html

    I'm not a dd expert but looks like someone here had a similar problem.
    The mistake you made was giving gunzip the file name so it'll perform the unzip in situ. This means that you'll need enough space in your current directory for both the zipped and unzipped files! Try
    Code:

    gunzip <partition.image.gz | dd bs=1M of=/dev/hda6

  3. #3
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170

    Thumbs up

    Interesting observation.
    Thanks!
    I'll try it.
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170

    Thumbs up

    Recently, I found out that -c option in gunzip sends the data to std.out. That means the image is being unziped on the fly, no additional drive space is consumed (on the drive that holds the image).
    In spite of the "No space left on device" message, the restore operation was successful and my system boots normally.

    Still if someone has an explanation, I am interested to hear it.
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

  6. #5
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    170

    Smile

    On LinuxQuestions.org I got an explanation:

    Originally Posted by AwesomeMachine
    In the command line to restore, dd is dependent on gunzip feeding it image data. Because of the sync parameter, dd pads the last block with zeroes to make it a full block. So dd keeps going after the image.gz file is written. No space left on device is not an error. Many uses of dd require the device to run out of space. It's not a problem. But the sync conversion is helpful for the method of backup you are using (gzip).
    The original thread that discusses dd usage can be found here: Learn The DD Command Revised
    Fedora_20@Dell_Latitude_E7440
    Ubuntu_14.04_LTS@HP_Compaq_DC7100

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •