Submitted by LeGiangAnh on Mon, 08/17/2015 - 10:29 Pro Licensee
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.
Status:
Active
Comments
Submitted by andreychek on Mon, 08/17/2015 - 10:57 Comment #1
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.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 11:05 Pro Licensee Comment #2
Hi,
I cannot find Linux RAID https://goo.gl/ARStoU
Submitted by andreychek on Mon, 08/17/2015 - 11:15 Comment #3
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.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 11:28 Pro Licensee Comment #4
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: https://goo.gl/M9N95y
Thanks, Giang Anh
Submitted by andreychek on Mon, 08/17/2015 - 11:57 Comment #5
You would need to partition and format the drive prior to mounting it.
I would suggest using ext3 or ext4.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 12:38 Pro Licensee Comment #6
Hi,
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: https://goo.gl/9kt9kl https://goo.gl/olunJs
Thanks, Giang Anh
Submitted by andreychek on Mon, 08/17/2015 - 12:43 Comment #7
You can do that in Webmin -> Hardware -> Partitions on Local Disks.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 13:05 Pro Licensee Comment #8
Hi,
Follow your guideline: https://goo.gl/lk7VLN 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
Submitted by andreychek on Mon, 08/17/2015 - 16:35 Comment #9
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.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 20:16 Pro Licensee Comment #10
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>
Submitted by andreychek on Mon, 08/17/2015 - 20:27 Comment #11
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.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 20:33 Pro Licensee Comment #12
Hi,
There isn't that disk in Webmin: https://goo.gl/9hOKbT
Thanks, Giang Anh
Submitted by andreychek on Mon, 08/17/2015 - 21:14 Comment #13
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.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 23:13 Pro Licensee Comment #14
Hi,
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
Submitted by andreychek on Mon, 08/17/2015 - 23:19 Comment #15
That looks good! It looks like /home is now a 2TB RAID drive.
Submitted by LeGiangAnh on Mon, 08/17/2015 - 23:29 Pro Licensee Comment #16
Could you please tell me how can I delete the data in old /home? It still shows full.
Submitted by andreychek on Mon, 08/17/2015 - 23:33 Comment #17
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.
Submitted by LeGiangAnh on Tue, 08/18/2015 - 02:23 Pro Licensee Comment #18
Was able to delete the data. Thank you so much for your active support :)