Ghosting The Machine
|
Submitted by linuxscooter (Contact Author) (Forums) on Mon, 2010-07-12 18:07. :: Linux | Backup | Other
Ghosting The MachineThis is a short but potentially extremely handy guide to ghosting
one Linux box to another (or simply making a full backup of a
desktop/server). Credit goes to 'topdog' for this. You might have a small office where you customise one desktop just how you like it and need to roll this out to N other PC's or simply want a backup of a server or desktop to another machine or even to an image file. The main tool here is netcat which is extremely powerful and has a multitude of other great uses that won't be covered here. Target Machine: ** Boot to linux rescue mode with networking (CentOS works fine) Initiate netcat to listen on port 30 - # nc -l -p <portnumber> | dd of=/dev/sda (assuming the hard drive is sda and not hda): # nc -l -p 30 | dd of=/dev/sda Source Machine: Dump the contents of the disk to the target PC - #dd if=/dev/sda | nc <ipaddresstarget> <portnumber> # dd if=/dev/sda | nc 192.168.0.20 30 Then to check that traffic is flowing, on the source go to another terminal (ALT/F2) and dump the tcp data on the NIC (assuming it's eth0): tcpdump -tnli eth0 port 30 If you just want a backup image you could change the above output on the taget to: # nc -l -p 30 | dd of=mybackup.img That's it. Naturally the target PC/disk cannot be smaller than the source:) I hope this saves someone a lot of time.
|



Recent comments
8 hours 45 min ago
12 hours 57 min ago
17 hours 13 min ago
1 day 1 hour ago
1 day 3 hours ago
1 day 5 hours ago
1 day 17 hours ago
1 day 23 hours ago
2 days 1 hour ago
2 days 4 hours ago