Clone system with DD
On destination system:
Ifconfig eth0 <ip address> netmask 255.255.255.0
Route add –net 0.0.0.0/0 gw <ip address gw>
destination% nc -l -p 9000 | gzip –dfc | dd bs=1M of=/dev/sda
On the source system…
source% dd bs=1M if=/dev/sda | gzip –cf | nc <ip address dest> 9000
from another console…
source% ps –ef | grep dd
source% watch ‘kill -USR1 pid_of_dd’
Edit /etc/fstab and replace all label= entries with /dev/sdaX entries i.e.
Change Label=/ to /dev/sda2
Change Label=/boot to /dev/sda1
Change Label=swap-sda5 to /dev/sda5
Edit /etc/grub.conf and replace all Label=/ entries with /dev/sda2
Reboot to the rescue cd again
Mount your installation with chroot /mnt/sysimage
If hardware is different backup and edit modules.conf and remove old drivers (megaraid,symbios, etc) and replace with BusLogic (alias scsi_hostadapter BusLogic) or appropriate module
Backup current ramdisk (cp /boot/init-[version].img /boot/init-[version].img.bak) i.e.
cp /boot/initrd-2.6.9-42.0.10.ELsmp.img /boot/initrd-2.6.9-42.0.10.ELsmp.img.bak
Rebuild with new module and overwrite existing (mkinit -f -v /boot/initrd-[version]-img [version] i.e.
mkinitrd -f -v /boot/initrd-2.6.9-42.0.10.ELsmp.img 2.6.9-42.0.10
Reboot, system should detect changes
You will see filesystem went down unclean errors on startup, just hit Y and let Redhat repair the FS
Clone system with tar gzip
Boot destination server to backtrack or linux rescue
ifconfig eth0 <ip_address> netmask <subnet_mask>
route add –net 0.0.0.0/0 gw <gateway_ip>
exclude from the tar command
Destination %%
Make partitions, make file systems, mount partitions.
cd /
nc -l -p 9000 | tar -xvz
Source %%
cd /
tar -cpvz * | nc <ip_address_of_destination> 9000
Note: if file systems are different size cd to / and use tar --exclude=/apps –exclude=/log –exclude=/data –exclude=/datadr –exclude=/logdr –exclude=/appsdr –exclude=/uxlog –exclude=/proc –exclude=/sys –exclude=/dev/shm –cpvz * | nc <ip_address_of_destination> 9000
Then cd to the individual folders for /data etc… and run the nc and tar commands as shown above the Note: section
Follow remainder of steps from DD
No comments:
Post a Comment