Using the Raspberry Pi as a NAS

Here we have another great use for the Raspberry Pi as a NAS server for your LAN. In this post we’ll be using a Thermaltake BlacX USB SATA attached to the Pi with a 1 TB drive with ntfs shared to the Windows and MAC systems for access.
Install ntfs support

Create the mount directory and mount it

Mount as ntfs as user id pi

Create a share directory

Install Samba support

Edit Samba config and create the share drive

Remove the # symbol from the security = user line (by highlighting it with the cursor and pressing delete) to enable username/password verification for the Samba shares.

Next, we’re going to add an entirely new section to the configuration file. Scroll all the way down to the very bottom of the file and enter the following text:

Press CTRL+X to exit, press Y when asked if you want to keep changes and overwrite the existing configuration file. When back at the command prompt enter the following command to restart the Samba daemons:

At this point we need to add in a user that can access the Pi’s samba shares. We’re going to make an account with the username backups and the password backups4ever. You can make your username and password whatever you wish. To do so type the following commands:

You’ll be prompted to type in the password twice to confirm. After confirming the password, it’s time to add “backups” as a legitimate Samba user. Enter the following command:

Edit fstab and add the entry for the mount.

This will open up the file systems table in nano so we can add a few quick entries. Within the nano editor add the following lines:

/dev/sda1 /media/ext auto noatime 0 0

This will install the auto usb mounting system.

However we need to set up a config file to allow the automounting of the usb disk.

At the end of the file is the following
You need to add the following below the +auto.master entry

That’s all you need and can now access the share from any system in your LAN.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.