Contents

Using an Apple iPod on Linux

When I first got my iPod, using an iPod on Linux took a bit of effort to get going. Now we have wonderful things like HAL, and gnome-volume-manager for hotplugging your iPod, and even a few new apps to sync your iPod too.

The easiest programs to use with the iPod would probably be GTKPod, banshee and rhythmbox. With an up-to-date distro, you should be able to install these by packages. If you want to use Banshee, make sure it's at least 0.11.3 because there was iPod issues with 0.11.0 - 0.11.2.


Converting a Mac iPod to a Windows iPod

Apparently the older iPods came only for Mac, and then Apple started producing the iPod for Windows as well. The difference between the two is the filesystem of the iPod. The Mac unit shipped with the HFS+ file system, but once converted to a Windows iPod, it contained a FAT32 filesystem. Windows users had their iPods converted to FAT32 when first initialiased with the CD that came with the software. To use your iPod on Linux, you now have the choice of leaving it as HFS+ (Mac) or converting it to FAT32. Kernel support for HFS+ is getting really good now, and may even work fine with the iPod, I still prefered to use the FAT32 filesystem, for use on all operating systems.

You have two choice on how to turn your Mac iPod into a Windows iPod. You can either

  • Just connect it to a Windows box, and use the iPod tool to do it for you
  • Do it the hardcore command-line way, using only Linux!

I have documented some of my steps for converting a Macintosh iPod to to a Windows iPod, using only Linux with the IEEE1394 interface.

This is what I would recommend you have set in your kernel config:

SCSI support  --->  
 <M> SCSI support
 <M> SCSI disk support
IEEE 1394 (FireWire) support (EXPERIMENTAL)  --->  
 <M> IEEE 1394 (FireWire) support (EXPERIMENTAL)
   <M> OHCI-1394 support
   <M> SBP-2 support (Harddisks etc.)
File systems --->
 <M> Apple HFS+ (Extended HFS) file system support (EXPERIMENTAL)
 Partition Types  --->
   <*> Macintosh partition map support


It is important to have the Apple HFS+ and Macintosh partition map support, so that we can at least copy the iPod's firmware to a file, while we kill everything on the iPod hard drive. So, now that either you have recompliled your kernel, or your settings already look like this, let's proceed.

As far as the modules are concerned, you are probably using the hotplug package, which should take care of most of the dirty stuff for you. When you connect your iPod to the firewire, you should see modules such as ieee1394, ohci1394 and sbp2. The sbp2 module handles the actually ieee1394 harddisk thing, as is very important.

When connecting the iPod to your machine, doing a tail -f /var/log/messages should show something similar to:

Dec 26 17:56:27 sway ieee1394: Node changed: 0-01:1023 -> 0-00:1023
Dec 26 17:56:27 sway ieee1394: Node removed: ID:BUS[0-00:1023]  GUID[000a270002587789]
Dec 26 17:56:30 sway ieee1394: Node added: ID:BUS[0-01:1023]  GUID[000a270002587789]
Dec 26 17:56:30 sway ieee1394: The root node is not cycle master capable; selecting a new root node and resetting...
Dec 26 17:56:30 sway sbp2: $Rev: 1074 $ Ben Collins <bcollins@debian.org>
Dec 26 17:56:30 sway ieee1394: Node changed: 0-01:1023 -> 0-00:1023
Dec 26 17:56:30 sway ieee1394: Node changed: 0-00:1023 -> 0-01:1023
Dec 26 17:56:30 sway scsi1 : SCSI emulation for IEEE-1394 SBP-2 Devices
Dec 26 17:56:32 sway ieee1394: sbp2: Logged into SBP-2 device
Dec 26 17:56:32 sway ieee1394: sbp2: Node 0-00:1023: Max speed [S400] - Max payload [2048]


Your iPod should now be accessable at your next unused SCSI device (maybe /dev/sda?). Now, we can backup the firmware and get rid of that pesky HFS+ partition. Now, let's make a Windows iPod

So, getting straight into the guts of it, we backup the firmware partition to a safe file:

dd if=/dev/sda2 of=backup_firmware


Put lots of 0's all over the drive:

dd if=/dev/zero of=/dev/sda bs=1M count=10


