This is definitely a work in progress, so please be careful with anything published so far and please provide feedback if you get into trouble.
In my prior article, I showed how to use a USB flash drive to install a new bios on a Via Artigo. But now that you’ve got the latest BIOS on there, you’d probably like to install an OS.
Here’s why I chose Ubuntu:
- Comes in a server edition
- Easy install
- Good community forums for support
- Software manager provides a nice way to install packages, as to apt-get
I’m sure other common distros would be nice as well, like Fedora, but I do like the ease and popularity of Ubuntu. Another good alternative is FreeNAS, and I can see from their updates they are now specifically supporting the Artigo. My only desire was to have a bit more flexibility than FreeNAS provides.
My goal in this How To is to cover everything you need to take the bare bones hardware and make it into a NAS with most of the common features people would want in a home NAS.
I’m going to assume that you have a CF card installed on board which is big enough to handle all of your system software. I used a 8gig but I’m sure that 4 or even 2 could be enough, however the nice thing is with 8 is that you don’t have to be overly careful about optimizing what you have installed. 16 or bigger would just be gravy, but go for it if you’re feelin’ it. I’m also going to assume that you have two discs installed in the SATA channels which you’d like to use in a RAID. Given the hardware config of the Artigo, I’d think this is the most common setup.
Step 1) Install Ubuntu on the CF card
This article at Ubuntu details several methods of getting Ubuntu onto a USB drive. I chose UNetbootin because I didn’t feel like burning the Ubuntu image to a CD as I wasn’t going to use it that way.
Once you have your USB drive ready to go, hold escape when the BIOS of the Artigo boots to choose the USB drive to boot off, and install Ubuntu. You don’t have to set up a RAID during the install because you’re not using the raid to boot the OS (that’s what the CF card is there for). This does certainly simplify things.
For some reason, my Artigo didn’t seem to want to see the USB Flash until I booted from USB-ZIP. Which is odd, but that’s what worked for me.
Step 2) Initialize the discs using GParted
I wanted to use GParted here because it’s a simple GUI and it takes some of the scare out of using fdisk to do everything. If you already have the discs ready to go, you can of course avoid this step.
To installed GParted:
a) Start Synaptic Package Manager
b) Search for GParted
c) Mark for install
d) Apply
Then use GParted to partition as msdos, format as ext4 for both disks, full size (don’t need swap as that’s on the sdc which is the flash).
Step 3) Configure the RAID 10 using mdadm
Using drives only for storage simplifies the system and allows them to remain powered down except when data is needed. I chose RAID level 10 because it should provide the speed of RAID 0 with the recovery of RAID 1
sudo -s
#make a directory where you can mount the new raid software device. This can be any name you like, and /mnt is the standard area to create this folder.
mkdir /mnt/raid
#Chunk level here could be experimented with, 64 is default but smaller sizes are better for bigger files. I tried 32
mdadm -v --create /dev/md0 --chunk=32 --level=raid10 --raid-devices=2 /dev/sda1 /dev/sdb1
VERY IMPORTANT here: Everything up to here will work fine while the computer remains on, but mdadm has to be configured so that the raid array will work on the next boot. The standard location /etc/mdadm.conf WILL NOT WORK ON UBUNTU! This part had me twisted for a while. On Ubuntu 9.04 server, the correct location is /etc/mdadm/mdadm.conf.
#This sets up the base configuration file for mdadm
mdadm --examine --scan --config=mdadm.conf >>/etc/mdadm/mdadm.conf
#Edit /etc/fstab to add entry for /dev/md0
nano /etc/fstab
Add a line like:
#raid10 array on /dev/md0
/dev/md0 /mnt/raid ext4 defaults 0 0
View the status of a multi disk array, just to verify everything is OK. At first, the drives will have to be created and synced, so you will see that when you run this command.
mdadm --detail /dev/md0
After the raid is synced you’ll see something like this:
/dev/md0:
Version : 00.90
Creation Time : Tue Jul 28 00:15:04 2009
Raid Level : raid10
Array Size : 1465135936 (1397.26 GiB 1500.30 GB)
Used Dev Size : 1465135936 (1397.26 GiB 1500.30 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Fri Aug 7 20:54:18 2009
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Layout : near=2, far=1
Chunk Size : 32K
UUID : 7a6763e8:9cfe80d1:01f9e43d:ac30fbff (local to host server)
Events : 0.54
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
If you get stuck at this step or want more detail, an excellent post is available from:
http://ubuntuforums.org/showthread.php?t=408461
Step 4) Enable resolutions past 640×480 with VNC in a headless (monitorless) configuration.
This will give you the basics of the file if it’s not already configured; also a nice way to recover if you’ve made a mistake.
dpkg-reconfigure xserver-xorg
nano /etc/X11/xorg.conf
Configuring Xorg resolution http://ubuntuforums.org/showthread.php?t=83973&highlight=reconfiguring+Xorg
Using the basic file configured above, now you can make edits. Add these lines to go up to 1920×1200 resolution, in the appropriate section of the file:
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 32-75
VertRefresh 55-120
EndSection
In the next post, I’ll get into the installation of the software which makes using the NAS worth while: Samba sharing, UPnP server, Bittorrent downloads