Tuesday, December 24, 2013

Linux Mint Petra New RAID writeable

Hi,

Spent a little bit of time messing around creating a software RAID with mdadm. It's quite simple once you have the three drives installed for RAID 5.


sudo mdadm -Cv /dev/md0 -l5 -n3 /dev/sda /dev/sdb /dev/sdc

In my case I wasn't installing the OS to a raid but just mounting storage raids so it was much simpler. I'll have to be careful to backup the home directory. After this is done and you reboot you should see the RAID device in Ubuntu's disk management under Menu -> Preferences -> Disks Next is the trick (and the point of the post). The fstab line.

sudo vim /etc/fstab



The fstab code (add at end):

# RAID ARRAY
UUID=XXXX /mnt/folder ext4 defaults 0 0


I thought I would have to use some complicated options, but defaults works well. Replace XXXX with the UUID from disk management. When you reboot and login, you will see the RAID mounted on /mnt/folder. You will not be able to access it. Never fear, simply take control of the folder. (note this will modify all the files in the mounted drive -- I had an empty drive so this didn't matter to me, but if your drive is not empty you may not wish to do this). (if you drive is not empty, you will have to fool around with the fstab line above. See the manpage for fstab to change defaults to the appropriate values).

sudo chown user:users -R /mnt/folder

That's it. Enjoy your new RAID. Remember, RAID is not backup. Use rsync -av and an external drive (ideally stored in a separate location) for that.

No comments:

Post a Comment