View Single Post
  (#4) Old
yakinikku yakinikku is offline
Senior Member
 
Posts: 252
Join Date: Jan 2009
Default 07-27-2009, 04:08 AM

Quote:
Originally Posted by Z4i View Post
If you have enough space on another computer to hold it all, there are two utilities you can use in combination.

The first one is called "dd", I'm not sure what it stands for but I use the mnemonic "data dumper". The other is called "netcat" which lets you send messages over the network to another computer.

On another unish computer (not sure if Cygwin will work, I know SFU doesn't come with netcat but does have dd, linux works, bsd works, solaris works), you would run something like

$ nc -l [port number] | dd of=[output file]

The order is important, if nc isn't listening on that port when you try to send a message to it, it won't work, you'd run

# dd if=/dev/[SSD's device name] bs=4096 | nc [ip address of the other computer] [port number]

This will dump the contents of the SSD, bit for bit, onto the network, destined for the IP address you give at the port you give, and upon arrival, it will be saved as [output file]. You can choose any port you want, though I usually use 9001 because it's over 9000. Don't actually use the brackets, just fill them with the port (e.g. 9001), the output file name (e.g. dellmini.img), the SSD device name (probably /dev/sda or /dev/hda), and the IP address of the listening computer (the one you ran the first command on).

So an example might look like

$ nc -l 9001 | dd of=/home/dellmini.bak

running on a computer with IP address 192.168.1.100, and

# dd if=/dev/sda bs=4096 | nc 192.168.1.100 9001

Running on any other computer on that LAN. Then when you want the image back, boot the Ubuntu LiveUSB and run

# nc -l 9001 | dd of=/dev/sda

and on your other computer, run

$ dd if=/home/dellmini.bak | nc 192.168.1.101 9001

Use the actual IP address of the mini, it may not be 192.168.1.101


This works great for me because I have big drives in my desktop, and the mini 9 has a very small SSD. If you have a computer you can dedicate as a server, it would make sense to use that instead. How well it works for you depends on how well you understand what's going on and whether you have suitable computers and network setup to do this.

You may need to use sudo on the ones using dd. I personally prefer to get a root shell as opposed to sudoing all the time.

If you are low on space on the machine you're backing up the image to, or if you have a slow network, or for any other reason you want to compress it, you can try gzipping or bzipping or lzma compression in the middle of the pipe there. That would look like

dd if=/dev/sda bs=4096 | gzip | nc 192.168.1.100 9001

Personally I don't use compression because it's simpler to not use it.

Oh, and depending on the OS, there may be extra flags needed for netcat. Some use -p to specify the port, some just use -l and assume that what follows is the port you want to listen on. Read manpages for any questions, if you still can't find an answer I'll be around.
do either of these utilities have a GUI version?
Reply With Quote