717 Ohio Ave #161 Wichita Falls, TX 76301

1 -(940)-536-3161

Guide – OrangePi NAS Expansion Board, Headless NAS Setup Part 1

Guide – OrangePi NAS Expansion Board, Headless NAS Setup Part 1

Today we set up a OrangePi Zero with a NAS Expansion board as a headless NAS. This is quite a lengthy tutorial so feel free to refer to the written version for a quicker study.

You can purchase the OrangePi Expansion board here.

OrangePi Zero NAS Setup

This tutorial is written mainly for Windows users, Mac and Linux users will need to replace tools such as Zip File Extraction programs, Disk Image Utilities, and SSH programs with flavors compatible with their systems, the rest of the content will still be applicable.

Step 1 – Setting up the OrangePi Zero

Download the Ubuntu Server Image for the OrangePi Zero, you may need to substitute your OS if you are using a different flavor of the OrangePi.

You can find all of the stock OrangePi Images for download here, you can also use this archival link for the image I used in the tutorial in case the OrangePi website is down.

Once the image is downloaded, use a extraction tool such as 7Zip to extract the disk image and use Win32DiskImager to write the disk image to your SD Card.

Once you are finished you can insert your SD card into the OrangePi Zero and boot, I recommend having the OrangePi in the configuration you want to use it as, so that mountpoints do not change latter on from moved or added storage media.

Step 2 – Log into the OrangePi and change the default user

Now that the OrangePi is up and running the first thing we need to do it find it on our network. What I like to do is to log into my router and see what IP address the device has been assigned from there.

Once you have the IP address for the OrangePi you can use a SSH program like Putty ┬áto login to the OrangePi and begin working using terminal commands. The default username and password for the image and OrangePi flavor I am using is “orangepi”.

Resize Filesystem

The first thing we are going to do is resize our filesystem this command:

sudo fs_resize

When we use Win32DiskImager to put the image onto our SD card, it only uses enough space required to put the image on the disk, with no regard as to how large the SD Card is, 8Gb, 16GB ect. Resizing the filesystem expands the OS filesystem so that the entire card is available for us to use.

When that is finished we will reboot the OrangePi with the command:

sudo reboot

In my case I had to wait about three minutes for the OrangePi to reboot, then I was able to continue.

Update Linux

Once rebooted it is a good idea to update linux and make sure you are caught up with all the necessary security patches and programs, you do this by using the command:

sudo apt-get update

Configure Timezone

Once updated we are going to set the correct timezone for our locale so that the system time is correct, to do this use the command:

sudo dpkg-reconfigure tzdata

and follow the on-screen prompts.

Create New User

For security purposes it is a good idea to make a new user and get rid of the default “orangepi” user, the first step to this is to create a new user with the following command:

sudo adduser <username>

where <username> is the username of your choice, the <> will indicate variables for the rest of this tutorial.

Add new user to Sudo group

We do this with the command:

sudo usermod -aG sudo <username>

Once this is finished reboot the OrangePi and log back into SSH with your new username. If you accidentally log back in with the default orangepi user, reboot and relog as your new user. Once logged in under orangepi there will be processes tied to that user that will prevent you from deleting it in the next step.

Delete default user

Once logged in with the new user delete the default one by using the following command:

sudo deluser orangepi

Step 3 – Prepare Hard Drive Filesystem

The first thing we need to do is find out the device names for all the stoarge drives connected to our system with this command:


Create new partition table

Create a new partition table on the disk you want used for your NAS with this command, but beware, this will erase all of the data on that drive:

sudo parted <disk> mklabel gpt

Once this command finishes reboot the system.

Create new partition on disk

Use the lsblk command again to verify that the disk is still assigned the same device id and create a new partition with the following command:

sudo parted -a opt <disk> mkpart primary ext4 0% 100%

Create new filesystem on the new partition

Once we have a new partition we are going to hand it over to a different program to make the new filesystem with the following command:

sudo mkfs.ext4 -L <partitionname> <partition>

If you get a partition is mounted error use the following command to unmount the partition and try again:

sudo umount <disk>

Once this is finished reboot the system so that we use the same mountpoint that will be created upon startup.

Step 4 – Install and setup Samba

For file sharing over the network we are going to create a Samba share, Samba is a popular program for file and printer sharing between PC, linux, and even Mac systems but we only need to worry about the file sharing portion.

Install Samba

To install Samba use the following command:

sudo apt-get install samba

Set password for Samba

Samba passwords are stored apart from the normal UNIX passwords, so we need to set one now to make sure we are being prudent about keeping our device secure. Use the following command to set the Samba password:

sudo smbpasswd -a <username>

Create directory for Samba share

It is always recommended never to share a entire drive for multiple security and practical reasons, so we are going to create a directory specifically for our Samba share with the following command:

sudo mkdir <mountpoint>/<foldername>

Make a backup of our Samba configuration file

Before we edit our Samba configuration file we are going to make a backup in case a mistake is made with the following command:

sudo cp /etc/samba/smb.conf ~

Edit Samba configuration file

Next we will edit our Samba configuration file with the following command:

sudo nano /etc/samba/smb.conf

This will open the smb.conf file into a text-based editing program and we will add the following lines to the end of it.

path = <mountpoint>/<folder>
valid users = <username>
read only = no

To save these changes use Ctrl+O to write them, and Ctrl+Z to exit the editor.

Test configuration

Finally, test the Samba configuration with the following command:


This will test the Samba configuration for major syntax errors and such, but you can still check the text from that command to verify you typed it and saved it correctly as well.

Restart Samba

Restart the Samba service with the following command:

sudo service smbd restart

Access Samba share from network device

Finally you should be able to see your device using network discovery, you can also try accessing specifying a device name or IP address like the below examples, but this will differ according to device used, OS, and network/firewall settings


Changing shared folder permissions

You may find that you can access the share but are unable to write files to the shared folder, generally this is a permission issue, and if you log back into your OrangePi you can fix that with the following command:

sudo chmod 777 <mountpoint>/<folder>

In Part 2 of this guide

We will work on the following steps:

  • Setup SMART monitoring tools
  • Test Stoarge Media
  • Setup automatic SMART test
  • Setup notification of failed SMART test / drive failure
  • Simple Benchmarking

OrangePi NAS Expansion Board Headless NAS Setup Part 2

Share this with friends

Leave a Reply