2

I just set up a storage-manager server that I connect via iscsi to my main system and am trying to set up a mirrored volume. The resultant volume would be a mirror of /dev/sda1 and /dev/sdd4, however I noticed that there are no raid devices set up. (here is the output of cat /proc/mdstat)

    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    unused devices: <none>

Due to this I set up an LVM but this combines the 2 disks which is not what I wanted... so back to raid1... but how... mdadm?

Tried it: the output of the following command simply says "mdadm: no raid-devices specified"

    sudo mdadm --create --verbose /dev/md0 --level=raid1 /dev/sdd4 /dev/sda1

I'm assuming this is because the device /dev/md0 doesn't exist.

So my question is how/could I make /dev/md0 a raid device to work with the raid1 setup and mdadm (without reinstalling my system)? If this proves impossible, how would I set up a mirrored LVM on Ubuntu 16.04?

Any insight is appreciated. Thanks!

1

1 Answer 1

1

Thanks to Terrance I found this tutorial that works great

https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04

basically the instructions are as follows:

    1.) Change the partition type --> fdisk /dev/sdd --> press t, select partition, l to list codes, looking for "Linux raid setup" usually fd
    2.) Do the above for every volume you plan to add --> fdisk /dev/sda | t | 1 | fd
    3.) Zero the superblock of the devices --> mdadm --zero-superblock /dev/sdd4
    4.) Create the raid device --> mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sdd4 /dev/sda1
    5.) check to make sure device exists --> cat /proc/mdstat --> should now see your raid device
    6.) Create filesystems on our raid array --> mkfs.ntfs /dev/md0 
    7.) Mount raid array --> mount /dev/md0 /srv 
    8.) I recommend a benchmark for your array so you have an idea if something is going wrong

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .