SnapRAID is a straightforward, software program RAID system for Home windows and Linux techniques that enables customers to set up a drive pool to home knowledge simply. This system is freed from cost, is open supply, and runs on most Linux working system with ease. On this tutorial, we’ll be focusing on setting up SnapRAID on Ubuntu server.

Notice: although this tutorial focuses on Ubuntu server, it’s attainable to observe the directions and set it up on different Linux working techniques. The directions are close to equivalent.

Earlier than we start

For SnapRAID to work appropriately, you’ll want to have 4 arduous drives. Ideally, the arduous drives must be the identical dimension, and arduous drives should be formatted with the identical file system (Ext4.) On  Ubuntu Server, the quickest manner to accomplish that is to format with Cfdisk. To begin the formatting course of, go to the Ubuntu server console, or, SSH in remotely and use the command syntax under. Remember the fact that you have to to repeat this course of 4 instances so that every arduous drive has the identical filesystem, and so forth.

Notice: please change the X with the precise label of the drive you would like to format.

sudo cfdisk /dev/sdX

As soon as the CFdisk partition editor is open within the console, use it to delete current filesystems on the arduous drive. Then, create a brand new Ext4 partition that takes up your complete dimension of the drive. When executed enhancing and formatting, choose “Write” to save the adjustments, and “Quit” to exit.

Set up SnapRAID

On Ubuntu, you’ll have the ability to get the SnapRAID software program very fairly rapidly. The explanation for that is that the developer maintains a software program PPA which is obtainable for Ubuntu Server, in addition to the Ubuntu Desktop distribution. So as to add the PPA to Ubuntu Server, you should first allow PPA assist.

sudo apt set up software-properties-common

With the PPA software program up and operating, it’s time to add the SnapRAID software program repository to the system.

sudo add-apt-repository ppa:tikhonov/snapraid

Run the replace command to refresh Ubuntu, in order that the SnapRAID PPA could be totally built-in into your Ubuntu system.

sudo apt replace

Lastly, set up the SnapRAID software program.

sudo apt set up snapraid

Create SnapRAID directories

If you would like to use the SnapRAID software program appropriately on Ubuntu, a number of totally different folders should be set up. These directories are for the drive mounts, in addition to the information pool. The primary folder you should create is the one that can go in /var/.

sudo mkdir -p /var/snapraid/

Subsequent, a number of folders should be created within the /mnt/ listing. 5 of them to be precise. To make all of those folders with one straightforward command, do the next:

sudo mkdir -p /mnt/{disk1,disk2,disk3,disk4,knowledge}

SnapRAID configuration file

Now that the directories are set, it’s time to set up the SnapRAID configuration file. To do that, open up the snapraid.conf file in Nano with the command under.

sudo nano -w /and so forth/snapraid.conf

First, look via the configuration file and seek for the road that claims "# Format: "parity FILE_PATH" Beneath this line, erase the code there and change it with:

parity /mnt/disk4/snapraid.parity

Subsequent, transfer down to the road within the configuration file that claims "# Format: "content material FILE_PATH". Erase the strains immediately under it. Change it with these 4 strains.

content material /var/snapraid.content material
content material /mnt/disk1/snapraid.content material
content material /mnt/disk2/snapraid.content material
content material /mnt/disk3/snapraid.content material

Transfer on down the file previous the Content material part and find the road within the configuration file that claims "# Format: "disk DISK_NAME DISK_MOUNT_POINT". As soon as once more, take away all the code immediately under it and change it with the code under.

knowledge d1 /mnt/disk1/
knowledge d2 /mnt/disk2/
knowledge d3 /mnt/disk3/

Lastly, transfer down the configuration file and find the "#pool /pool" line. Beneath it, specify the /mnt/knowledge listing.

pool /mnt/knowledge

After specifying the situation of the information pool within the configuration file, save the edits by urgent Ctrl + O. Then, shut the editor with Ctrl + X.

Configure SnapRAID drive mounts

SnapRAID requires all the arduous drives set up within the /and so forth/fstab file. So as to add these drive mounts, go to the terminal and do the next.

Step 1: Run the blkid command on every of your arduous drives. This command will let you know the UUID. Make certain to change X with the drive letter and Y with the partition quantity (aka /dev/sdb1, and so forth.)

sudo blkid /dev/sdXY

Step 2: Copy the UUID output from the blkid command for every drive partition, and reserve it to a textual content file in your favourite textual content editor for later.

Step 3: Use the next echo instructions to rapidly write in your drive mounts within the /and so forth/fstab file. Make certain to change “example-uuid” with the UUIDs you saved within the textual content editor.

sudo -s

echo ' ' >> /and so forth/fstab
echo '# Drives for SnapRAID configuration' >> /and so forth/fstab
echo 'UUID=example-uuid /mnt/disk1 ext4 noatime,defaults 0 0' >> /and so forth/fstab
echo 'UUID=example-uuid /mnt/disk2 ext4 noatime,defaults 0 0 ' >> /and so forth/fstab
echo 'UUID=example-uuid /mnt/disk3 ext4 noatime,defaults 0 0' >> /and so forth/fstab
echo 'UUID=example-uuid /mnt/disk4 ext4 noatime,defaults 0 0 ' >> /and so forth/fstab

Step 4: Use the next echo instructions to add the AUFS drive pool into your /and so forth/fstab folder.

echo ' ' >> /and so forth/fstab
echo '#SnapRAID AuFS mount' >> /and so forth/fstab
echo 'none /mnt/knowledge aufs br=/mnt/disk1=rw:/mnt/disk2=rw:/mnt/disk3=rw,create=mfs,auto 0 0' >> /and so forth/fstab

Step 5: Reboot the Ubuntu server. When it comes again on-line, all drives can be loaded into the proper folders prepared to use with SnapRAID.

Begin utilizing SnapRAID

With all of the directories mounted and the software program put in, SnapRAID is prepared to use. Now all that’s left is to place knowledge within the pool listing. To do that, acquire a root shell in your Ubuntu server’s command-line shell. Then, observe the command-examples under to place information and folders onto the drive pool.

Put single information on SnapRAID pool

sudo -s

cp /path/to/single/file /mnt/knowledge

Put directories on SnapRAID pool

sudo -s

cp -r /path/to/folder/ /mnt/knowledge

When your knowledge is within the SnapRAID pool, run the snapraid sync command to sync up the information.

snapraid sync



Source link

Share.
Leave A Reply

Exit mobile version