Table of Contents

NAS - Build a Linux NAS - Mount the RAID Array

Mount the Array

sudo mkdir /mnt/nas
sudo mount /dev/md0 /mnt/nas

Set Permissions of the Mount

chmod 0777 /mnt/nas

NOTE: This will allow all users to have access to this location.

  • This could be restricted to only specific users or groups as required.

Check how much disk space is available in the RAID

df -h /mnt/nas

returns:

 

Check the Mount

lsblk

returns:

NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                      8:0    0 232.9G  0 disk 
├─sda1                   8:1    0  1007K  0 part 
├─sda2                   8:2    0   512M  0 part /boot/efi
├─sda3                 253:28   0     8G  0 part [SWAP]
├─sda4                 253:29   0    58G  0 part /
sdb                      8:32   0  14.6T  0 disk 
├─md0                    9      0  14.6T  0 raid5 /mnt/nas
sdc                      8:48   0  14.6T  0 disk 
├─md0                    9      0  14.6T  0 raid5 /mnt/nas
sdd                      8:64   0  14.6T  0 disk 
├─md0                    9      0  14.6T  0 raid5 /mnt/nas

Test writing to the mounted array

sudo touch /mnt/nas/test
ls -al /mnt/nas/

returns:

total 24
drwxr-xr-x 3 root root 4096 Feb 14 11:19 .
drwxr-xr-x 4 root root 4096 Feb 14 11:19 ..
drwx------ 2 root root 16384 Feb 14 11:19 lost+found
-rw-r--r-- 1 root root 0 Feb 14 11:19 test

Ensure the array always get mounted on boot

echo '/dev/md0 /mnt/nas ext4 defaults,nofail 0 0' | sudo tee -a /etc/fstab

returns:

/dev/md0 /mnt/nas ext4 defaults,nofail 0 0

NOTE: This adds an entry into the /etc/fstab file.

The x-gvfs-show option can also be used, which will let you see the RAID in the sidebar of the gnome file manager.

/dev/md0  /mnt/nas ext4 defaults,x-gvfs-show 0 0