Backing up over ssh with dd

I am having an issue while following ~~[http://library.linode.com/linode-manager/copy-disk-image-over-ssh" target="_blank">](http://library.linode.com/linode-manage … e-over-ssh">http://library.linode.com/linode-manager/copy-disk-image-over-ssh]( to try and back up my linode to my local OSX machine.

after setting everything up per the instructions I run

ssh -C root@(myip) "dd if=/dev/xvdb" | dd of=/Users/zstory/linode.img

and the terminal responds "dd: opening '/Users/zstory/linode.imng': no such file or directory"

Has anyone seen this before? any ideas?

7 Replies

I believe what you want is:

dd if=/dev/xvdb | ssh -C root@(myip) "dd of=/Users/zstory/linode.img"

I would also recommend using dcfldd. It is a version of dd modified for Department of Defense Computer Forensics Lab. It will give you a progress update and will let you compute MD5/SHA1 hashes when the file as the data is being pulled off the drive. Comes in very hand when you want to verify your backup on the receiving end. Its free and available from http://dcfldd.sourceforge.net/

@carmp3fan:

I believe what you want is:

dd if=/dev/xvdb | ssh -C root@(myip) "dd of=/Users/zstory/linode.img"

I would also recommend using dcfldd. It is a version of dd modified for Department of Defense Computer Forensics Lab. It will give you a progress update and will let you compute MD5/SHA1 hashes when the file as the data is being pulled off the drive. Comes in very hand when you want to verify your backup on the receiving end. Its free and available from http://dcfldd.sourceforge.net/

Progress reports can already be achieved by replacing dd with pv for the first stage, and MD5 sums can be achieved using tee, a named pipe, and md5sum. However, it should be pointed out that dcfldd is in the Ubuntu repository (and I assume others), and so if anybody wants to use it, they should get it from their distro's repo and not sourceforge.

@Guspaz:

@carmp3fan:

I believe what you want is:

dd if=/dev/xvdb | ssh -C root@(myip) "dd of=/Users/zstory/linode.img"

I would also recommend using dcfldd. It is a version of dd modified for Department of Defense Computer Forensics Lab. It will give you a progress update and will let you compute MD5/SHA1 hashes when the file as the data is being pulled off the drive. Comes in very hand when you want to verify your backup on the receiving end. Its free and available from http://dcfldd.sourceforge.net/

Progress reports can already be achieved by replacing dd with pv for the first stage, and MD5 sums can be achieved using tee, a named pipe, and md5sum. However, it should be pointed out that dcfldd is in the Ubuntu repository (and I assume others), and so if anybody wants to use it, they should get it from their distro's repo and not sourceforge.

True. I simply prefer to use dcfldd because I have a security and forensics background and I don't like having to pipe and tee too much. Just my preference.

dcfldd is not in the Fedora repo but a replacement, dc3dd, is. I have not used it.

I tried that modified command, but I got the same issue: "No such file or directory".

I am entering this command on the linode, do I need to somehow authenticate with my local machine?

Thanks for the dcfldd hint. I will use that in the future.

@entrigan:

I tried that modified command, but I got the same issue: "No such file or directory".

I am entering this command on the linode, do I need to somehow authenticate with my local machine?

Thanks for the dcfldd hint. I will use that in the future.

Are you sure /Users/zstory/ exists?

@entrigan:

I tried that modified command, but I got the same issue: "No such file or directory".

I am entering this command on the linode, do I need to somehow authenticate with my local machine?

Thanks for the dcfldd hint. I will use that in the future.

enter

ssh -C root@(mylinodeip) "dd if=/dev/xvdb" | dd of=/Users/zstory/linode.img

on your desktop

I would rdiff-backup or rsync to back up though, you can run them daily and after the first run it will only cost a few megs in bandwidth, the dd one will take gigs everytime.

also, if you have a database, you should dump it daily.

So /Users/zstory does exist. I have previously been running these commands from a terminal on my linode (however I think it may not have been working because I do not know my local IP). So I tried Chesty's command

> ssh -C root@(mylinodeip) "dd if=/dev/xvdb" | dd of=/Users/zstory/linode.img

run from my local machine, and it replied "ssh: connect to host (my linode ip) port 22: Connection refused"

I am clearly doing something very basic wrong, maybe I will buy the linode backup service for now, and return to this issue when I know more :) Thanks!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct