In offices they use a separate computer to store files called file server. file servers usually have fast processor, large memory and large capacity hard drive. the computer connect and access by others through computer. These sort of files servers are expensive and required high maintenance cost.
It is not economical to use expensive file servers for small office or a house. However there is a solution for that. Those are called Network Attached Storage or NAS in short. Both have similarities and differences as well.
when we take similarities both do same task, storing Files and provide access to. With advance technology both provide similar access speed.
Difference is the way providing access to files. In file servers connection between hard disk and network is done using software. Computer is operated on Operating system and another software operate on top of operation system establish the connection. But NAS on the other hand, have comparatively smaller software stored on a memory and and the program is called firmware. Due to the use of operating system File servers essentially have fast processor and large memory and fast access hard disk. therefore File servers use considerable electric power. On the other hand NAS need less electricity.
A NAS manufactured by NETGEAR(from Wikipedia) |
The Raspberry Pi, I used for NAS is a bit older version called Raspberry Pi model B. This Raspberry Pi has, HDMI out put and a Composite video out put, where newer versions have on only a HDMI port. Also the device consist with two USB ports and 26 pins to be used as a General purpose Input Output (GPIO). A SD Memory card used to input operating system to operate on.
Raspberry Pi 1 Model B
Following are the list of things to assemble NAS.
Raspberry Pi 1 Model B with 8GB SD card
500GB SATA Hard Disk
SATA to USB convertor
5V Power Regulator
Plastic Box
Aditionally a cable with a micro USB cable to supply 5V power to Raspberry Pi and small cable with RJ45 jack and a RJ45 outlet was used.
All the Components used. |
First a slot was cut to hold RJ45 outlet on one side of plastic box. And the outlet was fixed to that slot.
Also a round hall to fix 5V regulator......
sudo apt-get install xrdp
This 'xrdp' software allow to access desktop of Raspberry Pi remotely using Remote Desktop Software over the network
Box was closed after fixing the hard disk firmly on the bottom of box using nuts and bolt and metal frame and wiring.
After powering up the device, 'Remote Desktop' software in Microsoft windows was used to log in to Raspberry Pi, to do rest of configurations.
Installing SAMBA software
sudo apt-get install samba
sudo apt-get install samba-common-bin
SAMBA is the access pint to the files on drive through internet. another word SAMBA is the file server software. with above two comands we have finished installing SAMBA on to Raspberry Pi.
Now we had to format the hard drive.
I was using the same drive as external hard drive to my computer using SATA-USB converter for quite some times. therefore the file system already on the drive is NTFS.
But, as the Raspberry Pi operating system based on Linux, it is better to use ext4 file system for the drive. one disadvantage of convertion is, in case Raspberry Pi is not working, I will not be able to plug the drive as external hard drive to computer to get access to files.
for making new partion the command 'fdisk' used.
sudo fdisk /dev/sda
fist of all had to remove NTFS file format partion already in the drive. for removal used key 'd' to delete all existing partions. after that use key 'w' to save changes. this will also exit the utility program. again use same command to open software to create new partion.
use key 'n' to create new partion. then use key 'p' to make new primary partion. press 'Enter' key to select default value as staring and ending cluster for new partition, if to use full disk. use key 'w' to save and exit utility software.
now it is time to format new partion. following command used to format newly creation.
sudo mkfs.ext4 -L DATA /dev/sda1
the command format the partion in ext4 format and same time set disk label as 'DATA'.
At same time we make a folder named '/data'. and mount the new partion 'DATA' on to the folder. in order to mount drive at startup, we are adding following command to 'fstab' file in 'etc' folder.
LABEL=DATA /data ext4 defaults 0 2
Now have to configure SAMBA server, to share mounted folder with outside world.
For that we have to goto instillation folded of SAMBA. Following command achieve task.
cd /etc/samba
All the configurations of SAMBA is on the file called 'smb.conf' on that folder. To open file to edit, following command is used.
sudo nano smb.conf
This command allow to edit 'smb.conf' file. First go down the code list and change '# wins suport=no' under [global] as following.
wins suport=yes
go further down and remove '#' at the front of 'name resolve order' to active configuration. This allow the network to identify our drive. now we are almost finished the configuration. now it is time to identify mounted folder to SAMBA server as shared folder.
Go further down and find section 'share definition'. Add following after [homes].
[pi_share]
path=/data
public=yes
browseable=yes
create mask=0777
directory mask=0777
only guest=yes
read only=no
This conclude configuration, save the file and exit.Restart the Raspberry Pi.
Goto the computer and look under, network folder. it show some thing similar to this.
I thought every thing is finished, but it was not. Cover I smell something burning. Hard disk got heated up due to no ventilation. So cooling fan of old DELL power supply was fixed in. and small holes were made both sides to support air circulation.
Now everything all right. But the fan produce loud sound when operate. The DELL power supply has a resistive temperature sensor. I make a circuit to increase speed of fan depending on the temperature. The sensor was fixed on to body of hard disk.
Now every thing is ready. I copy all the movies on my computer to NAS....
What are the advantages and disadvantages of Raspberry Pi NAS device ?
One advantages are low cost and low power requirement. If decide to buy every thing, it will be cost around Rs. 20,000 to Rs. 25,000. Power requirement varied between 10W to 15W. It will required around 7.2KWh to 10.8KWh to operate for month around the clock. It is very less compared to 360KWh required by File server with 500W power supply.
The disadvantage is the low data transfer speed. Normally the data transfer speed vary between 6Mbps to 1Mbps. But I think it is fair for use in a house.
මෙම ලිපියෙහි සිංහල පරිවර්තනය සඳහා පිවිසෙන ඉලෙක්ට්රොනික ලෝකය