euglug.org

[Eug-lug] Gentoo system – moving drives

작성자

카테고리:



D. Cooper StevensonSat Jul 10 08:47:28 PDT 2004

Rob,

Executive Overview:
-------------------

tar cvf ./backup.tar --exclude=/tmp --exclude=/proc --exclude=/mnt /


Better answer if you want to mirror a drive (for your reference):

Linux is designed to be portable from a filesystem point of view. Now, I
caveat that. If you optimize your compiles like crazy (compiling
everything as an AMD optimized binary, for example) then running the
distribution on another hardware platform. Of course, assuming that you
have compiled for the "plain Jane" x86 instruction set you can be
confident that the image will run on just about anything.

So, having said that, there are a couple of ways you can go. The first
is basically a "Ghosting" of one hard drive to another. More directly,
it lays the bits _exactly_ on the destination drive as they are on the
origin drive. No boot record problems, none of that.

Here's how to do it:

1) Connect the two drives to the PC. The best way to do this is to
connect the primary drive as a master to the primary IDE chain (it will
already be there) and the second device as a master on the secondary IDE
chain. This is because IDE cannot read and write to two drives on the
same IDE chain at the same time. 

2) Boot to a live CD. It doesn't really matter which live CD you choose
so long as it is basically functional. We basically need only one
command, after all.

I recommend the System Rescue CD-Rom. Now, let's not get the same
shivers when someone says "Rescue CD" meaning a lame, stripped down
proprietary package that doesn't work or worse, simply wipes out your
hardware and restores it to OEM configuration. 

This one has the whole package: hardware diagnostics, memory test,
graphical partition editor, DOS emulator, you name it; it's the
"hornet's nipples."

Here's a link:

  http://www.sysresccd.org/

By the way, the CD comes with "PartImage," a utility for making an image
of your partitions to a file. Here is a link for more information:

  www.partimage.org

The following is a continuation of doing it "with grit."

3) Check to see if any of the partitions on your primary hard drive
(hda) were automatically mounted:

  df -h

Unmount the partitions if they are. As I recall, they will not be.

4) Copy the contents of the primary drive to the secondary drive. I am
assuming you have the drives physically connected as I described above:

  dd if=/dev/hda of=/dev/hdc bs=1024

The system will respond with exactly Jack on the console. You will see a
lot of drive activity when the mirroring is complete. 

5) Move the drive cables so that the backup drive is now the primary
master, and boot it to ensure that it works.


Best,
-- 

--------------------------------------------------------------
| Cooper Stevenson        | Em:  cooper at gencom.us            |
| GenCom                  | Ph:  541.924.9434                |
| "Working For IT"        | Www: http://www.gencom.us        |
--------------------------------------------------------------