Remove the sbp2 module and insert it again to re-read the drive:

rmmod sbp2 && insmod sbp2


Now we need to re-partition the drive. I used a combination of cfdisk and old old fdisk. After attempting to use the instructions found on some other sites, I found that it was easier to first create the partitions using cfdisk. So, type:

cfdisk /dev/sda


Then, create two partitions. The first should be big enough to hold your firmware. I made mine 34MB, because any smaller, the firmware wouldn't fit. Then, create another partition which should fill up the rest of the drive. Your music will be stored in here. Make sure you write the changes, then quit. Now, using fdisk:

fdisk /dev/sda	
t   < modify the type of the partition >
1   < partition 1 >
0   < set it to be type '0 '. Ignore any warning >
 
t   < modify the type of the partition >
2   < partition 2 >
b   < set the partition to be WIN95 FAT32 >

p   < show the partition map >

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1             1        38     38896    0  Empty
/dev/sda2            39     19073  19491840    b  W95 FAT32
w   < write changes >
 


Copy the firmware back onto its partition:

dd if=backup_firmware of=/dev/sda1


Format our "Windows" FAT32 partition (in gentoo, make sure you have the dosfsutils package):

mkfs.vfat -F 32 -n "My iPod" /dev/sda2


If all goes well, you can force your iPod to reset by holding down the menu and play buttons together for 5 seconds. For 4G and the iPod Mini, you can hold down the menu button and the select button, until the Apple logo shows. With a little luck, your iPod should fire up and bring you to the menu. If something went wrong, don't worry too much, as you can always recreate the partitions and copy the firmware back on.

Getting started

So, now you want to put some music on this sucka :P Plug it in again, and Edit /etc/fstab and add an entry for the iPod as the following:

/dev/sda2    /mnt/ipod   vfat    noauto,user,rw     0 0

NOTE: With newer distro's (running Gnome 2.10+) the gnome-volume-manager should be able to automatically mount your iPod when you plug it in, thanks to HAL and DBUS. With Gnome 2.12, it will even allow you to specify an application to execute when you plug in an iPod. Therefore, it shouldn't be necessary to mess around with the fstab any more.

Create the /mnt/ipod directory (as root):

mkdir /mnt/ipod


Mount the iPod (fingers crossed)

mount /mnt/ipod


Some things to remember when using your iPod in Linux...

With the new kernel 2.6, SBP2 support works much better than in the 2.4 series. You're not required to remove the sbp2 module when unmounting your iPod. With many new distro's (e.g. Fedora Core 3, Ubuntu and others) they have udev and hal set up to automatically mount your iPod once connected. In Gentoo, I put the following line in /etc/udev/rules.d/50-udev.rules to have the iPod always symlink to /dev/ipod

BUS="scsi",     SYSFS{model}="iPod",    KERNEL="sd?2",  NAME="%k",      SYMLINK="ipod"
    

Then, you can install the latest version of GTKPod, and start coping some music onto your iPod. Once finished, you can just unmount the iPod and pull it off the dock, unless you really want to see the disconnection message on your iPod. If so, you can probably use something like

eject /dev/sda


which should give you the big tick.

Sync'ing your Music

Using Rhythmbox and Banshee makes sync'ing your iPod an easy experience. Basically a drag and drop affair. GtkPod isn't quite so friendly, but it gives you a lot of options.


Sync your contacts and calendar

Using MultiSync, I was able to sync my contacts and calendar with Ximian Evolution. I think this is really cool. I was already using MultiSync to sync my contacts and calendar with my Sony Ericcson T610 mobile phone, and I was toying with the idea of making an iPod plugin for it. By simply using the backup plugin, standard with MultiSync, you can basically export all your data to a folder. This folder just happens to be on your iPod. So, when you have your iPod mounted, MultiSync (while checking every X minutes) basically exports all your data in either iCal format (for calendar stuff) or vCard (for contacts) which is right format for the iPod.

By creating two seperate sync pairs, one for the calendar/todo list and one for the contacts to only backup their respective data, you can "backup" the contents of these to the iPod's directories. E.g. /media/ipod/Contacts and /media/ipod/Calendar.


This page was last modified 02:02, 2 January 2007. This page has been accessed 13,311 times.

MediaWiki