Linux Format

OMV: Build a low-power NAS

Discover how to manage your data better with OpenMediaV­ault and your own low-powered, Pi-centric network attached storage box with Mayank Sharma.

- Our expert Mayank Sharma was compelled to set up a working NAS so that he could store all his episodes of Friends and watch them on his Pi media centre.

Do you have a bunch of USB disks that you juggle between your various computers? Did you know that you can plug all of them into a Raspberry Pi, which you can then use as a network attached storage (NAS) box? Using the Pi as an always-on NAS box sounds like a wonderful use of the silent little device. However, setting it up as one used to be an involved process. That’s until the Debian-based OpenMediaV­ault (OMV) distro decided to roll out a version specifical­ly tuned to the Pi.

Once it’s up and running, you can configure and manage the distro using its browser-based administra­tion interface. You can then use the USB ports on the Pi to attach USB disks, which are then made available to your entire network for storage. Remember that for best performanc­e, make sure you use self-powered removable disks. You can use the disks attached to the OMV NAS individual­ly, or assemble them in a software RAID array. The distro has ample options to manage other advanced aspects of a NAS distro.

Get installed

To get started, download the Pi version from the distro’s website at www.openmediav­ault.org. The distro has separate releases for the Pi 2 and the original B/B+ models, so ensure you grab the correct one. Then extract the .img file from the download and transfer it on to an SD card with sudo dd if=~/omv_1.17_rpi_rpi2.img of=/dev/sdb replacing /dev/sdb with the location of your SD card.

Now boot the Pi with the freshly baked SD card. There’s no installati­on involved and you can start configurin­g the distro as soon as it boots up. You can access its browserbas­ed interface on the IP address of the Pi – such as 192.168.3.111. You’re asked to authentica­te yourself, which you can do using the default credential­s for the administra­tor – admin:openmediav­ault. However, you should change this default as soon as you log in. Head to System > General Settings in the navigation bar on the left, switch to the Web Administra­tor Password tab and enter the new password in the appropriat­e text boxes. You can also use the System menu to configure several aspects of the NAS server, such as the server’s date and time, enable plugins (seeExtendy­ourNAS) and keep the system updated.

Add storage

Once it’s up and running, plug one or multiple USB disks into the Raspberry Pi. Head to Storage > Physical Disks and click the Scan button to make OMV aware of the disks. Then use the Wipe button to clean the disks individual­ly. If you’ve

inserted multiple disks, OMV can even tie them into a software RAID (seewalkthr­oughoverth­epage). OMV supports multiple RAID levels and each requires a different number of disks. For example, the default RAID level 5 requires a minimum of three disks, while RAID 1, which mirrors data across drives, only needs a minimum of two.

If you don’t plan to use the inserted USB disk inside a RAID array, then after you’ve erased a drive, head to Storage > File Systems to create a filesystem on the drive. Here click the Create button and use the pull-down menu to select the device you wish to format. By default, the drives are formatted as Ext4 but you can select a different filesystem using the pull-down menu. Besides Ext4, OMV supports the Ext3, XFS and JFS filesystem­s. Repeat the process to create a filesystem on all of the attached USB disks. After creating the filesystem, select a drive and then click the Mount button to bring them online.

Adding Users

Before you can store data on the NAS device, you have to create one or more users. To do this, head to Access Rights Management > User. The Add button on this page is a pulldown menu that enables you to either add individual users or import a bunch of users by adding them in the specified format. When adding an individual user, you can also add them to an existing group. By default, all users are added to the Users group.

If you want users to have their own home directorie­s in the OMV server, switch to the Settings tab and tick the box to enable the home directory for the user. You must also specify the location for the home directory by selecting an existing shared folder on the NAS server or creating a new one.

Shares and permission­s

The next step is to define a shared folder. The chief considerat­ion while adding one is whether the NAS will be used by multiple users or a single individual. In case you’re going to be sharing the NAS storage space with multiple users, you can define several folders, each with different user permission­s. To add a folder, head to Access Rights Management > Shared Folders and click the Add button. In the dialog box that pops up, select the volume that’ll house the folder from the pull-down list. Then give the shared folder a name, such as Backup, and enter the path of the folder you wish to share, such as backup/. OMV creates the

folder if it doesn’t already exist. You can also optionally add a comment to describe the type of content the folder will hold. Play close attention to the Permission­s setting. By default, OMV only allows the administra­tor and any users you’ve added to read and write data to this folder, while others can only read its contents. This is a pretty safe default for most installati­ons, but the distro offers several permutatio­ns and combinatio­ns of permission­s that you can select from the pull-down menu.

Fine-tune permission­s

Even if you select the default Permission­s setting when creating folders, which lets all users read and write data to the folder, you can fine-tune the access permission­s and disable certain users from accessing or modifying the contents of a particular folder. For this, after adding a user, head to the Shared Folders section, select the folder you want to control access to and click the Privileges button. This opens a window with a list of the users you’ve added, along with tickboxes for controllin­g their access to that folder, so for example you can allow read-only access.

With the users and shared folders set up, you’re now

ready to share the NAS storage with your network. Follow the walkthroug­h to enable a network service that people can use to access the shared folders on the NAS. OMV supports various popular protocols and services, including NFS, SMB/ CIFS, FTP, TFTP, SSH, rsync and more.

Once you’ve created a network share, you can access the shared folders from anywhere on the network, irrespecti­ve of whether they reside on an individual disk or a RAID array. You can either use your file manager’s built-in Network feature to access the network shares, or enter the IP address of the NAS device in the location area, such as

smb://192.168.3.111. You’re prompted for a username and password before you can access the folders – unless, of course, you have marked them as public when adding them via Samba. Enter the credential­s of a user who has the appropriat­e permission to access the folder. After they’ve been verified, OMV mounts the shared folder. You can now upload files into the shared folder or delete them, if you have the permission, just as in the case of a regular folder.

It might take a little getting used to, but OpenMediaV­ault is a wonderfull­y versatile NAS option that helps you exploit the true potential of the Raspberry Pi.

 ??  ?? A useful tip to bear in mind: head to System > Update Manager and make sure you install all available updates.
A useful tip to bear in mind: head to System > Update Manager and make sure you install all available updates.
 ??  ??
 ??  ?? OMV keeps tabs on all aspects of the server on which it’s running. Go to Diagnostic­s > System Informatio­n to see for yourself.
OMV keeps tabs on all aspects of the server on which it’s running. Go to Diagnostic­s > System Informatio­n to see for yourself.
 ??  ?? You can create self-signed security certificat­es if you don’t wish to transfer data to and from your NAS device over unsecured HTTP.
You can create self-signed security certificat­es if you don’t wish to transfer data to and from your NAS device over unsecured HTTP.
 ??  ?? You can fetch additional plugins after enabling more repositori­es from under the System > OMV-Extras.org > Repos tab.
You can fetch additional plugins after enabling more repositori­es from under the System > OMV-Extras.org > Repos tab.

Newspapers in English

Newspapers from Australia