Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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@123.45.67.89 "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.

add comment

1 Answer

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

Here's what I'd do:

Debian/Ubuntu

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

RedHat/Centos/ScientificLinux/etc.:

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 Windebank Nov 2 '12 at 14:09
1  
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 Windebank 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 Windebank Nov 2 '12 at 14:54
add comment

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