OpenMediaVault is a Debian-based network-attached storage (NAS) solution that supports SMB/CIFS, SSH, FTP, RSync, DAAP media server, BitTorrent client e.t.c. Its modular design, allows OpenMediaVault to be extended through plugins and enhance its functionality. The OpenMediaVault NAS is highly preferred for use in small businesses and homes.
Samba is one of the services provided by OpenMediaVault. It allows one to create file and printer sharing across a network for both Windows and Unix systems using the SMB(Server Message Block) protocol. Samba is supported on various Operating Systems such as Windows, Linux, Solaris, Linux, AIX, and BSD variants
NFS, an acronym for the Network File System, is another protocol used to store and access shares across a network. It was developed by Sun Microsystems in 1984.
Both Samba and NFS work on a client/server model where the server manages the clients and stores the shared data. The clients connect to the server and can view and access the data just like any other local file system.
This guide demonstrates how to create and use Samba / CIFS / NFS Shares on OpenMediaVault.
Getting Started
For this guide, it is recommended that you have an OpenMediaVault NAS Storage Server installed. This can be achieved using the aid provided in the guide below:
Once installed, proceed as below.
Step 1 – Enable Samba/CIFS /NFS Network Share
Now access the OpenMediaVault NAS Storage Server using the URL http://IP_Address
Login using the set or default credentials:
User: admin
Password: openmediavault
On successful login, enable the Samba/CIF service under Services > SMB / CIFS and enable it as below:
For NFS, enable it under Services > NFS and set it to enabled as shown.
Save and apply the changes made and proceed as below.
Step 2 – Create the data storage volume
Normally, OpenMediaVault NAS Storage Server uses a separate disk partition to act as a storage volume. For this guide, I have a second disk /dev/sdb attached:
Add this data disk to the server under Storage > File Systems > Create
Format the disk as below:
Once formatted, the disk will be available ready to be mounted. Mount it as shown.
The mounted data disk will be ready for use:
Now create a user on OpenMediaVault with the rights to access the share by navigating to Access Rights Management > User > Add
Provide the required credentials save and apply the changes.
Step 3 – Create a file share
Now on the mounted data disk, we need to create a file share that can be accessed by the user. This is done by navigating to Access Rights Management> Shared Folders > Add
Here, I will set the share name as Downloads and add it to the data disk. Save and apply the changes made.
Proceed and grant the created user Read/Write permissions to the share by clicking on the created file share and selecting privileges.
Now enable services to access the share.
For Samba enable the SMB/CIFS service by navigating to Services > SMB/CIFS > Shares
Remember to select the shared folder as the folder you intend to share over the network. Save and apply the changes and you will have your NAS device ready to be accessed via the SMB/CIFS protocol.
For NFS, add the share by navigating to Services > NFS > Share and make the below settings.
Remember to set the shared folder, the clients allowed to access the share, and permissions.
Step 4 – Access the Samba / CIFS / NFS Shares from the Client.
The created share can be accessed using a Windows and Linux system. This guide will demonstrate how to access both the Samba and NFS shares from the client.
4.1 – Access the NFS Share from the Client.
The created NFS share can be on Linux systems, with the below packages installed.
##On Debian/Ubuntu
sudo apt install nfs-common
##On RHEL/CentOS/Rocky Linux/ Alma Linux
sudo dnf install nfs-utils -y
Once installed, edit the below file and add the domain name/IP address of the OpenMediaVault NAS Storage Server.
$ sudo vim /etc/idmapd.conf
# set your own domain here, if it differs from FQDN minus hostname
Domain = 192.168.100.47
Now verify if the NFS share is accessible as below:
$ showmount -e 192.168.100.47
Export list for 192.168.100.47:
/export 192.168.100.0/24
/export/Downloads 192.168.100.0/24
Proceed and create a mount point:
sudo mkdir /mnt/nfs_share
Now mount the NFS share temporarily using the command:
sudo mount -t nfs 192.168.100.47:/export/Downloads /mnt/nfs_share
Verify if the path has been mounted:
$ ls -al /mnt/nfs_share/
total 12
drwxrwsr-x 3 root users 4096 Mar 27 15:05 .
drwxr-xr-x 4 root root 4096 Mar 30 14:22 ..
drwxrwsr-x 3 ubuntu users 4096 Mar 30 12:54 'new folder'
To configure a permanent mount point on the NFS Client, edit the Fstab as below:
$ sudo vim /etc/fstab
192.168.100.47:/export/Downloads /mnt/nfs_share nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
4.2 – Access the Samba / CIFS Share from the Client
The Samba share can be accessed on both Linux and Windows systems as below
4.2.1- Setup a Linux Client
To be able to access the share, you probably need the Samba packages installed. These packages can be installed as below:
##On Debian/Ubuntu
sudo apt install samba-client cifs-utils -y
##On RHEL/CentOS/Rocky Linux/ Alma Linux
sudo yum install samba-client cifs-utils -y
The share can now be accessed on the file manager under Other locations using the syntax:
smb://servername/Share_name
For example:
Proceed and provide the credentials for the OpenMediaVault user created in step 2.
Now here, you can view, create and delete files in the share.
Alternatively, you can mount the file to a specific location as below:
First, create a mount point say /mnt/share
sudo mkdir /mnt/share
Create a temporary mount using the command below:
$ sudo mount -t cifs -o user=openmedia //192.168.100.47/Downloads /mnt/share
Password for openmedia@//192.168.100.47/Downloads: (press TAB for no*********
In the command replace 192.168.100.47 with the IP_Address of the OpenMediaVault server and also fill in the required OpenMediaVault user and password credentials. Remember this mount will not survive a system reboot.
To mount the share permanently on your system proceed as below.
Now edit the Fstab file to accommodate the share as below:
$ sudo vim /etc/fstab
//192.168.100.47/Downloads /mnt/share cifs user=<userName>,pass=<passwd> 0 0
Now the file should persist on system boot.
4.2.2 – Setup a Windows Client
To be able to access the share, browse using the IP of the OpenMediaVault server. Launch the run box using Win+R and provide the IP as below:
Provide the OpenMediaVault user credentials created in step 2.
The share will be granted as below.
To permanently mount the file right-click on This PC and select Map Network Drive
Provide the path you want to mount as below.
Now you should have the share permanently mounted on your Windows system.
Conclusion.
That marks the end of this guide on how to create and use Samba / CIFS / NFS Shares on OpenMediaVault. Now you can share files easily between Linux and Windows systems over the network.
Interested in more?
- How To Configure Samba Share on Debian
- Install and Configure NFS Server on Rocky Linux 8
- Configure NFS Client on Ubuntu