Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm following this guide so I can download a copy of the disk image as I want to migrate to another host. When I get to the stage where this command needs to be entered:

ssh root@ "dd if=/dev/xvda " | dd of=/home/archive/linode.img

(with the correct IP and a filepath of '/linode.img') I get a permission denied error, and I'm certain that I'm using the correct password as it works when normally logging in.

The strange thing is that it was working, but then after a disk image resize (I made it smaller as I was receiving an error saying there wasn't enough space when copying the image) it started giving me permission denied messages.

share|improve this question

closed as not a real question by Michael Hampton, Tom O'Connor, mdpc, EEAA, Ward Nov 3 '12 at 6:44

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I'd argue that you're doing it wrong.

Here's what I'd do:


On the old server

sudo dpkg --get-selections > package-selections
scp package-selections new-server:~/package-selections

On the new server

sudo dpkg --set-selections < package-selections
sudo apt-get update && sudo apt-get -u dselect-upgrade


rpm -qa > package-selections

and to restore

yum -y install $(cat package-selections)

That'll install the packages that were on the old server, on the new server.

Then the remaining thing to do is to use rsync to copy the contents of /home and /var/www over

I'd also copy over a copy of /etc/ but not push it into place automatically. Instead, rsync it to /home/yourname/etc and cherry pick stuff out of it.

Alternatively, use puppet.

share|improve this answer
Would this work for Drupal and Aegir installations? – Theo Nov 2 '12 at 14:09
That depends where they're installed into. I'm trying to make the point that it's a bad idea to just blindly copy an entire image, I'd rather build a new server from the same packages that were used to create the first one. – Tom O'Connor Nov 2 '12 at 14:26
Oh okay, I wasn't planning to restore directly from this image, rather just download it so I have a local copy of everything before I close my account. – Theo Nov 2 '12 at 14:34
Oh.. In that case, why not just tar up /? – Tom O'Connor Nov 2 '12 at 14:49
You can probably tell I'm quite new to all of this, I just did a quick search trying to find how to get a local copy of everything on my server and that guide came up. I'll look into doing that instead, thanks. – Theo Nov 2 '12 at 14:54

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