Showing posts with label introduction. Show all posts
Showing posts with label introduction. Show all posts

Monday 11 April 2011

Another New Home Server

Those of you following this blog over the past couple of years will know I've already had several low power home servers including an NSLU2, tinytuxbox and Joggler.  The NSLU2 and tinytuxbox are both history but we've still got the Joggler at home.  After finding it was grinding to a halt with the stuff I was running on it while trying to use it interactively it became clear we needed something else at home too.  Since I was also running out of storage space on my home PC a NAS solution seemed like the obvious choice so I went for a Netgear ReadyNAS Ultra Plus 2 (RNDP200U).

I opted for the ReadyNAS Ultra series because I run a SqueezeBox Duet for my music and Netgear are the only partner directly supported by Logitech for their music devices.  After spending huge amounts of time hacking the NSLU2, tinytuxbox and Joggler I felt it was about time I had a device that "just worked" so the option of simply downloading and installing stuff and having it work is really quite attractive.  Of course, other NAS devices can run SqueezeCenter but whether the community supported versions work well and are kept up to date is another matter which I didn't investigate thoroughly.  Another good reason for choosing the Ultra series is they're based on x86 hardware so some of the code and plugins I know I want to run which had previously not worked (or been possible) on the slug for example would be fine, a lot of NAS boxes are still running ARM processors.

The Ultra 2 comes in 2 flavours and I went for the more powerful of the two (the Ultra 2 Plus).  They are exactly the same except the Ultra 2 Plus has a dual core processor vs a single core on the Ultra 2.  Given I'm fully intending to run what is probably more than average on the NAS the chance of getting a more powerful processor was well worth the extra few quid it costs.

On the subject of price, the NAS solution is probably one of the more expensive ways to get yourself a home server.  Again though, the "it just works" factor comes heavily in to play here as I'm not responsible for installing the O.S. and setting up a raft of different services on the box, they're all just there, working!  Probably the most competition for a NAS would be the Asus Revo running Linux, possibly with FreeNAS on it too.  The Revo with the same processor as the Ultra 2 Plus I bought is around 60% of the price.  The Revo isn't able to support the amount of storage you can get with a NAS device though, doesn't (easily) support RAID and if I did want to do those things it would have to be with ugly USB attached disks which are hard to spin down when not in use.

It took just a matter of hours to unpack, boot and setup the device in the way I wanted.  The array has been formatted and exports a share to Linux and Windows boxes, all my data has been copied on there with plenty of room for expansion and user management is sorted.  After that, updating SqueezeCenter to the latest version was simple and installing other additional software (whether official or community supported) is also really easy.  So far I've set up transmission (for bit torrents) and enabled ssh access.  Hardware management is all done through a web interface so the option of automatically powering on/off the device on a schedule or setting up disk spin down is merely just a box tick away.

I've got it connected to a 10/100 switch which is fine for streaming music to the SqueezeBox or sharing pictures with the Joggler but for access from my PC and to large amounts of data I figured that throughput wouldn't be enough.  Fortunately, the NAS has 2 Gigabit Ethernet ports so I've used the second one to direct attach it to my PC and enabled Jumbo frames.  The performance over that link has been absolutely fine whether measured simply by the subjective feel of how long it takes to do certain tasks or via a more rigorous iozone test.

With the tasks of device and software management all taken care of the the thing up and running in no time at all, I'm looking forward to having more time on my hands to do some even more interesting hacking with the box instead.

Tuesday 1 June 2010

Joggler Linux Boot Mysteries

PCs boot first using a system known as a BIOS (basic input output system), that's the bit you might see when you very first switch on your computer and might say something like "Press F1 to enter system menu" or similar. The BIOS is responsible for knowing enough about your hardware such that it can start the computer, run your boot loader and ultimately pass on some information to your operating system which takes over control of the hardware. The Joggler doesn't boot using the mechanism most of us as PC users are familiar with, however, abandoning the BIOS in favour of EFI (extensible firmware interface). EFI is much bigger, more flexible and inevitably a lot more complicated than the older BIOS system. I'll attempt to unravel in simple terms some of the mysteries of booting your own operating system on the Joggler here.

