Building a simple NAS with Debian 11
By Marcel van der Veer
March 2022
Published in category Tech Tips
More on Debian, Nas, Samba
There are many recipes around to convert an obsolete PC into a DIY NAS for use on a Windows-machine network. Here is mine, used to convert a workstation into a decent NAS for backup purposes. This saved a deprecated enterprise-quality machine from a premature end on the scrap heap.
I present my notes here since some of the recipes on the web gave me a read-only share under Windows; this procedure reproducibly gives me the read-write share that I need.
The machine sits upstairs and our LAN upstairs is wifi-bridged to the LAN downstairs where the Windows machine is. Note that using a workstation as a NAS is not a low-power option for 24/7 use. Since I use it as backup device, there is no need to have it running permanently.
FOSS solutions like FreeNAS require much minimum RAM to allow high workloads on the NAS. My workstation has less than the FreeNAS minimum requirement, but at least it is ECC which I consider an advantage for a NAS. The box runs a bare-bones Debian 11 image from a net-install. This homebrew NAS works just fine reaching transfer speeds up to 55 MB/s over wifi, which is almost best possible speed and more than enough for us at home. No need for SSDs in the NAS, since wifi clearly is the bottleneck.
In setting up the NAS, we work as superuser root on the Debian box. You can also execute all commands using sudo. First we make Debian up-to-date and install samba, our trusty FOSS SMB/CIFS solution.
# apt update
# apt upgrade
# apt install samba
Next I created a new user, share. Pick any name you fancy. Then we add share to the samba database, give it a samba password, and enable the samba user.
# /sbin/adduser share
... you are prompted for information here
# smbpasswd -a share
... you are prompted for information here
# smbpasswd -e share
Now we make a directory for share that Windows mounts as network drive later.
# mkdir /home/share/samba
# chmod ugo+rw /home/share/samba
I gave everyone rw permission otherwise Windows would not write to my network drive. Since our network is shielded from the outside world I can live with this.
Finally we tell samba that we have a fresh network drive on offer. Edit samba's configuration file, and make sure the Workgroup name matches that of your Windows box. Then add the new share at the end of the file.
# vi /etc/samba/smb.conf
...
workgroup = WORKGROUP
...
[share]
path = /home/share/samba
browseable = yes
read only = no
writeable = yes
create mask = 0777
directory mask = 0777
valid users = share
Apparently one cannot give a share the same name as the directory that is hosted. Just to be sure, the share is named [share] while the hosted directory is named samba. Next we restart samba, so it reads the configuration file anew.
# systemctl restart samba
You will need to know the IP address of your hobby NAS; there are several ways to discover that. Here we use 192.168.178.49 as an example. I told my router to always assign the same IP to the NAS.
Now, on Windows, open Explorer and click 'This PC'. On the now visible 'Computer' tab select 'Map Network Drive'. Fill out at least the following:
Folder: \\192.168.178.49\share
Tick 'Reconnect at sign-in'
Tick 'Connect using different credentials'
You are now prompted for credentials, which are the samba user name and samba user password you entered on Debian. After Windows establishes a connection, the drive will appear under 'This PC' after a minute or so. Note that it shows up as NTFS, while the host filesystem is ext4. Don't worry. You now have your network drive at your disposal!
All blog posts
|
When I was a student in the 1980's, science undergraduates took a course in structured programming at the computer science department … [Read more]
Published in category Computing history
|
|
There are many recipes around to convert an obsolete PC into a DIY NAS for use on a Windows-machine network. Here is mine, used to convert a deprecated workstation into a decent NAS for backup purposes … [Read more]
Published in category Tech Tips
|
|
I have released the current source as version 3.0. I have also updated the documentation, Learning Algol 68 Genie … [Read more]
Published in category Algol 68
|
|
When I was a student, the university computing centre offered VM/CMS and MVS/TSO running on IBM (compatible) mainframes. Nowadays it is possible to run those operating systems in emulation … [Read more]
Published in category Computing history
|
|
As the author of Algol 68 Genie I am interested in having access to other Algol 68 compilers for reference purposes. Several years ago I wrote a post on installing Algol68C on MVS. In this post I would like to give an update … [Read more]
Published in category Computing history
|
|
Lately I needed to call on some of my now rusty electronics skills since I came into some older HiFi equipment in need of attention. I consulted the world wide web in search of service manuals and found many more people with an interest in keeping older HiFi in working condition. Now I had the opportunity to combine my passion for electronics, HiFi equipment and music … and do not forget durability, since we are actually extending the life of otherwise obsolete products … [Read more]
Published in category Tech Tips
|
|
As described in an earlier post, at home I operate a modest Beowulf type cluster for embarrassingly parallel simulation runs in batch mode. With the experience from that build, I took on building a higher-performance cluster using Debian … [Read more]
Published in category Tech Tips
|
|
Every year my daughter's high school invites parents to partake in an evening of information sessions, to help students orient themselves on their future. The idea is to have parents from all walks of professional life, each parent discussing half an hour or so with small groups of students who subscribed to your sessions. You are expected to tell about your study and career, and the students are supposed to pose questions. As you will expect, some come well prepared, others must be stimulated a bit. I greatly enjoy those conversations with the next generation who have their lives ahead of them … [Read more]
Published in category Education
|
|
Recently I met during an event at my Alma Mater, the University of Nijmegen, my high school physics teacher. We discussed the chemistry curriculum and remarked that quite some chemistry students capture with difficulty the fundamental principles of thermodynamics. Needless to say that thermodynamics is one of those subjects that serve a chemist for a lifetime. In my humble opinion, one reason for this lack of retention may be the abstraction level in freshmen courses and that this might be improved by spending one or two introductory hours on the basic ideas of thermodynamics in a historic context … [Read more]
Published in category Science
|
|
Being the author of Algol 68 Genie, people frequently ask me why a physical chemist wrote an Algol 68 compiler. This is an understandable question since people associate Algol 68 with the learned group of mathematicians and computer scientists that conceived the language some fifty years ago and people recall the reputation it had of being a hard to implement language. In this post I would like to give an account of how Algol 68 Genie came to be … [Read more]
Published in category Algol 68
|
|
At home I operate a modest Beowulf type cluster for embarrassingly parallel simulation runs in batch mode. A master node controls several drones. Nodes in this cluster need no more than a server installation, but if a drone happens to have keyboard, mouse and monitor a small GUI is nice to have. This GUI should be lightweight, otherwise a desktop installation makes more sense. This page demonstrates how to set up a drone with GUI on Ubuntu Server including browser, document reader, image viewer and sound … [Read more]
Published in category Tech Tips
|
|
Recently, Algol68C Release 1.3039 was made public for download. This release is derived from the compiler that was in service to the mid 1990's on IBM mainframes. The new release is meant to run on either MVT or MVS. This report documents the installation of the new release on emulated MVS/370 … [Read more]
Published in category Computing history
|
|
This is a translation of the Algol 68 Revised Report into HTML, for distribution with Algol 68 Genie, an Open Source Algol 68 interpreter … [Read more]
Published in category Algol 68
|
|