I have an ubuntu 12.04 setup with two HDD that is setup in a software raid 1. Now I need to add two additional SSD drives for separate storage of some database files. They need to be setup in their own separate raid 1 array. Unfortunately I have no idea where and how to start? So from the beginning after having plugged the two drives in, and booted the server - then what?


Okay i got it:

1) First list all drives: sudo lshw -c storage -c disk and note down the drives that needs to be put into a new raid array (in my case /dev/sda and /dev/sdb)

1.1) If you need to find out what drives are already in a raid this can be done with sudo cat /etc/mdadm/mdadm.conf details about which drives they cover can be inspected with sudo mdadm --query --detail /dev/md0 where /dev/md0 is the array you want to inspect.

2) Now use fdisk to format the drives and create partitions for each drive: sudo fdisk /dev/sda this is done for each drive (and they should of cause be setup equally)

  • If the disk is not "clean" then press d and follow instructions to delete the current partitions (note all data will be lost on that disk!)
  • Then press n to create a new partition.
  • Press p for primary and 1 for one partition, and use the defaults (pressing return).
  • Press t for type and set the partition type to fd (linux raid autodetect).
  • press w for writing your changes and exit.

3) Create the RAID array: sudo mdadm --create /dev/md3 --chunk=128 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

4) Format the array: sudo mkfs -t ext4 /dev/md3

5) Lookup the infor for the new array using method in step 1.1 and edit sudo nano /etc/mdadm/mdadm.conf accordingly with the following line for your new array ARRAY /dev/md/3 metadata=1.2 UUID=f368e29e:b79c72bd:631ce90f:e3370f90 name=master-db:3

6) Create a directory (mount dir) for the new drive sudo mkdir /new_device

7) Mount to fstab by editing sudo nano /etc/fstab with /dev/md3 /new_device auto defaults 0 0

8) Run sudo mount -a

Check that everything runs with: sudo cat /proc/mdstat

Some helpfull links: https://help.ubuntu.com/community/Installation/SoftwareRAID http://superuser.com/questions/230497/how-can-i-add-a-raid-1-array-in-ubuntu-10-04 Which hard disk drive is which?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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