EFI has its roots in Intel in the same way as a BIOS has its roots in IBM.  Basically, it consists of a set of executables able to run within the simple environment EFI provides.  These executables are just little computer programs that can vary extremely widely from talking to a piece of your hardware to providing you with a shell environment in which you can interact with EFI through to booting your operating system.  This last function is quite important to us as computer users if we're to understand how EFI is used to start your machine, in this case your Joggler.  A BIOS will boot your machine by looking at the master boot record and starting the boot loader that your installed operating system has put there; your operating system is responsible for booting itself.  EFI does away with this, moving the responsibility for booting operating systems into the firmware interface itself, you no longer need a boot loader for your operating system.  Instead, the boot loader is now just another EFI program that runs within the simple EFI environment I mentioned earlier.

You've been wondering what this FAT partition on your Joggler image is all about?  FAT is just another file system like NTFS for Windows or ext for Linux, it's very widely understood so is commonly used these days on USB sticks but not necessarily many other places.  If your disk is to be used to boot an operating system then EFI says you need a FAT file system as the first partition of that disk.  EFI actually says FAT12 or FAT16 must be used for "removable media" so for us Joggler users with USB sticks or hard disks we should be using FAT16 even though EFI can understand FAT32 as well.  You could boot any other disk from your FAT partition but all the simple Joggler cases would just involve booting an operating system somewhere else on the same disk i.e. the second partition.

Fortunately for us, when you start your Joggler its EFI looks both at its internal disk (the one with the O2 interface on it) and removable media (your USB disk).  The FAT partition is discovered on your USB disk and by convention the file called startup.nsh is executed.  This file is simply a script which can be used to execute any EFI script commands you wish.  For Joggler USB booting it just runs a local script on your disk to start your boot loader EFI program.

So for the Joggler we might have something like this in startup.nsh on our disk in order to call the boot.nsh:
fs1:boot2
fs0:boot


And the following in the file boot.nsh to start the grub EFI boot loader program:
fs1:
grub


You now know what to do in order to boot your Joggler from a USB disk but the final missing piece to the puzzle is the EFI boot loader program itself. In the example above I used grub as the boot loader program. Yes, this is the same grub you're familiar with from booting Linux on BIOS based machines. However, in this example it's an EFI program so you'd be right to be wondering how you go about getting a copy of it.  In my example here your FAT partition already has 2 files on it (startup.nsh and boot.nsh) and you'll need another 2 files (grub.efi and grub.cfg) to be able to boot your disk

There are two versions of grub.  The old version, grub 1 or grub legacy as it's know known is not the one you want.  You're looking for the current version which is (or will become) grub 2.  At the time of writing grub 1.98 is the latest version, download the released version.  Unfortunately, it doesn't work on the Joggler without applying a patch.  So it's with thanks and reference to the guys over at Joggler Hacks I got my Joggler booting with my own grub 2.

To compile an EFI version of grub 2, unpack the source you've downloaded, then apply the Joggler grub 2 patch (using patch -p1), run ./configure --with-platform=efi and make.  The compilation should proceed through to completion leaving you just finish off by making the grub EFI program.  You can do this with ./grub-mkimage -d . -o grub.efi part_msdos hfsplus fat ext2 normal sh chain boot configfile linux.  The file grub.efi will be created and you can copy this to your FAT partition.

The one remaining thing to do is create the grub configuration file.  In grub 2 this is called grub.cfg and can be put in the root directory of your FAT partition with the other three files already there.  If you've got your root file system on your second partition then the following should be enough for you to boot it:
set timeout=0
menuentry "Linux" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda2 acpi=force ro idle=halt
initrd /initrd
}


This configuration requires your kernel (vmlinuz) and ram disk (initramfs or initrd) to be on the FAT partition too.   The final piece to the puzzle is to copy these files from your installed version of Linux in the second partition from the /boot directory.  With all six files in place on the FAT partition you're all set to boot the OS on the second partition.  Most recent versions of Linux should at least boot on the Joggler. However, the Joggler does have some interesting hardware which may not be optimally supported.  Hence, for the quickest out of the box working system you're still better off using a pre-built image from someone else as now you've got the thing booted the hard work is only about to begin.

