Site icon David Yin's Blog

How I install my NAS system based on Ubuntu 22.04 lts

My current NAS system was based on the U-NAS system. U-NAS 4.0.6 is based on Debian 9. When I add the 2.5Gbe Pcie adapter, I found it is not supported by it. So I am going to install a new system with this setup.

Here is the list of what I need for the NAS system.

Install Ubuntu

Pulled out four hard drives, fresh install of Ubuntu 22.04 lts, minimal installation, ssh server only.

Add an initial user for future use.

Testing speed with iperf3, can reach 2.33Gbits/sec

Install Cockpit

It is mainly used for mounting hard disks and can be easily managed.

sudo apt install cockpit

The web portal is https://192.168.100.191:9090
The IP address of this NAS is 192.168.100.191

After the hard disk is inserted, it looks like this.

All four hard drives are in xfs format.

source mount size
/dev/n1/smallone /mnt/nas1 1.5T
/dev/n2/pt /mnt/nas2 4T
/dev/n3/4tb /mnt/nas3 4T
/dev/n4/8tb /mnt/nas4 8T

Install Webmin

This is the server administration panel I’m used to using. It should be installed as well. Later I will use it to manage a lot of things.

Home  Directory

In Webmin’s System / Users and Groups, add new users, each family member gets one individual account, all under the user home directory /mnt/nas2/homes/.

The following I need three file services, SAMBA, FTP, NFS, and also BT, Emby.

FTP server proftpd

sudo apt install proftpd

On Webmin panel, add the user serverbackup, whose homedir is /mnt/mas4/vpsbackup

After starting the FTP service, I can connect to NAS from VPS which on DigitalOcean or any other VPS provider, but I can’t transfer data.

In Webmin/ Servers/ ProFTPD Server/, Networking Options page, modify the PASV port range 55536 – 55663

Then, in the Firewall/NAT/PortForward of the soft route opnSense, add a new rule. There is already  a rule to forward from 65514 of the Wan port to port 21 of FTP.

After that, I tested the scripts from VPS hemlock backups and only changed the directory name of the backup file in backup2.sh.

SAMBA service

sudo apt install samba

Add sharing to the Webmin control panel.  Servers / Samba Windows file Sharing

First, convert users, (because Unix user passwords are encrypted) and re-enter the password in samba users.

The first step is to set up the sharing for the home directory. As a WINS server, and always show Homes home directory.

Add two shares:

You need to pay attention to the settings here for permissions and allowed users.

Temp sharing, allow reading and writing for every user.

Albums sharing, allow read-only. The albums folder is to store all pictures taken on Cameras, Smartphones.

NFS service

sudo apt install nfs-kernel-server

Find it in the Webmin panel under Networking / NFS Exports.

Add the new NFSv4 export

/mnt/nas1/PVE_backups 192.168.100.4

Do not check the read-only box for permission settings.

It is used to back up all VMs from the PVE system to this folder. NFS is much faster than SAMBA sharing.

BT service

First, I need to install the program or transmission.

sudo apt install transmission-daemon

Then, install Transmission Web Control. Its official site is https://github.com/ronggang/transmission-web-control
Use the following command to install it.

wget https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control-cn.sh
bash install-tr-control-cn.sh

When trying to access this panel, there is a 403 Error, http://192.168.100.191:9091

Do the following to fix it.

sudo service transmission-daemon stop

Edit two files, /etc/transmission-daemon/settings.json , and /var/lib/transmission-daemon/.config/transmission-daemon/settings.json

"rpc-whitelist-enabled": false,

"rpc-username":"davidyin",

"rpc-password":"{password",

The password should be replaced with sha1 encrypted content, do not miss the brackets.

sudo service transmission-daemon start

The download home directory is /mnt/nas2/Downloads/

and is divided into Movies, TV, Others.

EMBY server

Go to the official website to download and install the latest version.

https://emby.media/linux-server.html

Visit the panel at http://192.168.100.191:8096

Add the media directory.

Conclusion

Up to now, the system meet all my needs for now.

The SAMBA sharing is simply file sharing in my home LAN network. Every Windows PC used by my daughters and son can access it.

NFS sharing is provided for access from Linux servers in the LAN.

I can use BT to download files. EMBY server is used to watch Movies on LG TV and Browser.

To backup all my VPS running outside of my house, I setup a script to backup them and transfer back to home bay schedule.

Exit mobile version