Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got an existing server with 1 disk and Ubuntu 12.10 installed and running.

I want to add a 2nd disk and configure RAID 0 across the two disks using Ubuntu's software RAID. Can I do this transparently without re-imaging the server or re-installing the OS?

RAID is not currently configured on the existing disk.

share|improve this question
up vote 1 down vote accepted

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).

share|improve this answer
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 Apr 4 '13 at 11:48
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 Apr 4 '13 at 11:59
@DavidParks Not for RAID 0, no. I don't think Linux RAID can resize a RAID 0 array. – Gilles Apr 4 '13 at 23:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.