[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dd and gzip/gunzip with large disk images
From: |
J |
Subject: |
dd and gzip/gunzip with large disk images |
Date: |
Mon, 12 Sep 2022 11:35:49 -0400 |
Hi,
I'm trying to clone a machine.
The source and target machines are identical in every way, they have the
same hardware and memory.
I am using a live-dvd to boot the source machine, and then run the
following command from a third machine (a workstation) to create the image.
ssh root@source "dd if=/dev/sda bs=128M conv=sparse | gzip -9 -" | dd
of=raw.img.gz
The source hard-disk is a 500 GB disk.
This succeeds and produces a file that is ~29 GB in size.
But when I try to restore this image onto the target machine, the operation
never completes.
I boot the target machine with the live-dvd and issue the following commands
mkdir /mnt/remotefs
sshfs user@workstation:/ /mnt/remotefs/ -C
cat remotefs/raw.img.gz | gunzip | dd of=/dev/sda
By monitoring the network traffic, it appears that at first, there is data
transfer happening.
After some time though, the traffic seems to stop, and the target-machine
appears to have locked-up.
What I suspect is that the target machine may in fact be receiving the data
and passing it into gunzip, but (according to my limited understanding of
all of this) gunzip must first receive ALL the data (29 GB) before it
finishes and pipes its output to dd.
The target (and source) machines only have 8 GB of RAM, so the target
machine's memory must be exceeded.
What am I doing wrong?
Is there a better way to restore the image?
Thank you
- dd and gzip/gunzip with large disk images,
J <=