Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • "So, if it doesn't fit afterwards, the original partition /dev/sda<n> was simply larger than /dev/sdh. This is completely independent from any compression used!" Yes, that's correct. I first made a backup (of Windows) then reduced the size (with cfdisk) to install linux. And then after, the Windows didn't run any more so I wanted to reinstall it on the now smaller partition! About the mistake you are pointing out: I was not quite correct. The command I used was: gunzip sda<n>.dd.img.gz >/dev/sda<n> Commented Feb 24 at 21:54
  • So you mean I have to resize the Partition to it's original size, reinstall Windows, defrag it, resize the the Partition and make the backup again?.. ?? UH! Commented Feb 24 at 22:01
  • 1
    well, what did you expect when you made a byte-exact backup of something larger than what you'll restore it to? Commented Feb 24 at 22:50
  • As frostschutz correctly says, gunzip file.gz writes the decompressed data to 'file' not to stdout, so it cannot be redirected (or piped). gunzip <file.gz does write to stdout, as does gunzip -c file.gz, and as Paul_Pedant commented zcat file.gz (zcat is a script that just does gzip -dc while gunzip just does gzip -d). Commented Feb 25 at 6:09
  • @dave_thompson_085 aaargh, missed that. Fixed my answer. Commented Feb 25 at 11:46