Jump to content

Disk cloning


Recommended Posts

I'm looking for a free disk cloning program that will copy my entire hdd to a network computer. It needs to boot from a cd and can put the image on a network share preferably compressed and cant be os specific.  I found some but they dont do what i want. Anyone know of a good one?

Link to comment
Share on other sites

Any linux live CD that supports your netowrk card (I recommend Ubuntu :D) which will give you use of the dd and netcat commands.

On the receiving computer run some thing like:

netcat -l -p 8673 >> hdimagefile

On the transmitting computer:

dd if=/dev/hda | netcat -n <ip of computer> -p 8673

This is perhaps the simplest method, but it has a few issues. For one, if the reciving computer receives any traffic on port 8673 that will make it's way in to the image.

May be my methodology is completely wrong, I mean, I'v never done this my self, but there's no particular reason it won't work that I can see :P

Link to comment
Share on other sites

I've fairly certain that -n isn't needed, and that -p is wrong for the transmitting computer, it should just be "netcat <ip> <port>" (although netcat is usually called nc rather than netcat in my experience).

Link to comment
Share on other sites

Ok if i did it that way how would i restore the image?

Boot off a live CD that has netcat on it (most Linuxes out there probably do. The security distros are sure to).

On the image hosting computer

dd if=hddimage | nc -l -p 8763

And on the machine you want to image:

nc &lt;ip&gt; -p 8763 | dd of=/dev/hdX

Also kinda off topic but if i had a file with one name per line, how could i rename a bunch of folders to match those in the file?

I don't understand the question. Going through a file one line at a time is easy, but how do you see the 'renaming a bunch of folders' part? Does the file contain foldernames that should have some text prepended or something? What?

Link to comment
Share on other sites

I want to rename some folders based on what is in the file. For example the file contains the following.





And the folders are






Is it possible to have a script read the file and rename folder 1 to ABC, folder 2 to ABCD, 3 to ABCDE, etc....?

Link to comment
Share on other sites

for word in `cat file`
do COUNTER=$(($COUNTER + 1))
    mv /path/to/"$word" /path/to/$COUNTER

Set the IFS variable to just newlines to allow the word variable to be the full line.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...