PDA

View Full Version : clone a suse server to a new box with different hardware



renga_v99
25-Feb-2013, 14:08
Hi,

we have a Open SUSe 10.3 server and it has raid configured with it .
Filesystem Size Used Avail Use% Mounted on
/dev/md1 99G 18G 77G 19% /
udev 4.0G 2.4M 4.0G 1% /dev
/dev/md0 99M 16M 79M 17% /boot
/dev/md2 1.6T 273G 1.3T 18% /opt
/dev/md3 917G 817G 54G 94% /raid1



/etc # mdadm --detail /dev/md0
/dev/md2:
Version : 00.90.03
Creation Time : Thu Oct 21 12:28:11 2010
Raid Level : raid6
Array Size : 1743582464 (1662.81 GiB 1785.43 GB)
Used Dev Size : 871791232 (831.40 GiB 892.71 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 2
Persistence : Superblock is persistent

Update Time : Mon Sep 17 07:45:42 2012
State : active
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Chunk Size : 64K

UUID : 57aabbef:9b1f3435:019e2933:e07293d4
Events : 0.13190113

Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
2 8 51 2 active sync /dev/sdd3
3 8 35 3 active sync /dev/sdc3

================================================== =====

/dev/md1:
Version : 01.00.03
Creation Time : Wed May 20 09:18:27 2009
Raid Level : raid1
Array Size : 104864212 (100.01 GiB 107.38 GB)
Used Dev Size : 209728424 (100.01 GiB 107.38 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 1
Persistence : Superblock is persistent

Intent Bitmap : Internal

Update Time : Mon Sep 17 07:45:28 2012
State : active
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Name : 1
UUID : eb4ed26f:9b578d85:3ea6ea5c:cbae3276
Events : 17008901

Number Major Minor RaidDevice State
4 8 18 0 active sync /dev/sdb2
7 8 2 1 active sync /dev/sda2
5 8 50 2 active sync /dev/sdd2
6 8 34 3 active sync /dev/sdc2
================================================== ===========

I want to clone the same OS with its complete configuration to a new upgraded hardware.

I planned with 'dd' command but worried how to do it since there are no free hdd slot available and its complicated with raid 1 & 6 in it.

Please advice how to do a clone of it.

jmozdzen
25-Feb-2013, 17:14
Hi renga_v99,

cloning to a new hardware base is always a risk you take - there may be several changes in settings (and device names etc) that will disturb the operation of the clone.

That said, if only cloning of the disks is what you're trying to solve, you could always do a "netcat" from the old to the new hardware, disk by disk. The machines will have to be offline (in terms of "services running on the machine").

To do so, you connect both machines with the fastest possible link, boot some rescue system and start a netcat listener on the new hardware, piping the output to dd... something like "ncat -l 666 | dd of=/dev/yourdiskdevice bs=1M". Then, on the old hardware, you again start some maintenance Linux, set up the network and do something along the lines of "dd if=/dev/yourfirstdisk bs=1M | ncat <ipofnewmachine> 666".

Booting from a maintenance Linux will create an environment where no other processes need to access the disks.

Of course, when the disks differ in size, you'll have to take measures after the copy to use all the available space of the assumed *larger* new disks.

A different path could be to set up the MD RAID on the new machine first, i.e. via a maintenance Linux, and copy just the *content* of the RAID volumes... that would greatly reduce the amount of data copied. But you'll have to watch out for the MD configuration - the clone will then have different UUIDs.

As always: Use at your own risk and don't shred the old system before your absolutely sure the new one works... and have a backup handy, in case i.e. you mix up the dd parameters ("if" vs. "of") ;)

Regards,
Jens