Setting Up a Mini-NAS with Samba on the Fujitsu Futro S400 Running Debian Wheezy


Software • by Sven Reifschneider • 25 October 2013 • 2 comments
#linux #howto
This article is somewhat dated and may not be relevant with current Debian versions or modern hardware.

Following my previous article on setting up the Futro S400 and installing Debian 7 "Wheezy," I now want to share how I turned this small, energy-efficient system into a sort of Mini-NAS (Network Attached Storage). This NAS acts as a network drive for media, backup, or other storage purposes, allowing access to files across the network – from your computer to your TV via a PlayStation 3, for example. In my case, I used a local 2 TB Western Digital hard drive as a backup drive, also serving for streaming to the TV or for accessing important data remotely via VPN.

1. The Concept

The Futro S400, with only an internal IDE connection, isn't quite cut out to be a true NAS system. But that's not a big issue, as those needing a real NAS solution would typically go for dedicated NAS hardware or an ITX PC with a suitable case for hot-swappable drives. However, since I had an external hard drive lying around, I decided it would suffice for backup and access purposes. By connecting the hard drive to the Futro S400 via USB and configuring it to share over the network, anyone on the network can access it. I also password-protected this network share for added security when friends connect to the WLAN. Here’s how it's done.

2. Setting Up the Hard Drive

Since our Debian has no graphical interface, we use terminal tools for this process. I perform all commands as root (logging in with "su"). The dollar sign ($) indicates the input prompt where I enter commands, while the rest is output. When you connect a drive, nothing apparent happens. All detected drives (and other hardware) appear in the /dev/ directory. Hard drives (S-ATA, the standard these days) will show up as /dev/sda1, /dev/sdb, /dev/sdc5, etc. The challenge is identifying which one corresponds to the external hard drive. The simplest way is to check the system's recent activities as root:

$ dmesg
[...]
[ 4392.852068] usb 1-3: new high-speed USB device number 2 using ehci_hcd
[ 4392.985446] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4392.985467] usb 1-3: Manufacturer: Western Digital
[ 4393.082281] Initializing USB Mass Storage driver...
[ 4393.083046] usbcore: registered new interface driver usb-storage
[ 4393.083057] USB Mass Storage support registered.
[ 4394.088746] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 4394.089541] sd 2:0:0:0: [sdb] Write Protect is off
[ 4394.090501] sd 2:0:0:0: [sdb] No Caching mode page present
[ 4394.090537] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 4394.095370] sd 2:0:0:0: [sdb] No Caching mode page present
[ 4394.095412] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 4394.139209] sdb: sdb1 sdb2
[ 4394.146856] sd 2:0:0:0: [sdb] No Caching mode page present
[ 4394.146895] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 4394.146925] sd 2:0:0:0: [sdb] Attached SCSI disk

After connecting the drive and waiting a moment, run dmesg again. You should see a new entry indicating a Western Digital device detected at USB port 1-3. This means the hard drive has been recognized (as "sdb" in this case) but not yet mounted. We then display all partitions of the drive:

$ ls /dev/sdb*
/dev/sdb
/dev/sdb1
/dev/sdb2

The drive (sdb) has two partitions (sdb1 and sdb2). Since it was previously connected to a Windows machine and formatted with NTFS, we’ll mount it using the NTFS driver. Debian Wheezy doesn’t come with an NTFS driver suitable for read/write operations, so we need to install it first and then mount the drive under /media/exthdd.

$ apt-get install ntfs-3g
$ mkdir /media/exthdd
$ mount -t ntfs-3g /dev/sdb1 /media/exthdd
# Error message appears, indicating sdb1 is not NTFS-formatted, so we try sdb2
$ mount -t ntfs-3g /dev/sdb2 /media/exthdd

With sdb2, the drive mounts successfully. Now, we can share the "/media/exthdd" directory over the network.

3. Installing Samba and Creating a User

If, like me, you selected "File Server" during the Debian installation, you've saved yourself a step, as Samba is already installed. Samba is a software for Linux that enables folder sharing in a mixed (Windows + Linux (+Mac)) network. We install Samba and then create a user who will be used to access the share from Windows. This user is also assigned a password.

# If not already installed, then install samba
$ apt-get install samba

# Create a user and set a password
$ adduser jose
$ smbpasswd -a jose

4. Configuring Samba

Next, we configure Samba to share our hard drive, but only accessible with José’s credentials. We find Samba's configuration file at "/etc/samba/smb.conf". We rename the original and create a new smb.conf file:

