Raspberry Pi NAS Build

Matt

Owner
Download the Raspian OS from here : http://www.raspberrypi.org/downloads/

Load the image to the memory card following the guide here: http://www.raspberrypi.org/documentation/installation/installing-images/windows.md

During the initial install, I set the OS to boot into terminal mode from the advanced menu.

So, first, update the OS to make sure everything is on the latest, and I always edit files using VIM, so install that.
Code:
# sudo apt-get update
# sudo apt-get upgrade
# sudo apt-get install vim
The 1TB drive I've installed was pre-configured on my windows machine using NTFS file system

To enable the Pi to see the file system, install the ntfs-3g package
Code:
sudo apt-get install ntfs-3g

Plug in the USB HDD. Doing a fdisk -l should now see the USD media
Code:
pi@raspberrypi ~ $ sudo fdisk -l

Disk /dev/mmcblk0: 16.0 GB, 16039018496 bytes
4 heads, 16 sectors/track, 489472 cylinders, total 31326208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b5098

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    31326207    15601664   83  Linux

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x44fdfe06

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63  1953520062   976760000    7  HPFS/NTFS/exFAT
pi@raspberrypi ~ $
/dev/mmcblk0 is the memory card. /dev/sda is the USB HDD.

Now, we want to make a mount point for the HDD

Code:
sudo mkdir /media/USBHDD1
sudo mount -t auto /dev/sda1 /media/USBHDD1
cd /media/USBHDD1

We are going to use Samba to allow the windows PC's to access the drive over the network
Code:
sudo apt-get install samba samba-common-bin

Backup the config file
Code:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old

Edit the config file

First, we want to make sure only allowed users can access the shares. In the config file, uncomment security = user
Code:
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
   security = user

Then, at the bottom of the file, we are going to create a new section mapping the share
Code:
[NAS]
comment = NAS
path = /media/USBHDD1
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

Start the samba daemon
Code:
sudo /etc/init.d/samba restart

So, to add the user to the system who we want to give access to
Code:
sudo useradd backups -m -G users
sudo passwd backups
We then add them to the samba password group
Code:
sudo smbpasswd -a backups

Finally, to make the system mount the drive on reboot, we need to add an entry to fstab
Code:
sudo vim /etc/fstab
Add the following to a new line
Code:
/dev/sda1       /media/USBHDD1  auto    noatime         0 0

All up and running
62279_upload_2014-7-30_12-46-25.png

Configuring it without a case
62294_image.jpg

I then went to Maplin and bought a case for £5.99 for it
62295_image.jpg
62296_image.jpg
 
I've got two of the the latest Model B+'s on order, do you fancy one?

Here's what's new/changed over the original Model B;

  • More GPIO. The GPIO header has grown to 40 pins, while retaining the same pinout for the first 26 pins as the Model B.
  • More USB. We now have 4 USB 2.0 ports, compared to 2 on the Model B, and better hotplug and overcurrent behaviour.
  • Micro SD. The old friction-fit SD card socket has been replaced with a much nicer push-push micro SD version.
  • Lower power consumption. By replacing linear regulators with switching ones we’ve reduced power consumption by between 0.5W and 1W.
  • Better audio. The audio circuit incorporates a dedicated low-noise power supply.
  • Neater form factor. We’ve aligned the USB connectors with the board edge, moved composite video onto the 3.5mm jack, and added four squarely-placed mounting holes.
 
I've got two of the the latest Model B+'s on order, do you fancy one?

Here's what's new/changed over the original Model B;

  • More GPIO. The GPIO header has grown to 40 pins, while retaining the same pinout for the first 26 pins as the Model B.
  • More USB. We now have 4 USB 2.0 ports, compared to 2 on the Model B, and better hotplug and overcurrent behaviour.
  • Micro SD. The old friction-fit SD card socket has been replaced with a much nicer push-push micro SD version.
  • Lower power consumption. By replacing linear regulators with switching ones we’ve reduced power consumption by between 0.5W and 1W.
  • Better audio. The audio circuit incorporates a dedicated low-noise power supply.
  • Neater form factor. We’ve aligned the USB connectors with the board edge, moved composite video onto the 3.5mm jack, and added four squarely-placed mounting holes.
Sure ;)
 
I love how British people use the work "fancy". :D
"Do you fancy some take out?" I had that told recently in a close-by restaurant. :)
 

Similar threads

Back
Top