Using an iPod in Linux
The market for portable MP3 players has exploded in the last few years, and Apple's iPod is considered by many to be the gold standard to which other players are compared. Despite the fact that Apple does not offer a flavor of its iTunes music application for Linux, the iPod still is a good MP3 player for Linux users everywhere.
As I write this, I've used a 20GB fourth generation iPod with click-wheel and the iPod Shuffle; the software described in this article, however, should work with all iPods. To use the slick GUI of GTKPod, you will have better luck with a newer Linux distro. If you're a fan of the command line, though, you should have no problems getting GNUpod to work on almost anything that runs Perl.
With GTKPod, the open-source answer to iTunes, you can rock and roll all night with your iPod and Linux. GTKPod is the slick GUI that allows you to transfer MP3, WAV and M4A non-DRM-infected AAC files from your PC to your iPod. You can add files one at a time or you can add an entire directory at one time. You can create and edit playlists, normalize the volume on single tracks or multiple tracks at a time. You also can edit the ID3 tag of files on the iPod or files on your computer. GTKPod is even smart enough to know not to upload files that already exist on your iPod. And, naturally, GTKPod lets you delete songs from your iPod should you start running out of space.
GTKPod is built on GTK2. Originally developed for use with The GIMP, GTK now is used widely in many applications and is the set of tools used to build the GNOME desktop. As sure as GTK is slick software, it also is complex software with a raft of dependencies, inter-dependencies and various requirements so byzantine that compiling the stuff yourself from source code is asking for a trip down the rabbit hole. Lucky for us all, everything you need to use GTK applications such as GTKPod should be on your computer already if you're running a recent distribution of Linux.
If you're already using your iPod, you probably have everything you need to use it in Linux: the iPod itself, a PC with Firewire or USB 2.0 support and a relatively recent Linux distribution. You'll also need a copy of GTKPod (see the on-line Resources). On the GTKPod site, you should find a lot of documentation and links to the source code, as well as GTKPod packages for SUSE, Debian, Gentoo, Mandrake and other popular Linux distros. More RPM packages can be found by searching rpm.pbone.net or rpmfind.net.
Because the iPod simply is a fancy removable hard drive, to use it with GTKPod in Linux, your kernel needs to support fancy removable hard drives. This kind of support has been in the kernel since 2.4, and it has been refined in the current 2.6 kernel. Almost all current distributions use the 2.6 kernel, and removable hard drive support usually is compiled in the kernel or is available as loadable kernel modules. Therefore, you shouldn't need to do anything to your system to make it see the iPod.
You can connect the iPod to your Linux box through a Firewire connection or a USB 2.0 connection. USB 1.1 also works, but we don't recommend it because the connection is so much slower. Another drawback of using USB 1.1 is the iPod can't charge while it's plugged into your PC.
FAT32 on a New iPod
If your iPod is just out of the box, you probably have to configure it before you can use it with Linux. Configure sounds nice and easy, doesn't it? In truth, you are going to reformat it. Scared? Don't be.
Most new iPods are shipped with their hard drives formatted with the Mac OS filesystem HFS+. To use an iPod that just came out of its box with Linux, your kernel needs to have HFS+ support as well as support for Mac-style partitions. Most modern distros do not include this support automatically and require a kernel recompile to enable it. Also, it's been reported that the HFS+ kernel support still is a bit buggy. If you're not in the mood to recompile your kernel simply to use your new toy, there is an easier way.
Because most versions of Microsoft Windows turn up their noses at reading/writing to the Mac filesystem, the first thing the iTunes software does when installing on a Windows system is configure the iPod. iTunes says configure but what it's really doing is reformatting the iPod's internal hard drive to the FAT32 Windows filesystem. So if you've just pulled your iPod out of its box, and you've got a Windows machine handy, you can use the iTunes software install process to format your iPod. The iPod Shuffle comes from the factory preformatted with the FAT32 filesystem, so you should be able to use it right out of the box.
Reformatting your iPod also can be done using the Restore iPod feature in the Windows iPod software. But be warned that this step wipes the iPod completely, causing you to lose the all songs and files you had. If you've been using your iPod on a Mac and now want to use it with Linux without reformatting it, check out the on-line Resources for links to tips from other Mac users who have done exactly this. If you refuse to use Windows or Mac OS or if you don't have a Windows machine handy, the Resources also contain links on how to reformat the iPod using only Linux. It is possible, but it does require HFS+ and Mac partition support in your kernel and the use of the GNUPod tools to lay down the basic directory structure on the iPod's cleaned slate.
Installing GTKPod should be no problem whether you're compiling the source code or installing a precompiled binary package. GTKPod requires the libid3tag library, and the libmp4v2 package is required if you plan on using AAC files (see Resources). The source code for GTKPod compiles easily with the standard
./configure make make install
commands. A precompiled binary for your platform should install even easier than that and provides tighter integration with your existing desktop.
Once the iPod is formatted with FAT32 and GTKPod is installed, plug the supplied Firewire or USB cable into your PC, and plug the other end into the iPod. If Linux sees the iPod, you should see the iPod's screen flash the message “Do Not Disconnect”; on the iPod Shuffle, the status light blinks orange. If your iPod doesn't do this, try unplugging it and plugging it back in. I'm using Firewire instead of USB on my 20GB iPod, because the majority of on-line resources provide directions for using it. Also, if you only have the one Firewire device active, it makes things a little easier when disconnecting the iPod. The iPod Shuffle connects as easily and predictably as a USB thumb drive. See the Troubleshooting section of this article if you have problems getting Linux to see your iPod.
If you're using a disk-based iPod that's already FAT32-formatted (see Sidebar), there are two partitions on the drive. One is about 40MB and holds the iPod's firmware operating system, and the second is a huge partition that holds all of your music. If you're using an iPod Shuffle, you have only one partition, and it's already FAT32-formatted from the factory.
Every computer is going to be slightly different, so I recommend tailing your /var/log/messages file, or the analogous file for your Linux distribution, to watch what's happening behind the scenes when you first connect your iPod. The log file should indicate that your system has recognized the iPod and assigned it the next available SCSI drive letter, /dev/sda if you're running nothing but IDE drives. Some systems use the fstab-sync utility to edit automatically the /etc/fstab file to include a mount point for the iPod. Others require that a specific entry in your /etc/fstab file already exists. If you're tailing the /var/log/messages file and you don't see something like this fly by:
fstab-sync: added mount point /mnt/ipod for /dev/sda2
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
|Trying to Tame the Tablet||May 08, 2013|
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- Android is Linux -- why no better inter-operation
1 hour 48 min ago
- Connecting Android device to desktop Linux via USB
2 hours 17 min ago
- Find new cell phone and tablet pc
3 hours 15 min ago
4 hours 44 min ago
- Automatically updating Guest Additions
5 hours 52 min ago
- I like your topic on android
6 hours 39 min ago
- Reply to comment | Linux Journal
7 hours 27 sec ago
- This is the easiest tutorial
13 hours 14 min ago
- Ahh, the Koolaid.
18 hours 53 min ago
- git-annex assistant
1 day 53 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?