Centos – Clone and Restore CentOS Server. Raid/LVM

centoslvmsoftware-raid

I have a CentOS server, and I want to create an exact copy of it. The device has a single 128MB drive mounted as /boot. I then have a 4 drive Software Raid 5 array, with 2 Logical Volumes on it. First Logical Volume is mounted at /, and the second is the swap. I need to be able to image the /boot drive, and then whole / Logical Volume. I was thinking I could use gparted and partition the new server and create the Logical Volumes. But I am not sure how I would then even restore

I have copied the contents of my raid setup, my partition setup, and LVM information to a pastebin to save space.

Pastebin

I am really clueless on this and have read most of the posted in the 'related' questions and nothing seems to be specific to this. Any help or guidance would be great.

Best Answer

If the kernel you're currently using to run the source server contains all of the drivers required to run the hardware on the destination server then the process isn't too painful. Start by using tar to create archives of your partitions and then store them in a accessible location (removable media or nfs server).

Boot another server with a live distro. Create the partitions you want an untar the archives to those partitions. Install grub to the MBR of the boot device. That's it.

If the server has different hardware or requires drivers for a different boot device, you'll need to compile a kernel for this to work, but, you'd have to do that anyway if you use imaging software and attempt to restore to mismatched hardware.

Nutshell: Restore partitions > Make /boot bootable (install grub) > Compile new kernel and make available to Grub (only if necessary) > done.

Related Topic