Can I configure software RAID on an existing server without losing the existing partition?


0

1 disk ve yüklü ve çalışan Ubuntu 12.10 ile mevcut bir sunucu var.

Ubuntu'nun yazılım RAID'ini kullanarak 2. disk eklemek ve RAID 0'ı iki disk üzerinde yapılandırmak istiyorum. Sunucuyu yeniden görüntülemeden veya işletim sistemini yeniden yüklemeden bunu şeffaf şekilde yapabilir miyim?

RAID şu anda mevcut diskte yapılandırılmamış.

Yanıtlar:


1

While you can create a MD-device on the fly and it will sync the disks, the trouble in your case is that RAIDs usually have a superblock on the devices in question and only serve the rest as a special device. Since the superblock usually (but not always) lies at the beginning of the underlying device, you'd have to move the file system (and even when the superblock is at the end of the device, you have to shrink the file system).

That said, mdadm allows you to create a superblock-less RAID, but you should know what you are doing (for example you should ensure you always build the RAID with the same parameters) - see section "BUILD MODE" in man mdadm.

Also note, that if you want to boot from the device, you either have to set up the RAID from the initrd or make a pivot_root later on "manually" (which is what initrd scripts do at some point).


Follow up, related question: Can I configure a single disk as an MD-device (as you say), and then later add a 2nd disk and then be able to link them together in raid-0 without major configuration change? I can safely expect mdadm to handle syncing the two partitions appropriately?
David Parks

1
I think so. It works for devices with superblock and I don't see any reason it shouldn't without a sb. As for the syncing - better try it first on a non-production system. And as always, do have a backup.
peterph

1
@DavidParks Not for RAID 0, no. I don't think Linux RAID can resize a RAID 0 array.
Gilles
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.