You can find a lot more of my information about the Joggler at my Joggler Index post. I also have a list of Joggler Bookmarks.

Sunday 13 July 2008

Introducing the TinyTuxbox

My second choice of home media server arrived on my doorstep last week after my unwillingness to maintain the painfully slow and awkward slug. This time around I've plumped for a TinyTuxbox Series 8 which seems to be a UK resold version of the e-Box 4300. It fits the extra requirements I made after parting with the SLUG, that is it's an x86 based machine and has lots more memory. I'm not the only one at work with one of these types of boxes either, James Taylor has the Netvoyager re-badged version of the previous box to my one, the e-Box 2300.

It is, in fact, a fully functional x86 PC but just a really small one, even smaller than the pretty tiny Fit-PC which I was also seriously considering and probably would have gone for were it not for the excellent pre-sales support of one of the TinyTuxbox staff over e-mail. That said, the excellent pre-sales was balanced with painfully slow delivery. It took 28 days to get it to my door which for a delivery cost of nearly £20 I consider poor. I've been left with a upward feeling though, post-sales support has been promising too as I initially had some problems installing the box, which it turned out were my fault and I solved quickly enough anyway. I'm not going to talk software here though, that's a story for another day. So how does my TinyTuxbox look and spec up....?

The workhorse of the TinyTuxbox is the 500MHz Via Eden ULV processor which provides a 32-bit x86 processor along with a built-in graphics processor with hardware MPEG decoding. The processor is an impressive bit of kit, it runs all that from just 1 watt of power, see the link for the full specs! Away from the processor we have 512MB RAM (some of which is shared for the video output), on-board Ethernet, 3 USB ports, VGA output, a PS/2 connector (supplied with PS/2 Y-Splitter cable to connect both keyboard and mouse), a compact flash slot, sound in and out, power button, and hard disk and power LEDs. The box is also fitted with an IDE connector and can house a 2½" laptop type hard disk in it. I ordered it without the hard disk and fitted my own as the supplied ones were not good value for money probably due to the services incurred from the fitting itself.

The TinyTuxbox site advertises the unit as consuming a maximum of 8 watts and I'm pleased to report that was absolutely accurate. According to my current cost meter, it uses 8 watts with the hard disk spinning so once I get it to spin down on idle it should use very little juice. Click the various images for a link to my Flickr page and some more notes.

Monday 12 May 2008

Welcome

I'm sitting here having just started a new blog and wondering whether to write a this is my first post entry or not, cheesy as it may be, here it is...

I've been involved with various blogs over the years but never set one up externally to the company I work for that my overlap with my professional interests. There are, of course, external blogs I've written for including Eight Bar and the blog I write with Beth about our allotment. My personal interests regularly overlap those I have at work, I intentionally use the term professional interests having recently been certified by the British Computer Society as a Chartered IT Professional; I usually describe myself informally at work as A Professional Linux Geek. I currently have some ideas I wanted to write about that don't really fit in any of the places I not-so-regularly write, I hope to log these here and continue to do so in the future.

Picture of GrahamA quick intro to me then. I've already given away I have technical interests and the name of my current employer. I left Exeter University with a degree in Computer Science and Management Science to work at the Hursley location where I established an interest in Linux. This has since been broadened into open source software generally, and open standards and the web. All this has been through a number of interesting positions working in internal support, super computing, and customer facing consulting. I'm currently working for an organisation called Emerging Technology Services that offer great skills to our customers interested in all things new and trendy.

Away from work I like to get out and about. Whether that's playing badminton (I do that a lot), or out with Beth Geocaching, general walking, or working down at our allotment. I like a lot of sports to both play and watch (except football/soccer). I have an interest in music, listening to as much as I get time for and having played the piano since just before I was 5 I think. When all else fails I can usually be found playing the odd computer game on the PC or the Wii, or around the house somewhere doing some DIY.