I have a RHEL5 Amazon cloud instance that I need to image to another instance in order to setup a test environment for some upcoming patching I'm doing. The server to be imaged is a production server.

The server has a single disk (xvda1, and yes the actual disk is xvda1, not xvda like it should be).

I thought I would use dd, piped to gzip, to make the image of the disk. But then I realized that there would be a problem with recursion. Because dd was reading from the disk that the gzip was being written to, the image would include a corrupted copy of the gzip file, meaning that the image itself was taking up more space than it needed to because of the partial copy of the gzip file, and thusly there would be more transfer time between the machines required.

Getting to the point, what options are there for backing up the entirety of the disk as a single block dump, the same way dd does, but that would not include the gzip file that is being written to on the same disk being read from?

Yes, I could rsync individual files, but for the purposes of this question, let's say that's not an option. Let's also say asking Amazon to add a second disk to the instance is not an option, nor are remote filesystems like NFS/SSHFS/etc, nor is LVM.

  • "Let's also say asking Amazon to add a second disk to the instance is not an option" Given that's one of the big features on AWS - add an EBS volume, on-the-fly, why say that? – ceejayoz Mar 21 '13 at 20:02

You want to create a block level backup to the very disk you are backing up...

With no network storage, and no additional local storage.

Of course this wont work, why are you trying to defy logic?

  • The reason for "defying logic" was to make a local backup that I could then (s)FTP to another location for being able to move off of the Amazon cloud instance. Logically, if someone wants to move off of Amazon cloud to another provider, they might want to make a full server backup. This example would prevent use of remote filesystems. Yes, rsync would work for most cases, but if the remote end was intended to receive the dump via image file (local VM with broken networking or some such), then rsync wouldn't work. – Speeddymon Jun 18 '14 at 14:49
  • The answer, of course, is to dd (piped through gzip or bzip2) to a ramdisk, by the way. This was for an example scenario for a friend who was learning linux. – Speeddymon Jun 18 '14 at 14:50

Right-click on the instance in the console, "create AMI". Check the "no reboot" box if you can't tolerate a few minutes of downtime while a snapshot is taken.

If it's an Amazon instance, adding a disk is always an option. Create an EBS instance and attach it.


The answer is to order additional memory for the cloud instance, and then make a ramdisk. Then dd your local disk to the ramdisk and do what you need to with the image to get it off of the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.