Friday February 10, 2012 12:00 PM AEST

Plug your iPod into Linux

By Staff Writers
10:58 Apr 27, 2005
Tags: Linux | ipod | gtkpod | itunes
Plug your iPod into Linux

Are you a Linux user longing for iTunes? A bit of time and a little custom software can bring music to your ears.

Are you a Linux user longing for iTunes? Leigh Dyer explains how a bit of time and a little custom software can bring music to your ears.

Apple has swept the portable MP3 player market with the iPod, and it's not hard to see why. No competitor has yet come close to the elegance of Apple's user interface, both on the iPod itself and its iTunes music software. Linux users miss out on iTunes, but with some alternative software the iPod can be just as easy to manage.

iPod formats

iPods are designed to work on both Macs and Windows PCs, and to do this, they use two different filesystems: Windows iPods use FAT32, and Mac iPods use Apple's HFS+. All iPods ship in Mac format, but they can be formatted from one to the other using software under Mac OS or Windows.

Recent Linux kernels can use Mac iPods directly, thanks to HFS+ support provided by the 'hfsplus' kernel module. There's one snag, however: Mac iPods also use a Mac partition table. Linux has support for this, but it's a compile-time kernel option, so if your kernel doesn't recognise your Mac iPod, you need to either recompile your kernel, or convert the iPod to Windows format using the Windows iPod software.

 
Linux automatically detects the iPod after being plugged in

Plugging it in

Connecting recent iPods to a Linux PC is an easy affair, since they support USB and work just like other removable USB drives. Most distributions automatically mount these, so your iPod should just appear on your desktop. To see where it's been mounted, run the 'mount' command, and look for something like this:

/dev/sda2 on /media/sda2 type vfat

If your iPod isn't mounted automatically, run 'dmesg' and see if it mentions it. USB media devices appear as SCSI drives, so you might see something like this:

SCSI device sda: 39063024 512-byte hdwr sectors (20000 MB)

This shows that the kernel has assigned the iPod to device 'sda'. Windows iPods use partition 2, so try mounting it using this command:

mkdir /mnt/ipod
mount /dev/sda2 /mnt/ipod

For older (first and second generation) iPods, Firewire is the only way to connect them to a PC. Plugging your iPod in via Firewire should be no different from using USB - it should be mounted automatically, but if not, you can do it manually.

gtkpod

Because the iPod uses a proprietary database to keep track of the files it contains, managing your music requires custom software. On Linux, the best option is gtkpod (gtkpod.sf.net), a great GUI utility that offers a similar interface to iTunes. The website has links to packages for various distributions, but it's easy to compile from source as well.

 
The gtkpod interface closely follows that of iTunes
 
 
Syncing the iPod over USB 1.1 can take some time
Run the 'gtkpod' command to bring up the interface. If your iPod is mounted at '/mnt/ipod', gtkpod should start scanning it automatically. If not, select 'Edit Preferences' from the Edit menu, and enter in the mount point for your iPod. Click on the Read button in the toolbar to force gtkpod to read in your iPod's contents.

Once gtkpod has scanned your iPod, you can browse through the contents much like you would in iTunes. Unlike iTunes, gtkpod lets you copy music from your iPod to your PC - right click on a file, artist, or album, select 'Copy from iPod' and enter the destination directory.

On the left, you'll see a list of playlists on your iPod, with the first one, highlighted in red, representing your entire iPod. To view or edit a playlist, click on it. The artist/album/track listings on the right show only the files in the current playlist.

Editing the files on your iPod is easy. To delete a file, right click on it and choose one of the Delete options: 'Delete from Playlist' removes the file from just the current playlist, while 'Delete from iPod' removes it from the iPod entirely, deleting any references to it in other playlists.

Hit the '+ Files' or '+ Dirs' button in the toolbar to add either select files or an entire directory recursively. Files are added to both the iPod and the current playlist. To add the files to other playlists, drag them over to the playlist.

gtkpod doesn't edit your iPod on the fly, rather it records your actions internally. To write your changes to the iPod, click the 'Sync' button. Once the sync is complete, you can close gtkpod and unmount your iPod. You might find that the iPod continues to display the 'Do not disconnect' message even after unmounting. If this happens, use the eject command to tell the iPod that it can be safely disconnected:

eject /dev/sda

 
 
This article appeared in the February, 2005 issue of Atomic.

Behind the scenes with Mass Effect 3! GTX 560 VGA round-up! Essential Skyrim tweaks to improve your game! Plus reviews, news, hardware, more games, and easy to following modding guides for PC builders. ON SALE NOW!
 
Latest Competitions
 
Atomic Magazine

Issue: 133 | February, 2012

Atomic is a magazine aimed squarely at computer enthusiasts, gamers, and serious PC upgraders.

Every month we bring you the latest reviews of new technology and PC components, in depth features on everything from overclocking to console hacking, and gaming previews and interviews.
 
Latest Comments
 
Latest User Reviews
Battlefield 3 is the new benchmark online FPS
90%
A very fun and realistic multiplayer ride.
 
Antec Kuhler 920 - liquid cool
90%
Antec Kuhler 920 silent but effientive out of the box no maintence water cooling kit
 
Antec's Lanboy Air - our new favourite case
90%
Antec Lan boy Air in red a very cool design
 
Antec's Lanboy Air - our new favourite case
90%
This product overall is awesome.
 
MSI's GT780 laptop as fast as it gets
90%
Nice laptop
 
 
Close Get the February, 2012 issue of Atomic mailed to you for $8.95, including postage.

SubscribeBuy nowDigital Version