# Rename smb.conf to smb.conf.orig and create a new smb.conf
$ mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
$ touch /etc/samba/smb.conf
# Edit smb.conf, for example with vim or emacs
$ vim /etc/samba/smb.conf

In vim, press "i" to insert content, which looks like this:

[global]
workgroup = LOCAL
security = user
encrypt passwords = yes

[homes]
comment = Home Directories
browsable = no
read only = no
create mode = 0750

[festplatte]
path = /media/exthdd
available = yes
writable = yes
comment = smb share
guest ok = no
valid users = jose
create mask = 0644
directory mask = 2777

Exit Insert Mode with ESC, then type ":wq" to write and quit. Test the smb.conf file:

$ testparm

If no errors, restart Samba:

$ /etc/init.d samba restart

5. Automounting the Hard Drive at Startup

We previously mounted the drive with "mount -t," but we want it to mount automatically at "/media/exthdd" at every system start. For this, we add an entry in "/etc/fstab":

$ vim /etc/fstab
# add the following at the end:

#external hard drive
UUID=12345678912345E6 /media/exthdd ntfs-3g rw,uid=1001,gid=1001,dmask=0002,fmask=0003 0 0

Save and exit vim. The drive will now automatically mount at each startup.

6. Accessing from Windows (or Mac)

The system is ready. Access the network share from Windows by entering the server's IP address in the address bar, e.g.,

192.168.0.5

Log in with José's credentials to access the "festplatte" folder. The drive may take a moment to spin up.

Our Fujitsu Futro S400 with Debian 7 "Wheezy" is now a functional Mini-NAS with restricted network access. While not as fast as a dedicated NAS (due to USB 2.0) and lacking in aesthetics, it’s a great start and excellent for network backups, thanks to the Futro S400's Gigabit Ethernet.

Do you have a similar setup at home or use a dedicated NAS? I hope this guide has been helpful. If you encounter any issues following these steps, please leave a comment, and I'll see what I can do to help!


Share this post

If you enjoyed this article, why not share it with your friends and acquaintances? It helps me reach more people and motivates me to keep creating awesome content for you. Just use the sharing buttons below to share the post on your favorite social media platforms. Thank you!

Sharing Illustration
Donating Illustration

Support the Blog

If you appreciate my work and this blog, I would be thrilled if you'd like to support me! For example, you can buy me a coffee to keep me refreshed while working on new articles, or simply contribute to the ongoing success of the blog. Every little bit of support is greatly appreciated!

Bitcoin (Segwit):3FsdZmvcwviFwq6VdB9PZtFK827bSQgteY
Ethereum:0x287Ffa3D0D1a9f0Bca9E666a6bd6eDB5d8DB9400
Litecoin (Segwit):MD8fMGDYtdeYWoiqMeuYBr8WBPGKJxomxP
Dogecoin:DTA6gkDCp1WncpoFJghzxCX7XPUryu61Vf
Sven Reifschneider
About the author

Sven Reifschneider

Greetings! I'm Sven, a tech innovator and enthusiastic photographer from scenic Wetterau, near the vibrant Frankfurt/Rhein-Main area. This blog is where I fuse my extensive tech knowledge with artistic passion to craft stories that captivate and enlighten. Leading Neoground, I push the boundaries of AI consulting and digital innovation, advocating for change that resonates through community-driven technology.

Photography is my portal to expressing the ephemeral beauty of life, blending it seamlessly with technological insights. Here, art meets innovation, each post striving for excellence and sparking conversations that inspire.

Curious to learn more? Follow me on social media or click on "learn more" to explore the essence of my vision.


2 comments

Add a comment

You can use **Markdown** in your comment. Your email won't be published. Find out more about our data protection in the privacy policy.

28 Jun 2014, 19:07
Peter

hi sven, habe bisher puppy linux oder tinycorelinux benutzt, bei denen das mounten anderer partitionen der festplatte eingebaut war. habe gerade debian wheezy + lxde (live) runtergeladen und auf freier partition installiert, konnte allerdings keine andere partition mounten. habe deine beschreibung nach viel lesen in docs und manuals angewendet: SUPER !!! alles mountet beim start. ganz herzlichen dank. peter

02 Dec 2013, 16:07
Roland

Hi Sven, habe soeben anhand Deiner Super-Beschreibung mein RaspberryPi zum NAS gemacht. Bin ein Linux_Neuling, aber dank Deiner Hilfe hat alles wunderbar geklappt. Was würden wir ohne Menschen wie Dich machen????
Frohe Weihnachten und einen guten Rutsch
Roland