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


Marcel van der Veer Linear regression explained

September 2022

Did you, like me, have to learn linear regression the hard way during your education, by means of tedious calculus … [Read more]

Published in category Mathematics, Statistics


Marcel van der Veer FORTRAN - lingua franca with a promising future behind it

March 2022

In the eighties, science undergraduates like me took a course in structured programming at the computer science department … [Read more]

Published in category Computing history


Marcel van der Veer Building a simple NAS with Debian 11

March 2022

There are many recipes around to convert an obsolete PC into a DIY NAS for use on a Windows-machine network … [Read more]

Published in category Tech Tips


Marcel van der Veer Announcing Algol 68 Genie 3.0

December 2021

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


Marcel van der Veer VM/CMS and MVS/TSO reunited

October 2021

When I was a student, the university computing centre offered VM/CMS and MVS/TSO running on IBM (compatible) mainframes … [Read more]

Published in category Computing history


Marcel van der Veer Algol68C on MVS revisited

August 2018

As the author of Algol 68 Genie I am interested in having access to other Algol 68 compilers for reference purposes … [Read more]

Published in category Computing history


Marcel van der Veer Let the music play on - vintage HiFi

July 2018

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 … [Read more]

Published in category Tech Tips


Marcel van der Veer Building a small Beowulf cluster II

April 2018

As described in an earlier post, at home I operate a modest Beowulf type cluster for embarrassingly parallel simulation runs in batch mode … [Read more]

Published in category Tech Tips


Marcel van der Veer Be multilingual!

January 2018

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 … [Read more]

Published in category Education


Marcel van der Veer Classical thermodynamics in a nutshell

November 2017

Recently I met during an event at my Alma Mater, the University of Nijmegen, my high school physics teacher … [Read more]

Published in category Science


Marcel van der Veer A brief history of Algol 68 Genie

November 2016

Being the author of Algol 68 Genie, people frequently ask me why a physical chemist wrote an Algol 68 compiler … [Read more]

Published in category Algol 68


Marcel van der Veer Building a small Beowulf cluster

October 2016

At home I operate a modest Beowulf type cluster for embarrassingly parallel simulation runs in batch mode … [Read more]

Published in category Tech Tips


Marcel van der Veer Running Algol68C on MVS

October 2012

Recently, Algol68C Release 1.3039 was made public for download … [Read more]

Published in category Computing history


Marcel van der Veer Revised Report on the Algorithmic Language Algol 68

June 2009

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