Ubuntu Breezy and the iPod

Ubuntu 'Breezy Badger' was able to detect the iPod perfectly, and offers it as a mountable SCSI disk device, similar to all other USB storage media devices. However, there's still a few more things to do before it becomes usable!

A tip upfront

Apple don't seem to like admitting this -- it's not in the manual -- but you _will_ need to know it: you reset a hung iPod by holding Menu and Play for 5 seconds.

Mounting and Unmounting

First off, the iPod device's naming depends on what else you have plugged in -- it may be /dev/sda1, /dev/sda2, dev/sdb1, etc. This is a Linux misfeature. ;) To work around this, you need to use 'udev' to assign it a /dev node when it's plugged in.

sudo vi /etc/udev/rules.d/ipod.rules, and create it with these lines:

# iPod!  http://taint.org/wk/IpodOnBreezy
BUS="scsi", SYSFS{model}="iPod            ", KERNEL="sd?2", NAME="%k", SYMLINK="ipod"

**UPDATE**: udev in Edgy or Feisty has changed syntax - this no longer works. :(

Unplug and replug the iPod, and now each time, /dev/ipod will appear, pointing at the auto-named device node.

(Aside: it is possible to create a subdir of /dev which automatically creates these nodes based on SYSFS{model}, so I don't have to edit the file each time I buy a new gadget. See http://taint.org/wk/TipUdevByModel .)

Create the mountpoint:

sudo mkdir /media/ipod

Add this line to /etc/fstab:

/dev/ipod   /media/ipod  vfat    defaults,user,noauto,noatime 0   0

It can now be mounted and unmounted as a normal disk device.

GtkPod

For an app to interface with the iPod -- 'gtkpod' seems the most promising and reliable right now ('sudo apt-get install gtkpod').

Apparently, you may need to 'format' the iPod using iTunes on Windows, or on a Mac. I attempted to do this with the Windows XP I have running in my VMWare virtual machine, but it appears VMWare interferes with 'high-speed' USB -- so the iPod was never recognised as a valid device under Windows. However, it appears that the current (video) iPods no longer need this, as I just used gtkpod's 'Create iPod's Directories' menu item, and it all worked fine!

The most important preference settings are as follows:

General -> Import -> iPod Mount Point: /media/ipod
    [x] Handle mounting/unmounting
    [x] Automatically import iTunesDB on startup

Unmounting

GtkPod will mount and unmount fine -- but the iPod needs to be "ejected" as well. Create the script ~/.gtkpod/gtkpod.out with these lines:

#!/bin/bash
sudo umount /media/ipod
sudo eject /dev/ipod

Make it executable:

chmod 755 ~/.gtkpod/gtkpod.out

Note that you need to quit using File -> Quit, as using the window close button will cause the window to hang!

Still Suboptimal

These things still don't quite work right:

IpodOnBreezy (last edited 2007-05-03 13:02:43 by 213-202-189-214)