Now we've added a hard disk to our system, we can start configuring OMV, but before we dive in, there's one thing we must do first: set the system time.
Unfortunately, the bPi doesn't have a battery-backed clock, so when you turn it on, it will have no idea what time it is. For now, we'll set the time in the System/Date & Time page of the web admin interface, and we'll address later the issue of how to do this automatically when the bPi boots up.
Adding users
I added a taka user account earlier and this will have read-only access to the NAS, but I also want another special user account that will have write access.
So, I create a taka-w user in the same way as before, and we'll give it write access in the next section.
Creating shared folders
Let's now create a shared folder, to keep our files in.
Go to the Access Rights Management/Shared Folders tab in the web admin interface and click on the Add button. Give the new shared folder a name, choose where you want it to live, then set the permissions[1]How OMV permissions work is described in more detail here. as follows:
- Administrator = read/write
- Users = read-only
- Others = no access
This gives OMV users read-only access to the shared folder, so in order to give the taka-w user write access, click on the ACL[2]An "Access Control List" is a more precise set of user permissions that can be set on a file. button and configure things as follows:
- In the User/Group permissions section:
- Find the taka-w user and give it Read/Write access.
- In the Extra options section[3]You might think that because I'm just storing music in this folder, I won't need Execute permissions, which is correct for files, but in Linux, you need Execute permissions on a directory to be able to look into it. If you don't assign Execute permissions here, you won't be able to open any directories!:
- The Owner should be root, and have Read/Write/Execute access.
- The Group should be users, and have Read/Execute access.
- Others should have no access (i.e. None).
Make sure Replace all existing permissions and Apply permissions to files and subfolders[4]This is not strictly necessary right now, since we just created the folder and so it's empty, but if you do this later, you will want these permissions to be applied to everything in the folder. are ticked, then click on Apply.
We now have a shared folder that can be read by the taka user (and any other user you add to OMV), and can be written to by taka-w. If we take a look at our drive, we can see OMV has created the folder at the top of our file system:
Creating convenience symlinks
It's a bit tedious having to use the really long folder name in /media/ every time you want to access your files (even with auto-completion), so, while not strictly necessary, I like to set up symlinks that give me more convenient access:
I can now access the new music shared folder via the more convenient /shares/music/.
Configuring Samba
If we want access to our new shared folder from a Windows computer, we need to enable Samba[5]This is a system service that lets Windows access files on a Linux computer..
First, enable the Samba service in the Services/SMB/CIFS section of the web admin interface.
Then, in the Shares tab, add the shared folder.
I can now access the shared folder from Windows:
Uploading files to the NAS
In the previous section, I gained access to the shared folder from Windows, but if I try to drag a file into it, I get a "You need permission to perform this action" error. This is because I'm logged in as taka[6]My Windows account is called "taka", and so by default, I will connect to Samba using the same name., which only has read access to the folder. To be able to upload files, I need to connect to Samba using the special taka-w account.
- Right-click on the folder and choose Map network drive...
- Tick Connect using different credentials.
Or you can do it from the console:
I'm now connected to Samba via Q: drive, as the taka-w user, and can upload, change or delete files.
![]() | Windows does not allow multiple connections to the same server using different accounts, so to work around this, I normally access the bPi (using the taka account) via its server name (e.g. \\BanaNAS), but use its IP address (e.g. \\10.0.0.2) when I want to connect using the taka-w account. |
When you're done, close the connection by right-clicking on the folder and choosing "Disconnect", or from the console:
net use q: /d
« Adding a new hard disk to Open Media Vault | Tutorial index | Managing permissions in Open Media Vault » |
References
↵1 | How OMV permissions work is described in more detail here. |
---|---|
↵2 | An "Access Control List" is a more precise set of user permissions that can be set on a file. |
↵3 | You might think that because I'm just storing music in this folder, I won't need Execute permissions, which is correct for files, but in Linux, you need Execute permissions on a directory to be able to look into it. If you don't assign Execute permissions here, you won't be able to open any directories! |
↵4 | This is not strictly necessary right now, since we just created the folder and so it's empty, but if you do this later, you will want these permissions to be applied to everything in the folder. |
↵5 | This is a system service that lets Windows access files on a Linux computer. |
↵6 | My Windows account is called "taka", and so by default, I will connect to Samba using the same name. |