How to use the UNVR as a NAS (Instructions)
So I really like the look of the Unifi equipment so I really wanted a NAS that looked right with the rest of my unifi gear and was easily manageable with the OS.
I found so many posts on reddit and google that said you cant do it. then I found a couple posts, one mentioned below that kinda pointed me in the right direction and got me to pull the plug on a UNVR.
Im sure there a number of people out there like me that dont need the protect functionality and just want a nice looking nas. I have 4 cameras on my UMDP and thats fine for me.
So got my machine and found a number of different instructions for setting up SMB and put them together with what I know of the UNVR and built this Instruction for anyone else out there like me.
**Note – I am using the UNVR solely for a NAS. I have updated the device to the latest settings first and have then turned off all updates. If you want to use this for protect I don’t currently see that as a problem but I any updates to the console could break some of this (potentially)
Create a RAID array on the UNVR
Turn on SSH in the UNVR Console Settings
Open Terminal (Putty or whatever you use)
- Connect to the IP address of UNVR in Unifi Network Console
- [ssh [email protected]] <-whatever yours is
Start the samba service
- sudo service smbd start
Confirm service started
- systemctl status smbd [note the disabled, we will fix in next step] [red does not indicate bad]
Set the service to start on boot/reboot
- systemctl enable smbd.service
Check what volumes are mounted you will need to know this to configure the smb.conf file
- lsblk
Whatever RAID array you want to use make sure to note this (im using volume1 which I guess will probably be what yours will say too)
Navigate to the smb.conf file
- cd /etc/samba
Make a backup copy of the smb.conf file
- cp smb.conf smb.conf.bak
You can see its created with the ls command
Install nano to edit the conf file.
- sudo apt install nano
Edit the smb.conf file with nano
- sudo nano smb.conf
You can use this file for your starting point it works.
**Note the path and volume. You have to specify the volume otherwise you will be accessing your share on the 4gb boot volume
In the next step we will create the directories, user accounts and set the permissions
- CTRL X to exit and save
Navigate to your RAID volume
- cd /volume1
Make Directory for Public and Protected ( you can use the path that you want to use here )
- sudo Mkdir Samba
- cd Samba
- mkdir Public
- mkdir Protected
Create a user (“Robert”) and add that user to a group (smbgrp)
First you need to create a linux user before you can add them to a share
- sudo useradd Robert
Create an smb group
- sudo addgroup smbgrp
Create an smb user and add to group
- sudo useradd Robert -G smbgrp
Create a password for Robert
- smbpasswd -a Robert
Set the permissions on the folders
- sudo chmod -R ugo+w /volume1/Samba/Public
- sudo chmod -R 0770 /volume1/Samba/Protected
- sudo chown root:smbgrp /volume1/Samba/Protected
Restart the smb service
- sudo service smbd restart
From your desktop the share should automatically be available. If not connect to the IP and use the “Robert” and Password login information. You should see 2 folders Public and Protected (or whatever you decided to call them.
I have a 10G connection between my computer and UNVR and am using 4 5400RPM Western Digital Red Plus 4TB Drives. I am getting around 350MB/s transfer speed.
Also of note: If you are connecting to from and SFP port to the SFP+ on the UNVR you need to specify the speed of the port you can do that by following the steps from this link
https://www.linkedin.com/pulse/use-unifi-protect-unvr-nas-guy-kramer/
Posted Mar 11, 2023, 2:05 AM UTC · edited