When reconfiguring my home WIFI router this week, I have a thought to setup a home file sharing network drive. I try the Raspberry Pi approach first, and upgrade to a dedicated NAS (Network Attached Storage) device Synology 220j a few weeks later.
The Raspberry Pi 3B+ and a case I bought one or two years ago has been collecting dust in a drawer for quite some time. It is time to bring them out and get some use out of them.
My original plan is to connect a retired SSD to the PI via an USB adapter. It would be a little messy to handle the cable and the exposed SSD drive. So I decide to use a Samsung 64GB USB flash drive which is also retired.
The two articles linked below are on the top of Google search.
Pcmag.com - How to Turn a Raspberry Pi Into a NAS for Whole-Home File Sharing
Magpi - Build a Raspberry Pi NAS
After reading the two articles, it seems that the first one suites my needs better. The first tutorial is quite good but I still run into a few problems. Below are some notes I have when setting up the Pi.
sudo mkfs
command in the tutorial.
I have to use Linux Mint desktop app USB Stick Formatter to format
it to EXT4 first and then connect it to Pi. \\raspberrypi
in Windows and smb://raspberrypi
in Linux
to access the shared drive. The Synology 220j two bay NAS is on sale a few weeks ago and I get one. The setup process is easy and fast. I install two 2.5 inch laptop hard drives in it, and watch those two youtube vidoes. About one hour later, the NAS is up and running.
Synology DS220j Review by StorageReview - Youtube
Synology DS220J NAS - The Best Way to Store & Backup your Data
Here are the steps to mount the nas in Linux Mint. The idea is mainly from a post on linux mint online forum.
/etc/fstab
to add a mounting point, and add the line to the end of the file. This
assumes that you name the Synology device as nas
. //nas.local/home/ /media/synology cifs \
credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0
/etc/samba/credentials
file to add username and password. username=<username>
password=<pwd>
sudo mkdir /media/synology
to create the mounting directory. sudo mount -a
to activate the new line in /etc/fstab
. The Synology network drive works well when all computers connect to the same router. My work laptop is on a VPN and it does not have access to the Synology network drive.
An easy way to share files between the work computer (on VPN) and other computers is to use a digital ocean Ubuntu server, and use FileZilla ftp software to upload and download files or folders thru SFTP protocol. I am not sure if this is a correct way to do things but it works well for me now.
Those three commands install FileZilla on Linux Mint.
apt-cache show filezilla # show package info
sudo apt update
sudo apt install filezilla -y
Reference: Q&A on superuser.com
Update on 9/3/2021
In Ubuntu 21.04, the fstab setting does not work. The setting should be in the following format.
//<192.168...>/home/ /media/synology cifs \
username=<name>,password=<pw>,uid=1000,gid=1000