Yellow Dog Linux Installs Neatly on an iPod

Dave Taylor

Issue #146, June 2006

Forget bootable USB pendrives and use an iPod to boot Linux on a Mac.

The concept's great: what would it be like to have a pocket-size device that I could plug in to just about any Macintosh and by simply rebooting the computer be running a full-blown Linux installation? There are oodles of Linux OSes for Intel architectures, of course, but the Mac, until very recently, has been built around the Motorola architecture, so the number of choices are rather fewer.

One of the few Linux OSes for the PowerPC is called Yellow Dog, from Terra Soft Corp., www.yellowdoglinux.com. It costs about $60 US for the install CDs and documentation or $30 US for the “geek edition” (that's just the install CDs), or you can download it for free from the Web site. And, let me answer the obvious question: because Mac OS X already is a UNIX (basically FreeBSD with lots of added stuff, much of which you can find in Darwin, www.apple.com/darwin), why bother with a Mac Linux? The answer is that although Mac OS X is a splendid mating of a UNIX operating system with all the graphical goodness of Apple's user interface design, it's still not Linux. If you're in a Linux environment and want to run KDE or GNOME, you don't have to graft it onto Mac OS X if you can run a Linux designed for the Mac platform instead. Besides, isn't it kinda cool anyway?

Anyway, I had a spare Apple iPod, a first-generation 5GB device that worked via the Firewire interface rather than the more modern USB connection, and I was assured by the folks at Yellow Dog that I could squeeze YDL into as small as 1GB. I have plenty of space on a 5GB device. Of course, I already had a gig of music and audio books I wanted to preserve, so the first test was to see if I could repartition the device to grab 3GB for Linux and keep 2GB for audio and iPod content. The perfect stealth Linux device, right?

So, one afternoon I decided to take the plunge and hooked up my iPod to my PowerBook computer and inserted the first of the YDL 4.1 install disks and restarted the Mac, holding down the C key to force the device to boot off the CD-ROM, not the internal hard disk. When prompted, I typed in install firewire and away we went.

Partitioning the iPod for YDL

New to the 4.x version of Yellow Dog is the inclusion of the popular Anaconda graphical installer, which makes everything quite a bit easier. It lets you resize existing drive partitions to make space for the new operating system. The new partitions also can be made bootable, which is a critical component for the success of this project.

Theoretically, partitioning should be pretty easy. I have a 5GB iPod firewire device and am using just a wee bit more than 1GB of it for music. I'll resize the iPod drive to 2GB and have 3GB spare to repartition as an ext3 filesystem and be good to go.

Well, that's the theory, but it doesn't quite work out that way.

Part way through the install process, managed by Anaconda, I have the option of accepting an automatic partitioning scheme or using Disk Druid to work with my disk partitions manually. I take the latter path and am glad to see that one of the drives is identified as “Drive /dev/sda (4769MB) Model: Apple iPod”, so there's no worry that I'll accidentally reformat or resize my laptop drive, which would be quite ungood. To resize the iPod drive, I simply choose that partition and click Edit in the Disk Druid, and then specify that I want it to be 2,000MB rather than 4,769MB (which should give me 2.7GB for Linux). It promptly recalculates that to be 1,999MB and within about 90 seconds rebuilds the iPod disk partition, leaving a big chunk of space unallocated.

Here's where I get into trouble, because I'm a UNIX geek who is sure that I can proceed without reading any darn manual or instructions. Yeah, even Terra Soft expects this and has a note in the installation guide (which I didn't read until afterward, of course) saying, “User error is common. Not because people lack intelligence, but because people are smart and too determined to jump into their new operating system without reading the Guide to Installation. Especially those of you who are Linux Experts—you know who you are!” Yeah, yeah, yeah.

Fortunately, the trouble ate up only time, and didn't corrupt anything. Basically, although I figured that I simply could create one partition that was all the available space, Disk Druid wouldn't let me proceed without also creating an Apple Boot partition, and then, after I figured that out (the Apple Boot partition is instead of ext3, and not the same as the /boot mountpoint for an ext3 partition), it also insisted I create a swap partition too.

More than once it complained, and I had to back up and resize the new partition down, then create an additional partition, but, finally, here's where I ended up (Table 1).

Table 1. Partition Breakdown

PartitionSizeFile TypeMountpoint
sda32000MBforeign 
sda4 1MBApple Bootable 
sda5125MBswap 
sda62596MB ext3/

If you're paying attention, you'll see that the swap space is really too small. You should have at least the same swap space as your physical memory, and typically 1.5x is a better size for performance reasons. Because I have 756MB of RAM, that means I should have at least a 756MB swap space. Oh well. I indicated that I was okay with a nonrecommended size and proceeded anyway.

Elapsed time: 1 hour.

Basic Network Configuration and Installation

After dancing the Disk Druid dance for almost an hour, it was a distinct pleasure to get to a prompt asking about DHCP and network configuration. I picked all the basic defaults, except I skipped configuring a firewall. It didn't like that, but let me proceed after giving me a little lecture on system security.

As I originally chose a Personal Workstation configuration, it meant that my default package set was X Window System + KDE + OpenOffice.org + Mozilla + Evolution + IM tools + games. Not good. Why? Because my disk partition was 367MB too small.

Going back to the proverbial drawing board, I started trying to pull out individual applications, guessing how much each one would take of the installation. It's amazing, really, after all these years, that Anaconda doesn't indicate how big each package is when you're trying to navigate through it. Instead, I piddled around removing Gaim (a multi-IM utility) to save 41MB; XChat (an IRC client) to save 5MB; all the sound and video applications (saving 57MB); all the graphics applications, including The GIMP and ImageMagick (saving 100MB); and the KDE component kdegraphics (saving 26MB). I attempted to re-install, and wouldn't you know it—still too big, by 185MB.

As you might expect, this was pretty tedious. But when I dug around in the Office Utilities area, I was amazed and delighted to see that the support package openoffice.org-18n (a package with lots of localization libraries for OpenOffice.org) was a whopping 668MB in size. Because I didn't envision that I'd be editing documents in German, Hebrew or Kanji, I happily deleted it and re-added all the individual apps I'd deleted earlier. I even threw in kdegames, eating up 23MB, but hey, who doesn't like games?

Finally, 75 minutes after I started the process, I actually was able to proceed with the full installation. It took 18 minutes before I saw “installation finished”, which I attribute to the fact that the iPod firewire drive is slower to access than the internal hard drive in the PowerBook.

Reboot and Be Happy

I held down the OPTION key on the keyboard during the boot sequence to be able to access the Yellow Dog Linux OS as an alternative to the Mac OS X on my main PowerBook drive. After about 60 seconds of hunting for options, it showed me both Mac OS X Tiger and Yellow Dog Linux. Eureka!

I selected YDL, clicked on the continue button (an arrow) and then was in the yaboot program, where I pressed L for Linux and sat back. Lots of status information scrolled past, including the information that eth0 (the built-in Ethernet port) failed to initialize, which made sense as I wasn't hooked up to a network. Otherwise, I was soon looking at the attractive KDE login window, to which I typed in my new user account information that I'd specified seconds earlier in the first boot utility.

I then was prompted to select display specifics and was pleased to see that one of the display manufacturers listed was Apple. Scrolling down the long, detailed list, I found the right match: “Apple Titanium PowerBook G4” and accepted the defaults for that display.

The next step was particularly satisfying, as it asked about audio hardware configuration and worked with the default settings. Previously, when I had installed an earlier version of YDL on the PowerBook, the audio subsystem had failed, never to work again—a valuable upgrade by itself.

Once the setup was done for KDE, I was running in a full-blown Linux/KDE environment, with all the applications, utilities and games I could want. It was fast, smooth and quite a delight to have a different desktop and user environment on my system.

But, I wanted to test and ensure that everything still worked properly, so I shut down YDL, and sat looking at a dark screen, realizing that there was really no way to know when it had completed its shutdown. Fortunately, I also was watching the iPod screen, and once the system finished shutting down, the iPod switched from “do not disconnect” to an Apple logo, and then rebooted into iPod mode.

Indeed, the iPod works perfectly. All my audio files remained intact, and now when I go to the System Information area on the iPod, it shows that the storage capacity of the unit is 1.96GB rather than the earlier 5GB value. Perfect!

Everything unplugged, I restarted the PowerBook and was gratified to watch it quickly and easily restart in Mac OS X, without any indication that I'd installed anything unusual, touched any hard drives or restarted in a foreign OS just a few minutes earlier.

Success!

And in the End

Alright, it's geeky, but I think it's way cool to have an iPod that can boot any G4 Mac into a full Linux work environment with only a few keystrokes. If you need Linux functionality and don't want to touch your existing Mac OS X systems, this can be a great solution, and you don't even lose the functionality of your iPod along the way. Indeed, a quick search on eBay shows that you can pick up one of these ancient 5GB iPod units for less than $60 US, on average.

There are some caveats about this installation, however, particularly regarding the very latest iPod systems, which have a slightly different filesystem. If you are going to proceed with this, don't follow my lead but start on the Terra Soft site and read the hardware and configuration notes. It'll save you a lot of heartache down the road.

Dave Taylor has been involved with the UNIX community since 1980 and was the original author of The Elm Mail System. He's written 20 books, including Teach Yourself Unix in 24 Hours and Wicked Cool Shell Scripts. He invites all true Linux fans to visit his Weblog at www.askdavetaylor.com.