Add new HDD to Azure VM and set RAID 0 under home directory

Hi, I need to attach some HDD to my Ubuntu Azure VM and enable RAID 0 for them to improve the performance. The new storage space will be under /home director (for storing my host data). I have data in /home already Could you please advise me to do this? Thanks.



Howdy -- you would first need to setup the RAID 0 (using Webmin -> Hardware -> Linux RAID can help). This can also be done outside of Webmin.

Once that is complete, what you could do is mount your new storage space temporarily at another location, such as /home2.

You can use Webmin to help you mount the storage, by going into Webmin -> System -> Disk and Network Filesystems.

Then, using a tool like rsync, copy all the data from your existing /home directory to the new one.

An example of how to do that is with this command:

rsync -av /home/ /home2/

Once the data is on your new drive, you can unmount the drive, and then re-mount it into /home.

It may also be under Un-Used Modules, which means there may be some configuration that needs to be done in order to get RAID working.

When accessing the module, it will tell you what needs done in order to make it work.

Thank you I installed the package and it shows. Then could you please tell me which file type I need to use when I want to mont:

Thanks, Giang Anh

You would need to partition and format the drive prior to mounting it.

I would suggest using ext3 or ext4.


I created the RAID already. Could you please tell me how to partition and format the drive? I tried to mouth the RAID Device 0 (the one I have just created?) but it show error:

Thanks, Giang Anh

You can do that in Webmin -> Hardware -> Partitions on Local Disks.


Follow your guideline: It shows error:

Failed to save partition : parted -s /dev/sdc unit cyl mkpart primary ext2 0 133544 ; parted -s /dev/sdc set 1 raid on failed : Error: /dev/sdc: unrecognised disk label Error: /dev/sdc: unrecognised disk label

Choose Linux EXT and it shows error:

Failed to save partition : parted -s /dev/sdc unit cyl mkpart primary 0 133544 failed : Error: /dev/sdc: unrecognised disk label

Ah, it looks like you're attempting to partition/format the actual disk, rather than the RAID device that was created.

Once you create a RAID 0 drive, you should have a new device that you can partition and format.

What is the output of this command:

cat /proc/mdstat

That will show some information about your RAID configuration.

Here is it:

root@JPlaySite:~# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdd[1] sdc[0]
      2145385472 blocks super 1.2 512k chunks

unused devices: <none>

According to that information, it looks like your RAID device is md0 (/dev/md0).

So when partitioning and formatting, you'd want to partition and format /dev/md0.

That would also be the device you would configure to load at boot time, you wouldn't refer to /dev/sdc or /dev/sdd directly. Those two drives now combine to form the /dev/md0 RAID drive.

I asked Jamie for some advice, as I haven't actually configured a software RAID device from within Webmin before.

He says that you can continue the configuration process by going into the "Linux RAID module" module, and there, click on "/dev/md0".

Once you do that, you should see a button at the bottom to create a new filesystem on it.

Once that is done, it can be mounted using the Disk and Network Filesystems module.


I was able to do it. After rsync, I used Disk and Network Filesystems to unmount and then mouth to /home. Here is the result:

root@JPlaySite:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        29G   28G     0 100% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            3.4G   12K  3.4G   1% /dev
tmpfs           697M  496K  697M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            3.5G     0  3.5G   0% /run/shm
none            100M     0  100M   0% /run/user
none             64K     0   64K   0% /etc/network/interfaces.dynamic.d
/dev/sdb1        99G   60M   94G   1% /mnt
/dev/md0        2.0T   26G  1.9T   2% /home

Is this all ok? So the old /home was replaced?

Thanks, Giang Anh

That looks good! It looks like /home is now a 2TB RAID drive.

Could you please tell me how can I delete the data in old /home? It still shows full.

Once your certain the data you have in /home is working as expected -- you could unmount your new /home, delete the contents of your old /home directory, then re-mount your new /home.

It's not possible to delete the contents of your old /home with the new one mounted on top of it.

Was able to delete the data. Thank you so much for your active support :)