Changes

From Amahi Wiki
Jump to: navigation, search
1,284 bytes added ,  06:11, 12 May 2013
m
#*<blockquote>su -</blockquote>
#*<blockquote>fdisk -l</blockquote>
#*What you are looking for is probably going to be something like /dev/sd**some letter**. In my case, since I installed Fedora on one hard drive first before installing my 3 other disks RAID disks, the above command returns that I have disks labelled /dev/sda /dev/sdb /dev/sdc and /dev/sdd. I, of course, won't be using the hard drive on which I installed Fedora (/dev/sda), so my array will be created using the /dev/sdb /dev/sdc and /dev/sdd disks.
#Unmount the partitions:
#*<blockquote>umount /dev/sdb</blockquote>
#*This also can take a really long time, as well, but not nearly as long as creating the array itself.
#Unfortunately, Linux does not automatically remember your RAID settings, so you need to create a configuration file so that Linux knows that to do. Fortunately, you don't need to know (or type) the specifics, which mainly involves a really long alpha-numeric ID string:
#*<blockquote>mdadm --detail --scan --verbose > /etc/mdadm.conf</blockquote>
#Now, move all your shares to the RAID array:
#*<blockquote>mv /var/hda/files/* /dev/md0</blockquote>
#Unmount Create a mount point for the arrayArray:#*<blockquote>umount mkdir /devmnt/md0raid</blockquote>
#Edit the /etc/fstab file, so that the shares get mounted to the array on startup:
#*<blockquote>nano /etc/fstab</blockquote>
#*Edit the line containing '/var/hda/files' to read '/dev/md0 /var/hda/files ext4 defaults 1 2'.
#*NOTE: If you do not see the above then place the below on a new line:
#**<blockquote>/dev/md0 /mnt/raid ext4 defaults 1 2</blockquote>
#**If you used a different filesystem other than ext4, place that filesystem name in place of the 'ext4' above.
#Now, finally, mount your array:
That is it! Enjoy your new large storage array!
 
= How to Add New Drives to An Existing Raid5 =
 
As I had to find out, adding a drive to a RAID 5 is easy.
 
Adding the drive to the RAID
mdadm --add /dev/md# /dev/sd# (# is the number of the drive you adding)
 
Growing The RAID
mdadm --grow --raid-devices=# /dev/md$
(# is the total number of the drives in the array and $ is the RAID)
 
Now we let the RAID rebuild and we can watch it reshape by typing:
watch cat /proc/mdstat
It will take a couple hours for the drive to reshape (PLEASE do not reboot the machine during the reshaping process)
 
After the reshape finished successfully, we need to make sure that the mdadm.conf has the correct drive number in it.
 
nano /etc/mdadm.conf
 
Here we change the number of total drives you have in your array
It should look similar to this
 
Mdadm.conf written out by anaconda
MAILADDR root
ARRAY /dev/md0 level=raid5 num-devices=XX UUID=4cc02637:e3832bed:bfe78010:bc810f
(where XX needs to be changed to the actual number of drives you have in the array)
 
Save and close nano: [ctrl+x]
 
Reboot the machine after the reshape has finished and you made the changes to make sure the machine boots correctly