Linux – move an entire software RAID1 array containing Linux to another machine

linuxmigrationraid1software-raid

I want to move an entire array of drives from old server hardware to new server hardware. There are 3 SATA drives with two partitions each; a small boot partition and a data partition. There are two software RAID 1 arrays, one containing all the boot partitions and one containing all the data partitions.

My understanding of software RAID is that all of the information is stored on the drives, so neither the hardware nor the software (OS) will see anything different if I plug them into another motherboard, even if they're not on the same ports. I guess I might need to make sure I boot off the same physical drive as I do now, but even the boot partition is mirrored so perhaps not?

Can I take this array of drives and plug them into a replacement server and just boot it? The new server does not have exactly the same hardware but the overall configuration is the same; they both have 64-bit Intel CPUs and a similar amount of RAM.

This question is not the same as How do I move a Linux software RAID to a new machine? because in my case the kernel is in the RAID array, so everything will be moved together.

Best Answer

One of the advantages of Linux software RAID is that you can do just that. Drives are identified by GUIDs, so even if you swap them, that's no problem. I've moved arrays from one server to another like this.

On a sidenote; with good hardware RAID, you can do this as long as the controllers are compatible. Most of one vendor are. With fake RAID and cheap on-board desktop PC RAID, you can forget it.

About booting; if your boot partition is RAIDed, it can use either one. However, do install the grub boot loader on all disks (just grub-install /dev/sda; grub-install /dev/sdb, I think).

One word to note: when you plug your drives in the new server, your /etc/udev/rules.d/70-persistent-net.rules will detect new ethernet devices. If you previously had eth0 and eth1, you will now have eth2 and eth3. You have to edit that udev file to make it eth0 and eth1 again.