Connecting an iPod to a Linux box
September 9, 2005 2:10 PM   Subscribe

Can a Mac-formatted iPod and a Linux box play nicely together?

My home machine: a Mac running OSX 10.3.
My work machine: a Linux box running SuSE Linux 9.2, and (usually) KDE 3.3, to which I do not have root access.
My toy: a fourth-generation 40 GB iPod.
My dream: to be able to plug my iPod into the USB port on my work computer, mount it as an external hard drive (essentially), and listen to my MP3s via the computer's sound system. (Having headphones in all day is kind of antisocial, and is uncomfortable to boot.)

Is this at all feasible? I'm something of a Linux tyro, so be gentle in explaining how to go about it (or explaining to me why it can't be done.)

I tried Googling on "Linux iPod", but this returned umpteen pages on how to install Linux on your iPod. Not what I'm after -- I just want to be able to access the files via Linux.
posted by Johnny Assay to Computers & Internet (10 answers total)
The Linux distro. in question would have to have the HFS+ file system kernel module compiled already (since you don't have root). And apparently support for Mac-style partitions compiled as well. I don't know if the Suse kernel will have those by default, but it might. Lots of distros give you a "kitchen sink" kernel. (Do you know how to find out if you have those? If not, I can help).

If no one that responds knows exactly, search on Google for "linux mount hfs ipod." That led me pretty quickly to these two which seem to be heading in the right direction.
posted by teece at 2:37 PM on September 9, 2005

It all comes down to the file system on the iPod.

A file system is basically how the actually underlying file data are structured on a given disk. There are many different file systems out there, each tuned to various purposes and operating systems and features.

Likewise, there are many software drivers available for different operating systems which provide support for interacting with the file system of a hard drive, so that you can do things you expect to do, like reading/opening/closing/deleting/renaming/organizing files.

Out of the box, Mac OS X will read from and write to HFS+, HFS, UFS, FAT16 and FAT32 volumes. It will also read from NTFS volumes. It will not read (out of the box) Linux file systems.

I don't think there is an HFS+ driver for Linux. This document explains what HFS is and provides links for drivers to read HFS from a Linux workstation.

Your best bet is to reformat the iPod as a "Windows" or FAT32-formatted iPod. You can then read and write files on the iPod on Windows, Linux and OS X.
posted by Rothko at 2:38 PM on September 9, 2005

If you don't have root on your work box I'm afraid you're probablyout of luck, as far as I know. Most Linux setups will not have drivers for the Mac filesystem used on a Mac-formatted iPod, so they won't be able as we say "mount" it as a drive.

If you speak nicely to whoever looks after your work machine, he or she may install kernel modules for the HFS+ filesystem used by your iPod. This also assumes that your Linux is reasonably recent, I don't think proper HFS+ support came in before 2.6.8. You need to be root to install new kernel modules, so that's your first problem there.

Once you have HFS+ installed, the iPod will show up as a USB drive, and you can then use a client like gtkpod to sync and play from it.

I'll testify to gtkpod being usable, but I have a FAT32 Windows-formatted iPod so I can't confirm that my suggestions above will work with HFS+ from personal experience. However judging frmo this page it should work just fine.

Good googleage results from including "Mac" and "HFS+" in your search.
posted by i_am_joe's_spleen at 2:42 PM on September 9, 2005

Your best bet is to reformat the iPod as a "Windows" or FAT32-formatted iPod.

Do you lose any Mac functionality doing it this way?
posted by ernie at 2:45 PM on September 9, 2005

That was a terrible explanation.

You will need:
- a recent Linux installation (kernel 2.6.8 or newer)
- a friendly system administrator

Ask the sysadmin to install HFS+ if not already present.

Ask your sysadmin to configure udev correctly so the iPod will show up as a USB or Firewire disk (some distros such as Ubuntu are preconfigured to behave properly so this may not be necessary).

Provide chocolate or other reward to admin.

Plug in iPod, fire up gtkpod, enjoy.

Don't forget to back up your music on your home machine in case of terrible disaster.
posted by i_am_joe's_spleen at 2:46 PM on September 9, 2005

For whatever reason, when I compiled my kernel on 8 Jul. 2004, I included HFS+ support. So just plugged my iPod into it (after loading the module with "sudo modprobe hfsplus"). This is 2.6.7 (yeah, I need to upgrade it).

I then typed "sudo mount -t hfsplus /dev/sda /mnt" and the iPod mounted fine. After it is mounted, you can use it just like any other disk.

Other than the fact that you don't have root access, then, yes this is entirely possible. Note, though, without using something like gtkpod or whatever, you're going to find that the way the music is organized on the iPod is REALLY annoying.

(It's under a directory called iPod_Control/Music in a bunch of folders named FXX, where XX is a number from 00 to 49 on my iPod, and there seems to be no easily discernible order. IOW, it's meant to be a machine-readable database).
posted by teece at 3:11 PM on September 9, 2005

I forgot to add: not having root is not necessarily a deal breaker. If, by dumb luck hfsplus is compiled (which is a possibility, as Suse 9.2 seems to have 2.6.8 by default, and most default kernels have a whole boat-load of modules compiled), then the module *might* be set up to load automatically without root privileges needed.

But it is unlikely that there is an entry in /etc/fstab which will allow a non-root user to mount the USB mass storage device (and I'd recommend using the USB cable, as the firewire one is just going to add more modules to the mix that might not be there, whereas USB is almost certainly already there).

So I suspect that you may need to ask whoever has root to modify /etc/fstab in the best case, or compile a bunch of modules and do that, too, in the worst case. Either way, you probably also need to be able to install some software like gtkpod, but you should be able to do that in a user directory (although it won't necessarily be easy if you're not comfortable with compiling source applications). Linux is fun ;-)
posted by teece at 3:26 PM on September 9, 2005

Thanks for the answers so far, everyone. We're kind of between sysadmins right now (long story), so getting the modules installed (should it be necessary) might not be a near-term option. We shall see; and I won't be too choked up if it can't be

Teece: could you elaborate on how I would check to see if HFS+ is already installed on this machine? It wouldn't surprise me if the previous sysadmin included it, since he was generally an "everything plus the kitchen sink" kind of guy.

Oh, and thanks for the software recommendation. I've compiled source applications before, so I should be able to do that with a minimum of fuss and/or muss.
posted by Johnny Assay at 4:14 PM on September 9, 2005

To check if you have the hfsplus module, first type 'uname -r' at a terminal. That will tell you the revision of your kernel that is currently running. It's the name of the folder you need, also.

Then, check in /lib/modules/[kernel_revision]/kernel/fs/

If there is a directory in there called 'hfsplus' with a file called 'hfsplus.ko' then you have the module already. If not, it needs to be compiled. If it's there, it might load automatically if you try and mount a filesystem of that type.

Once that module is in place, you just need the ability to mount the device. This can be done by a regular user, but root has to set it up that way. If '/etc/fstab' already has a line like

/dev/sda /mnt_point auto defaults,user

then you would be good to go. If not, you would need to have one added. Note: the letter 'a' in 'sda' might change, depending upon how many USB mass storage devices are plugged in, and in what order. You might need to change 'auto' to 'hfsplus', as auto-recognition of filesystem type does not always work.

Also: I use Debian. I think all these paths are the same on Suse, but it's been a long time since I used it, and Yast might have some other method of doing this stuff.
posted by teece at 5:23 PM on September 9, 2005

Looks like the modules are there, but there's not an appropriate entry in fstab. I'll see if I can get someone to add it on Monday.

Thanks, everyone!
posted by Johnny Assay at 8:44 PM on September 9, 2005

« Older Yes, I want to learn COBOL   |   Need good speakers for iPod Newer »
This thread is closed to new comments.