home   about   shop   reviews   news archive   forum   ordering   contact   links

Go Back   Overclockers NZ Forums > General > Software, OSes and Programming

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-02-2008, 11:25 AM   #1
Snaptastic
Sudo make me a sandwich!
 
Snaptastic's Avatar
 
Join Date: Nov 2006
Location: NZ
Posts: 269
Disk drive image over network (linux, dd etc)

I'm trying to make a dd image of a laptop's hard disk, and write it directly to disk on another machine over the network.
Basically I want to do this:
Code:
dd if=/dev/sda1 of=/some/place/to/store/stuff/backup_image
But I instead want to pipe the data to a file on another machine. I have a machine that I can ssh into, but I don't know how to make it work. Something like this:
Code:
dd if=/dev/sda1 | scp ?standard_input? uname@machine:~/backup/backup_image
I couldn't see any standard input options for scp. Any gurus out there that can help?
__________________
To really expand your mind try some noncartesian porn. Edwin Abbot Abbott has nothing on 'Girls on Girls in Tightly Closed Nonorientable Spaces'. -xkcd.com
Snaptastic is offline   Reply With Quote
Old 06-02-2008, 02:09 PM   #2
SledgY
meow?
 
SledgY's Avatar
 
Join Date: Sep 2002
Location: NSW, Australia
Posts: 1,361
Send a message via ICQ to SledgY
Try using nc (netcat). ie

on destination:
Code:
nc -l -p 12000 > output.img
on source:
Code:
dd if=/dev/sda1 | nc host 12000
This is only off the top of my head, read the man entry for more info.

/update
Note that you don't need a user as netcat doesn't do authentication it simply streams data from stdin across a network and streams it out stdout on the other end.
__________________
Last.fm Car PC

Last edited by SledgY : 06-02-2008 at 08:53 PM.
SledgY is offline   Reply With Quote
Old 06-02-2008, 02:41 PM   #3
Snaptastic
Sudo make me a sandwich!
 
Snaptastic's Avatar
 
Join Date: Nov 2006
Location: NZ
Posts: 269
Champion. Cheers for that.
__________________
To really expand your mind try some noncartesian porn. Edwin Abbot Abbott has nothing on 'Girls on Girls in Tightly Closed Nonorientable Spaces'. -xkcd.com
Snaptastic is offline   Reply With Quote
Old 06-02-2008, 03:25 PM   #4
Snaptastic
Sudo make me a sandwich!
 
Snaptastic's Avatar
 
Join Date: Nov 2006
Location: NZ
Posts: 269
Ok, I googled for a guide that uses dd and netcat, and in the comments section I found a recommendation for doing it over ssh. I got it working using:
Code:
 cat /dev/sda | ssh user@host "cat > ~/image.img"
The article points out that ssh adds extra overheads compared to nc, but I couldn't get nc working on the laptop (it complained about there being "no route to host"). It's only a small partition anyway, so the speed isn't a big factor.
Thanks again for the help!
Edit: Just found a typo.
__________________
To really expand your mind try some noncartesian porn. Edwin Abbot Abbott has nothing on 'Girls on Girls in Tightly Closed Nonorientable Spaces'. -xkcd.com

Last edited by Snaptastic : 28-02-2008 at 01:14 PM.
Snaptastic is offline   Reply With Quote
Old 06-02-2008, 08:02 PM   #5
Growly
Meow
 
Growly's Avatar
 
Join Date: Mar 2004
Location: New Zealand
Posts: 3,995
This thread is win, if only because you're using dd across a network.

+12 points.
Growly is offline   Reply With Quote
Old 06-02-2008, 08:28 PM   #6
Snaptastic
Sudo make me a sandwich!
 
Snaptastic's Avatar
 
Join Date: Nov 2006
Location: NZ
Posts: 269
Yeah, if only I was really as l33t as the thread makes out.
__________________
To really expand your mind try some noncartesian porn. Edwin Abbot Abbott has nothing on 'Girls on Girls in Tightly Closed Nonorientable Spaces'. -xkcd.com
Snaptastic is offline   Reply With Quote
Old 28-02-2008, 01:07 PM   #7
imdying
Master of muppets
 
imdying's Avatar
 
Join Date: May 2003
Location: New Zealand
Posts: 6,547
Quote:
Originally Posted by NetXCorporate View Post
DD isn't the most reliable way in my experience...
Add a little more (like what your experiences were, and what you'd recommend instead) otherwise this is little more than spam.
__________________
Quote:
Originally Posted by ColinPowell View Post
Sort you spelling and grammer out.
imdying is offline   Reply With Quote
Old 28-02-2008, 01:13 PM   #8
Snaptastic
Sudo make me a sandwich!
 
Snaptastic's Avatar
 
Join Date: Nov 2006
Location: NZ
Posts: 269
I've done this probably twenty times since starting this thread, and it has gone without a hitch.
To make the image:
cat /dev/sda2 | ssh uname@host "cat > ~/image.img"
To restore the image (need to be root):
ssh uname@host "cat ~/image.img" | cat > /dev/sda2
So no, not dd, but equivalent.
__________________
To really expand your mind try some noncartesian porn. Edwin Abbot Abbott has nothing on 'Girls on Girls in Tightly Closed Nonorientable Spaces'. -xkcd.com
Snaptastic is offline   Reply With Quote
Old 28-02-2008, 06:11 PM   #9
whetu
Administrator
 
whetu's Avatar
 
Join Date: May 2002
Location: Wellington, NZ
Posts: 8,200
Send a message via ICQ to whetu
We're using Clonezilla at work (very cool with uni/multicasting), with a bit of Sun Jumpstarting... looking at throwing a Kace K-Box into the mix as well
__________________
Because he wants it!
whetu is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +12. The time now is 08:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.