This NAS server is meant for personal use, a home NAS server. It doesn't have the security setup for outside networks. This is the exact way I
have my home NAS servers setup.
I've tried a lot of the great NAS server OS systems, TrueNAS (My personal favorite), Unraid, openmediavault, etc. They are great, and give you a
tremendous amount of control over the server, but for a simple home server they are extreme overkill. I wanted something simple and easy to
setup that would do just the things I need it to do, and take all the mystery out of the process.
This Slackware NAS server will use the ZFS filesystem for it's storage pools. Slackware doesn't support ZFS modules at boot, but we can make and
install OpenZFS, and load the modules after boot. There is a problem with this though, because everytime the kernel is updated you will have to
rebuild and reinstall OpenZFS. This is something some people may not want to deal with, and in that case I'd suggest using Ubuntu for the OS,
which has native ZFS support.
lilo reboot
slackpkg update slackpkg upgrade-allAfter the upgrade is finished run lilo then reboot:
lilo reboot
This server will be using Webmin for the server control panel, so we'll need to install some perl modules required by Webmin.
export PERL_MM_USE_DEFAULT=1 cpan install CPAN cpan install App::cpanminus cpanm -n Log::Log4perl cpanm -n Authen::PAM DBD::mysql DBI IO::Pty Net::SSLeay Sys::Syslog
Webmin makes a great web based server control panel. Run the block of commands below to install.
mkdir -p /root/tmp cd /root/tmp/ wget https://github.com/webmin/webmin/releases/download/2.202/webmin-2.202.tar.gz tar -xf webmin-2.202.tar.gz rm /root/tmp/webmin-2.202.tar.gz cd webmin-2.202 ./setup.sh /usr/local/webmin rm -R /root/tmp/webmin-2.202
We'll need to download, build, and install OpenZFS
# Download OpenZFS cd /root/tmp wget https://github.com/openzfs/zfs/releases/download/zfs-2.2.6/zfs-2.2.6.tar.gz tar -xf zfs-2.2.6.tar.gz cd zfs-2.2.6 # Build and install OpenZFS ./configure make make install depmodNow OpenZFS is installed on your server.
Remember that everytime the Slackware Linux kernel is updated you'll have to rebuild and reinstall OpenZFS.
Now we'll create the ZFS pool that we want to share with our other home computers. I've got videos and music that I share with my livingroom
entertainment computer, which is running Windows 11. This setup works great for me, and it's simple.
There are many different ways to use drives with ZFS. I'll be focusing on:
raidz1 - 3 drives with 1 for redundency. Did the raidz1 because it was the cheapest way to get the most storage. I plan on going to the safer raidz2
in the near future, which is 5 disk with 2 for redundency. That would raise my storage to 24tb.
I have 3 8tb 3.5" SATA NAS drives attached to my Slackware NAS server, sdb, sdc, sdd. To use these 3 drives for my raidz1 storage pool named "storage",
I run the following command:
zpool create storage raidz1 /dev/sdb /dev/sdc /dev/sddAfter you've created your storage pool it will show up in your root directory as a directory, "/storage" in my case. This is where you store the files
Next you'll need to change the permissions of the shared directory. In my case that would be the "/storage" directory.
chmod 0777 /storage
With this setup of raidz1 with 3 drives you can lose 1 drive due to errors or malfunction. Just replace the bad drive as soon as you can, and you're
back up to speed. With my 3 drives of 8tb in a raidz1 configuration I actually get about 15.5tb storage space.
Next we need to download, build, and install the wsdd2 slackbuild package.
cd /root/tmp wget https://slackbuilds.org/slackbuilds/15.0/network/wsdd2.tar.gz tar -xf wsdd2.tar.gz cd wsdd2 wget https://github.com/Netgear/wsdd2/archive/1.8.7/wsdd2-1.8.7.tar.gz ./wsdd2.SlackBuild installpkg /tmp/wsdd2-1.8.7-x86_64-1_SBo.tgzWith wsdd2 our samba shares will be discovered.
First make sure Samba is started at boot:
chmod 0755 /etc/rc.d/rc.sambaNext configure Samba
Create the needed /etc/samba/smb.conf file.
Below is a very simple smb.conf for sharing your zfs pool without any password needed.
Just copy and paste using PuTTY the entire echo command below.
echo "[global] server string = Samba Server dns proxy = no debug level = 0 workgroup = WORKGROUP log file = /var/log/samba.%m read raw = no socket options = TCP_NODELAY bind interfaces only = Yes max log size = 5120 # Change "storage" to the actual name of your ZFS pool. default = storage server role = standalone server map to guest = Bad User # Change "myfiles" to the folder name you want to show up in network discovery. netbios name = myfiles map to guest = Bad User server min protocol = SMB2_02 # Change "myfiles" to the actual netbios name from above. server string = %h server (Samba, myfiles) usershare allow guests = yes [storage] # Change "/storage" to the actual name of your ZFS pool directory. path = /storage comment = storage browseable = yes public = yes writeable = yes case sensitive = auto preserve case = yes short preserve case = yes force create mode = 0666 force directory mode = 0777" > /etc/samba/smb.confAlmost done!
Put the following at the top of your /etc/rc.d/rc.local file:
/usr/local/sbin/zpool import storage >/dev/null 2>&1 # Change "storage" to the name you gave your ZFS pool. /usr/sbin/wsdd2 -d > /dev/null 2>&1After you reboot you should be able to see your ZFS pool in Windows under Network.
Check the status of your ZFS pool:
zpool status # This shows you the status of your zpools.Check ZFS File system storage pool integrity.
To check the zfs pool storage integrity you need to periodically run a scrub operation on the pool, so on my system I run:
zpool scrub storage # This pool scrub operation may take many hours. I do this about once a month.
Everytime you update the Slackware Linux kernel you will have to rebuild and reinstall OpenZFS.
Assuming you have OpenZFS at /root/zfs-2.2.6
cd /root/zfs-2.2.6 make clean ./configure make make install depmodHopefully you now have a Slackware NAS server ready to save and share files.
I use 3.5" SATA NAS drives for my NAS servers. I would use SSD drives, but they are way too expensive at this point.
My favorite drives are the HGST Ultrastar Enterprise refurbished drives sold by GoHardDrive. I've got about 10 of them, and have never had a problem with any
of them yet. They have been rock solid, some many years old with many hours on them. You can get the HGST drives in 4tb, 8tb and 12tb. I paid about $200 for
3 8tb HGST NAS Helium filled drives. Got some Western Digital NAS drives too, and they do a great job also, but are way more expensive, so I highly recommend
the HGST drives.