The idea of creating a Linux Network Attached Storage (NAS) device with a netbook might sound crazy, but think about it: A NAS device is simply a dedicated device that stores files and/or backs up files. Also, NAS devices can be expensive and challenging to set up. Many netbook models are affordable and, with the help of Linux and Samba, can be amazingly simple to set up as NAS devices. A netbook would be a great piece of hardware for this purpose. Plus, since some netbooks have the equivalent to a solid-state drive, the speeds will be fast and the shelf life will be long. The netbook would need to have plenty of storage space (or the ability to add external drives), but this NAS would take up very little space and, if it was set up wirelessly, it could be portable within the building. Without further ado, let's set up a netbook NAS.
What you'll need to collect and/or download
- A netbook (preferably one that runs and supports Ubuntu Linux)
- Ubuntu 11.04 Desktop (The Netbook Remix is no more now that Unity is the default desktop.)
- Samba (for filesharing)
- UNetbootin (for installing Ubuntu onto the netbook)
- A flash drive large enough to hold the Ubuntu distribution (1+ GB)
- p7zip-full (which is necessary for UNetbootin to function)
You need to open a terminal window and issue the command sudo apt-get install p7zip-full. You will be prompted to enter the sudo password. Once authenticated, you should accept any dependencies necessary, and then the software will install.
Install Ubuntu onto a flash drive
The downloaded UNetbootin file will be named unetbootin-linux-XXX (XXX is the release number). In order to use the UNetbootin file, it must have executable permissions. To give the file executable permissions, you need to open a terminal window, change to the directory housing the downloaded file, and issue the command chmod u+x unetbootin-linux-XXX (XXX is the release number).
Now insert the flash drive into the machine and take note of where the flash drive is detected; this is very important because it will ensure you do not over-write your desktop drive. If you enter the mount command with no options or switches, the command output will tell you everything you need will be listed there. The flash drive will be listed as a device like /dev/sdg. If you enter the command df -h, it will output the device as well as the size of the device so you can be sure to have the right device.Once you know which device to use, you can start installing Ubuntu 11.04 on the flash drive. From the command prompt, issue the command sudo ./unetbootin-linux-XXX (XXX is the release number). After the UNetbootin window opens (Figure A), you need to make the following configurations:
- Select Diskimage.
- Click the "..." button and navigate to where the Ubuntu 11.04 ISO is saved.
- Select the ISO and click OK.
- Select USB Drive from the Type drop-down.
- Select the Correct device from the Drive drop-down.
- Click OK.
I opted to download Ubuntu 11.04 directly from within UNetbootin. This is just as easy as downloading the ISO and installing from the downloaded image.
This process can take some time, so you might want to have your coffee break now.
Install Ubuntu on the netbook
With Ubuntu on your flash drive, you need to insert the flash drive into the netbook and reboot. You should make sure the netbook boots from the flash drive; this will boot up a Live session of Ubuntu.
The next step is to walk through the standard Ubuntu installation on the netbook. (You should ensure the Ubuntu installation installs on the correct drive.) Once the installation of Ubuntu is complete, reboot the netbook and make sure it is capable of getting online.
Install SambaThe process of installing Samba is easier than you might think. If you open Nautilus, Samba (and its components) can be installed by right-clicking a folder (preferably one that is going to be shared) and selecting Sharing Options. When the new window opens (Figure B), you should click the check box for Share This Folder. Because the Samba service is not installed, you will be prompted to install the Sharing service. Click the Install Service button in the resulting prompt. After you authenticate with sudo, the installation will commence. Figure B
If you allow full Guest access, Nautilus will prompt you to allow it to automatically set the permissions.
Once Samba is installed, the Shared folder can be configured and will be available for the network. If external drives are attached to the netbook, you should make sure the necessary directories on those drives are shared out. If the entire drive is to be shared out, open Nautilus, navigate to the /media directory and share out the correct drive. If the error pops up that the drive could not be shared, Nautilus will need to be opened with administrative privileges by following these steps:
- Open terminal window.
- Issue the command sudo nautilus.
- Enter the sudo password.
It should be possible to share out the entire drive. At this point, you can hop on all the windows machines and map the drive (gaining access from Explorer by entering \\IP_ADDRESS_TO_NAS) so that it's always available to your users.
Congratulations! You now have a low-cost, portable NAS device that can be used on your network.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.