LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Duplicating a hard drive (https://www.linuxquestions.org/questions/linux-general-1/duplicating-a-hard-drive-428095/)

mediocre 03-24-2006 01:28 PM

Duplicating a hard drive
 
I have a whole lab of identical computers. I've set one of them up "just so". Let's call it Computer A. It has a mix of partition types:

/dev/hda1 1 4 32098+ de Dell Utility
/dev/hda2 * 5 2421 19414552+ c W95 FAT32 (LBA)
/dev/hda3 2422 2546 1004062+ 82 Linux swap
/dev/hda4 2547 4863 18611302+ 5 Extended
/dev/hda5 2547 3700 9269473+ 83 Linux
/dev/hda6 3701 4863 9341766 83 Linux

Partitions 5 and 6 are reiserfs.

It took me quite a while to get just one computer to this state, and what I'd *like* to do is:

* pull out the hard drive of another computer (Computer B)
* slave it to the the hard drive of Computer A
* byte-by-byte copy everything from A's hd to B's hd.

So... is there such a linux command, that will ignore partition types (in fact, ignore partitions altogether) and just copy bytes?

Nick.

pixellany 03-24-2006 01:41 PM

Piece o' cake.....;)

Read up on "dd" the time-honored Unix/Linux utility for low-level copy. Be warned that it will destroy things as efficently as it will create--you must be very precise.

Here is the ultimate oversimplified command to clone a drive to another identical drive, assuming that you want to copy all of hda to hdb:

dd if=/dev/hda of=/dev/hdb

Again: read the manual first to be sure what you are doing--there are all kinds of options.

Also, look at this marvelous tutorial by "Awesome Machine":
http://www.linuxquestions.org/questi...d.php?t=362506


All times are GMT -5. The time now is 12:53 AM.