Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Transferring servers (binaries, libraries configs etc) from old hd to new raid1


John wrote:
Hi List,

I was running an ata hd on the dmz which I've removed (before it finally
dies) and replaced with 2 brand new drives which I've set up as a raid1
array.

The old hd is 2.4.18 Debian Etch. The new raid1 is 2.6.17-10 Debian Etch.
(Both are identical from the viewpoint of apt-get update, upgrade,
dist-upgrade)

The partitioning on the old hd:
hda1 /boot
hda2 /
hda4 /var
hda5 /tmp
hda6 /home
hda7 swap
hda8 /usr

The partitioning of the 2 new drives (in situ):
hda1 /boot
hda2 raid
hda4 swap

hdb1 /boot2 (A spare boot partition. I read somewhere that it was a good
idea)
hdb2 raid
hdb4 swap

md0 /

I've read numerous howtos (incl. Jamie's) and tried a number of times by
setting the old drive up as hdc but all have failed and I'm getting nervous
about how long the old drive will last.

Q. How do I transfer all the servers from the old drive to the new raid1
array?

Suggested steps:

1. Configure by setting hard drive jumper selector so that the old drive is recognized as /dev/hdc;
so you have old /dev/hda1->(transforms to) /dev/hdc1(/boot);
/dev/hda2-> /dev/hdc2 (/ )
/dev/hda3->/dev/hdc3 (You have no /dev/hda3 ?)
/dev/hda4->/dev/hdc4 (/var)
/dev/hda5->/dev/hdc5 (/tmp)
/dev/hda6->/dev/hdc6 (/home)
/dev/hda7->/dev/hdc7 (swap)
/dev/hda8->/dev/hdc8 (/usr)
Your new drives remains recognized as you indicated above,i.e,
/dev/hda -> /dev/hda
/dev/hdb->/dev/hdb
2. Re-Boot your OS.
3. mkdir /old.drive
3.a cd /old.drive
3.b #for i in boot var tmp home usr
     do
        mkdir $i
    done
3.c cd
4. mount /dev/hdc1 /mnt
4.a. cd /mnt
4.b. find . -print | cpio -pdmuv /old.drive/boot; cd
4.c. umount /mnt
5. mount /dev/hdc2 /mnt
5.a. cd /mnt
5.b. find . -print | cpio -pdmuv /old.drive; cd
5.c. umount /mnt
6. /dev/hdc3 (You have no /dev/hdc3)
7. mount /dev/hdc4 /mnt
7.a. cd /mnt
7.b find . -print | cpio -pdmuv /old.drive/var; cd
7.c umount /mnt
8. mount /dev/hdc6 /mnt
8.a cd /mnt
8.b. find . -print | cpio -pdmuv /old.drive/home; cd
8.c umount /mnt
9. mount /dev/hdc8 /mnt
9.a cd /mnt
9.b find . -print | cpio -pdmuv /old.drive/usr ; cd
9. c umount /mnt
10. At this stage all your data from the old drive are in /old.drive.
Providing you don't format your new drives the old data is now
imaged in /old.drive.
11. Then, do
#cd /old.drive
#find . -print | cpio -pmudv /
12. Reboot your OS and test.

You can put many of the above steps in a script, if that's what
you want.

Hope this helps.

O Plameras