Creating and Configuring a Large Redundant Storage Array for a Network Share in Ubuntu using MDADM
- Do not create a hardware RAID array using the RAID configuration menu
- Make sure no drives are assigned to a RAID array
- Install the newest version of Ubuntu Server
- When asked for partitioning information
- Select manual partitioning
- Select "Create Software RAID”
- “Create MD device”
- Select RAID5 (we are using RAID5)
- Active devices = # (where # is the number of drives you want in the array)
- Spare devices = #
- Select all the drives you want in the array
- Select OK
- Create a partition on the newly created device (usually md0)
- Format as ext4
- Save and continue with install per usual
- You might want to select “ssh” from the package selection
- Make sure array device has been created
- Sudo fdisk –l
- Look for /dev/md0
- Check status of the software array
- Sudo mdadm --detail /dev/md0
- If the status of the array is “building” or “syncing”, let the process finish (may take several hours)
- Create a mount point for the array
- Sudo mkdir /media/RAIDStorage
- Modify fstab to mount partition on boot
- Sudo nano /etc/fstab
- Add a new line:
- /dev/md0 /media/RAIDStorage ext4 defaults 0 0
- Save and exit
- Remount
- Sudo mount –a
- Check device was mounted to /media/RAIDStorage
- Sudo mount | grep RAIDStorage
- Share RAIDStorage with NFS
- Sudo apt-get install nfs-kernel-server
- Edit exports file
- Sudo nano /etc/exports
- Add line
- /media/Storage/Case_Data 10.1.1.0/24(rw,insecure,async,no_subtree_check)
- Save and exit
- /etc/init.d/nfs-kernel-server restart
Also, we are using 'async' instead of 'sync'. For some reason, when writing very large files sync have very, very bad performance, while async allowed for maximum write speeds.
If there are write permission errors, check that the permissions on the folder (/media/RAIDStorage) on the server are set correctly for the user