Make your own NAS Box!
How many of us have the habit of taking system backup on a regular basis? I guess there aren’t many. But, i’m sure that many of us had thought at some point of their geek life that “i should have taken a backup of that file!” right after a hard disk crash or a windows crash that can’t be repaired/recovered. I’ve had this thought many times & actually I never thought seriously about doing it until i lost my collection if softwares, utilities & music a few days back. It was a sad moment & happened due to a hard drive crash. The power went down & when it came back online, I couldn’t find my 550GB “E” drive! The windows installation was fine & other drives were totally fine! I thought some windows error & tried chkdsk /f command & nothing magical happened! So, i plugged that hard drive into another PC & checked for file system errors in that & tried to uncover my data. But, regradless of the software i used(Used Minitools Partition Wizard Home Edition, Partition Magic), it still read “Unallocated space”. It was time to accept the fact that my partition has died! I didn’t know of any fancy Data Recovery methods to recover the data i lost & I sadly created a new partition! 😥
It was time to rethink! I’m having 2 x 2TB HDD’s on my primary PC without any RAID because i honestly didn’t care about the RAID or anything at the time of getting that PC & when i thought about RAID’ing it, it was too late because of the aggregated data i had scattered across those hard disks! I have the habit of saving image files & scripts i find interesting into the desktop, most of the data i have on my PC is of this kind. They’re practically of zero use sometimes. But, at times, they’ve helped me a lot & i couldn’t delete them. Instead, i move them to some folder when i can’t save anything more!
So, i decided to buy a NAS solution so that i can backup all my file away from my primary computer & at the same time, i can access them like they’re on my PC itself. A NAS or a Network Attached Storage device is practically a large capacity hard drive attached to your network. You can move files to & from the NAS seamlessly & can configure them through a web interface & you can even access your files from anywhere in the world. I wanted to buy a prebuilt NAS from Synology. Found their devices to be more reliable than others. The only problem was the COST! Yes, they cost a lot! Obviously not everyone can afford one. As a student with a very limited monthly income from small projects, a prebuilt NAS solution is just an entry to my “Things To Own” list.
During my search to find the best NAS solution, i happened to read a comment by someone about an OS called FreeNAS, which could be used to make a NAS solution from scratch. After concluding that I couldn’t buy a prebuilt NAS, I turned my interest towards FreeNAS. I love to make things, i believe in OpenHardware & Software & i love making things on my own. FreeNAS caught my attention. After a bit of googling, i found that the FreeNAS project was took over by some big company & they don’t support fellow homebrewers now. I could use an older version of FreeNAS(FreeNAS 0.67 or something) but, i couldn’t find any working links to them. Instead, i found NAS4Free, another open NAS operating system built from the sources of FreeNAS. Its easier to install & configure & at the same time, it provides all the features that a prebuilt NAS solution. In addition to all the standard features, it also have torrent client support & many more features to play with. Enough! Lets get onto the real deal.
What exactly is a NAS?(from Wiki)
Network-attached storage (NAS) is file-level computer data storage connected to a computer network providing data access to a heterogeneous group of clients. NAS not only operates as a file server, but is specialized for this task either by its hardware, software, or configuration of those elements. NAS is often manufactured as a computer appliance – a specialized computer built from the ground up for storing and serving files – rather than simply a general purpose computer being used for the role.
Is it possible to build on from scratch?
Absolutely yes! a full fledged NAS solution can be built from scratch using a working computer & NAS4FREE software.
You don’t need an insanely fast PC to build a NAS! You can build a perfectly working NAS from an old PC with an ethernet port. If you need faster data rates across your network, you might need a Gigabit lan port. My build was based on an old AMD Athlon XP 2000+, 256MB RAM & 500+80GB hard drives. Although the minimum requirements for installing NAS4Free is 512MB, it doesn’t need 512MB to run it. I’ll get into the details later on.
You’re gonna need the following to make a NAS4Free Box:
1) NAS4Free live cd image (i used version 18.104.22.168.636), download the latest version from here.
2) A plain CD to burn the downloaded ISO image.
3) NAS Box: A working PC with 512MB(or 256MB) RAM, ethernet port, a cd drive & a hard drive.
4) Obviously some network infrastructure to connect your NAS Box to the network
5) Some time & patience!
OPTIONAL: You can install NAS4Free on a USB Flash drive & could use it to boot. I recommend separating the OS & the actual data storage because you can always reinstall the OS & can simply import the hard disks in case of an OS failure!
NAS4Free works great on every PC configuration you throw at it. My NAS Box runs on 256MB RAM while the minimum requirement is 512MB! If you have 256MB of RAM on your NASBox, dont worry! You can still install NAS4Free on it!
1) Download the live CD ISO file from the link
2) Burn the ISO to a CD, i used the windows ISO burner
3) Connect a monitor & keyboard to the PC that you’ll be installing NAS4Free on.
4) Turn it on & enter the BIOS settings
5) Change the boot settings to boot from the CD/DVD drive
6) Save the BIOS settings & pop the CD into the drive
7) Wait for it to boot up, you should see something like this:
8) Wait for the following prompt to come up:
9) Press 9 & press Enter
10) You should see the following screen:
11) Select option 3 ie, “Install Full OS on HDD+DATA+SWAP Partition” & press enter
12) The following prompt will appear:
13) Press enter & you should see a prompt to select the installation source media. Press enter there & you’ll get the following screen:
14) Select the drive you want to install NAS4Free, I used a 4GB USB flash drive to store the OS files. You could do the same. Make sure that you plug in the Flash drive before entering NAS4Free installation.
15) Select the Partition size for your OS & add a SWAP partition if the hardware is old/having low memory. Leave the values at default.
16) That should do it! NAS4Free installation should start now & you’ll get the following screen:
17) After installation, reboot the server & enter into the BIOS settings once again. This time, change the first boot device to the hard drive/flash drive to which you installed NAS4Free into. Save the settings & reboot.
18) NAS4Free should boot up now, it’ll take some time to boot for the first time. You should see a console like that in installation step 8. Type in option 2 & press enter. Select “YES” at “USE DHCP” & “No” at “Use Ipv6?” Prompts. You should see the IP address assigned to your NAS Box in yellow color. You can now remove the monitor & keyboard from your NAS Box now. All the configuration on your NAS Box is done through that IP address. You’re gonna need another computer connected to the network to configure your new NAS Box.
19) Type in the IP address of your NAS Box into the browser of another computer connected to the network & You should be greeted by the following screen. If not, try using the Ping command & see if the address is reachable.
20) The default Username is “admin” & the default password is “nas4free” without quotes. You’ll get the following screen.
Now that your NAS4Free installation is complete, you can configure the hard disk(s) inside your NAS Box so that they can be used as a shared folder.
Add Disks To Your NAS!
Goto Disks>Manage & click “Import Disks” & select “Yes” at the prompt. You’ll see somthing like this:
Mount Your Disks!
Now, the disks that you added to the system has to be mounted inorder to use them. For That, goto Disks>Mount Point.
Click on the ‘+’ sign on the right hand side of the page & you’ll see somthing like this:
Select the disk that you’ve mounted. Select the partition type, select “MBR” unless you know what you’re doing. Select the partition number, which is the partition number of the data partition. If you’re using a single hard disk for system & storage, 1/2/3 maybe the partition number. Type in the wrong info & NAS4Free will correct you 😉 Click on save!
Enable Shares & Start sharing!
Click on Services>CIFS/SMB & click “Enable” on the right hand side. Configure the settings yourself.
Now, to use your NAS without any annoying username – password windows, map all users to guest. To do that, set “Map guests” to “Bad user – non existing users” .
By doing this, you’re mapping all the users of your NAS to guest account, which allows Read/write on the NAS without the usual username-password circus. BUT, keep in mind that, you’re exposing your NAS to ALL the users & I don’t recommend this method if you’re storing sensitive information on your NAS.
After doing that, click on “Shares” tab in CIFS/SMB settings & click on the grey ‘+’ sign & add the folders/disks you want to share. Click save changes & to test your NAS, open up My Computer on another system connected to your network & type in the network address of your NASBOX into the address bar like this \\192.168.2.88, replace the ip with your own. If everything went well, you’ll see all the shares on your NAS4Free server.
Download all the TORRENTS & Stream all the media!!
The really cool thing about NAS4Free is that you can use it for many purposes. Since it is a NAS, you may let it ON forever. You can use it as a torrent box & even a full fledged UPnP media server! Personally, i use my NAS box for backup & for downloading torrents, because most of the time, its simply sitting there idling. To use NAS4Free as a torrentbox, you just need to enable the BitTorrent service in Services>BitTorrent. You’ll see somthing like this:
After configuring, you’ll get something like this if you open the link to your BitTorrent page:
Since NAS4Free is based on FreeBSD, all the packages that are available for FreeBSD can be installed on NAS. Many useful software packages can be installed on NAS4Free. It can even be used as a web server if you wish. I’m experimenting with NodeJS on my NAS4Free installation. It can be installed with minimum efforts & works pretty well too! I’ll be covering that later 😉 I don’t know whether there exist any other NAS solution which is simple like NAS4Free. I’ll be using NAS4Free until i buy a dedicated NAS solution on my own!