Setup the Raspberry Pi as a NAS
The Raspberry Pi is a great device with many possibilities and one such great use is as a NAS server for your LAN.
The Raspberry Pi by itself is limited by the space it can offer so you will need to add a USB SATA storage device like the Thermaltake BlacX attached to the Pi with a drive size of your preference, my own is a 1TB drive with NTFS shared to Windows OS and MAC OS systems for access.
First install, NTFS support:
$ sudo apt-get install ntfs-3g
Create the mount directory and mount it:
$ sudo mkdir /media/ext
Mount as NTFS as user id pi:
$ sudo mount -t auto /dev/sda1 /media/ext
Create a share directory”
$ sudo mkdir /media/ext/share
Install Samba support:
$ sudo apt-get install samba samba-common-bin
Edit Samba config and create the share drive:
$ sudo nano /etc/samba/smb.conf
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:
[Backup] comment = Backup Folder path = /media/ext/share valid users = @users force group = users browsable = yes create mask = 0660 directory mask = 0771 read only = no
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:
$ sudo /etc/init.d/samba restart
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 backups4pi. You can make your username and password whatever you wish. To do so type the following commands:
$ sudo useradd backups -m -G users
$ sudo passwd backups
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:
$ sudo smbpasswd -a backups
Edit fstab and add the entry for the mount:
$ sudo nano /etc/fstab
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:
$ sudo apt-get install autofs
However we need to set up a config file to allow the auto mounting of the USB disk:
$ sudo vi /etc/auto.master
At the end of the file is +auto.master. You need to add the following below the +auto.master entry:
+auto.master /media/ /etc/auto.ext-usb --timeout=10,defaults,user,exec,uid=1000
That’s all you need and can now access the share from any system in your LAN.
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7 : OpenLDAP is a free open source Light Weight Directory Access protocol developed by the OpenLDAP proj...0 comments |
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint : Tor, The Onion Router, is a network of Virtual Tunnels that allows users to communicate securely and...2 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comments |
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update : Canonical has released security updates for Ubuntu 12.04 LTS and advices to update your system as so...0 comments |
- TeamViewer 9 Final Has Been Released!
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7
- Configure Your Browser To Use Tor On Ubuntu/Debian/Linux Mint
- Setup A Full Featured ITIL Management System Using Integria IMS On CentOS 6
- Install LibreOffice 4.1.3 in Elementary OS ‘Luna’
- How To Install Simple Scan in Crunchbang ‘Waldorf’
- Selene Media Encoder: Convert Audio, Video Files To Most Popular Formats
- Linux Kernel 3.12.2 Is Available For Download! Install / Upgrade Instructions
- CentOS 6.5 Has Been Officially Released!
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .