21
Create and Mount RAID-5 Array
0 Comments | Posted by Jeremy in Karmic Koala 9.1, Ubuntu, disk, mdadm, raid5
Karmic Koala instructions for creating the RAID 5 Software array on my Server
Originaly found here http://www.jamierf.co.uk/2009/11/04/software-raid-5-using-mdadm-in-ubuntu-9-10/ but stored on my blog for reference incase their blog dies one day.
1. I installed mdadm
sudo apt-get install mdadm
2. I listed all the drives
sudo fdisk -l
3. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively
sudo fdisk /dev/sda (but I also did this for the other drives in the array) /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
4. I edited each drive that was to be part of the array, for me my system drive and spare drive was /dev/sdg and /dev/sdh respectively so obviously I didn’t touch them
n (for new drive)
p (for primary partition
1 (for partition 1)
enter (to select first cylinder
enter (to select last cylinder)
t (to set disk type)
1 (for partition 1)
fd (for Linux Raid Autodetect)
w (to write changes to disk)
5. I created the array
sudo mdadm –create –verbose /dev/md0 –level=5 –raid-devices=6 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
6. I watched the progress
sudo mdadm -D /dev/md0
7. I got the details of the array
sudo mdadm –detail –scan
Output on this occasion was as follows; do not copy and paste this directly – it will be a different UUID for future arrays I create
ARRAY /dev/md0 level=raid5 num-devices=6 metadata=00.90 UUID=58155936:66553965:01f9e43d:ac30fbff
found out later that I needed to remove one of the zeroes from the metadata version… when I did a sudo mdadm -D it gave me an error for the version information.
ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff
8. I copied and pasted the above line into mdadm.conf
sudo nano /etc/mdadm.conf
File now has the following entry:
# definitions of existing MD arrays
ARRAY /dev/md0 level=raid5 num-devices=6 metadata=0.90 UUID=58155936:66553965:01f9e43d:ac30fbff
9. I created the file system
sudo mkfs.ext3 /dev/md0
10. I removed the default 5% reserved space from the drive
sudo tune2fs -m 0 /dev/md0
11. I created somewhere for the array to be mounted
cd /mnt
sudo mkdir raid
12. I wanted the drive to be mounted automaticaly on startup
sudo nano /etc/fstab
13. I added the following line
/dev/md0 /mnt/raid ext3 defaults 0 0
14. I mounted all arrays without rebooting
sudo mount -a
sudo fdisk -l
No comments yet.
Leave a comment!
<< Reassembling my RAID5 array after reinstall of Ubuntu Linux

