Tuesday 12 January 2010

How to build your own NAS – Part 2

Now that you have all the required hardware, this is what you need to do:

Install the SATA card on an available PCI slot in your computer. Leave the old HDD in the computer, connected to an IDE port. Connect the new HDDs to the SATA controller with a SATA cable. Connect the power cable to the new HDDS if these have one of the old power connector sockets or, if not, you'll need an adapter for each SATA HDD. Close the box!

As I mentioned earlier, you will ideally have
2 HDD, either 500GB or 1TB each. For redundancy and safety of your data, these should later be configured in a RAID array, in RAID 1, which means whatever is written to one disk is also written to the other. This is called mirroring and means that if one of the HDDs stops working your data will still be available and safe, and as soon as you replace the old HDD the data will again be replicated to that one once more providing security. Most SATA controllers allow you to configure your HDDs on a RAID array.

The reason I told you to leave the old IDE HDD in the computer is because you are going to install the OS, Ubuntu Linux, on that drive, so that your new big drives will only be used for data. This way, if something goes wrong with the OS and you need to re-install it at any time or update it, this will not affect your precious data.

Well, let's start!

Insert the Ubuntu Linux CD and start your computer (don't forget to setup your computer to boot from the CD), and install Ubuntu. This is pretty much straight forward as the interface is similar to Windows.

The only particular configuration you will need to pay attention to is the creation of partitions. You need to create 3 partitions. Two on your old IDE drive and one on the new large HDD. The first partition will be where the OS will be installed and you shouldn't need much more than 5GB, in case you have a really small HDD, but I would use all the space in this disk for that first partition except for 2GB which will be used for the second partition, the Linux swap partition. Finally, all the space on the third HDD or volume for your data on its own partition.

Fortunately, Ubuntu Linux comes with a graphical disk partitioning tool called GPartEd.

You should have something like this:

Partition 1 – 5GB (or more if available) from the first HDD
Partition 2 – 2GB from the first HDD
Partition 3 – 500GB or 1TB from the second HDD or RAID volume

A particular thing about Linux is that its system is mounted on a "Mount Point", and the Operating System needs a mount point of "/", also known as "root" and you can choose a mount point of "/data" or "/srv" for your data partition. During the installation, the Ubuntu installer will also let you create a software RAID configuration to be applied to your currently installed hard disks. To accomplish this select "Create MD device" from the menu and choose between RAID 0, Raid 1 and RAID 5. Keep in mind that RAID 5 needs at least 3 hard disks for its configuration.

You will also be asked to create a user account and a password. When the installation has finished you will be asked to remove the Ubuntu CD and restart the machine. Upon restart you will see the Ubuntu login prompt. Enter your username and password and a graphical user environment called "Gnome" will load.

The first stage of creating your NAS is now done! Congratulations!

But this is not all, you will still need to install the server software and a few other tools, and that's what we will discuss in the next part of this series. Let me know if you have any questions so far and take some time to get acquainted with your Linux box.

No comments:

Post a Comment