An iPod system for Linux - Part 4 - Mounting the Ipod

13 October 2006

In previous posts, we discussed the ipod, and decided to replicate the functions of iTunes in Linux. We then started by looking at how to extract songs from CDs and how to manage our song library.

To get the iPod up and running in Linux, you will need to set your system up to mount the iPod.

FAT or HFS+

The early iPods had two versions, a version for Macs and a version for Windows. The more recent iPods are capable of swinging both ways as it were. The iTunes software formats the iPod as FAT if you are on Windows or HFS+ if you are on Mac.

What about Linux? Well you can go both ways. My iPod Nano came formatted for Mac, however I found that my Linux computers were a bit too conservative and would not let gtkpod write to the HFS+ iPod. So I opened the iPod in iTunes for Windows and it reformatted it as FAT, after that I had no more problems.

If like me, you use Linux as your main operating system then go for FAT, it will be a lot less pain, trust me, at least until all the HFS+ support in Linux is less flakey. Also if you find yourself on holiday at a Windows PC Internet Cafe then you can use it since it is FAT, an HFS+ iPod will never work in Windows (as far as I know).

Setting up fstab

You need to set up your /etc/fstab file to recognise your iPod. Use fdisk -l to find out what your ipod is called, on my system it is /dev/sdb, yours may say /dev/sda or something else.

Note that if your iPod is HFS+ then fdisk will not be able to read the table, gparted can however, so you can use that if you really want to look closely at the disk.

For a FAT iPod, you can use the line below, change the first bit according to what your drive was called. On FAT, the important partition is the second one.

/dev/sdb2 /mnt/ipod vfat rw,user,noauto,noatime 0 0

For HFS+ you need to do something like the line below. On HFS+, the important partition is the third one. Note, you need to have the correct kernel support for HFS+.

/dev/sdb3 /mnt/ipod hfsplus rw,user,noauto,exec 0 0

Now when you stick the iPod into your system it will mount automatically!

Setting up fstab

You need to set up your /etc/fstab file to recognise your iPod. Use fdisk -l to find out what your ipod is called, on my system it is /dev/sdb, yours may say /dev/sda or something else.

For a FAT iPod, you can use the line below, change the first bit according to what your drive was called. On FAT, the important partition is the second one.

/dev/sdb2 /mnt/ipod vfat rw,user,noauto,noatime 0 0

For HFS+ you need to do something like the line below. On HFS+, the important partition is the third one. Note, you need to have the correct kernel support for HFS+.

/dev/sdb3 /mnt/ipod hfsplus rw,user,noauto,exec 0 0

Now when you stick the iPod into your system it will mount automatically!

Backing up your iPod

If your iPod is a virgin iPod then you could ignore this, but if you have lots of songs already on there then you might want to back it up at this point (and from time to time), especially if you are going to be experimental.

Therefore the most important directory is:

/mnt/ipod/iPod_Control/iTunes/

If the Ipod has never been used then it will have just have an empty file (i.e. a touched file) called 'firstime' there.

If the Ipod has been connected to iTunes then it will have some files there, back them up onto your computer. If something funny happens later then you can copy the files back.

What do you have to say?

Show Editing Help

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Zeth

November 29, 2009
Hi Jordan, yes that URL is gone now. I have a new contact form on this site.
Python CGI contact forms

Jordan

November 29, 2009
Zeth attention! Your form, http://zeth.me.uk/contact/, is not working The explorer says connecting ..but nothing happens Sorry for my poor English: I am Spanish Regards
Python CGI contact forms

Jordan

November 26, 2009
Sorry: tell me , not tellme (I'm spaniard) And http://zeth.me.uk/contact/ don't work
You got the touch, you got the power

David Jones

November 25, 2009
Your mad skillz are too l33t! for me. I specifically switched to Google Reader so that I could show people what blogs I read. But I couldn't work out how ...
How to find the fashionable blogs quickly

Brian R. Hickey

November 20, 2009
Symantec picked it up too.
How to bring down Internet Explorer with six words

Zeth

November 17, 2009
Thanks djm, I am the moose here. Christian, assuming one actually does Internationalise the countries, it should still work I guess, as the gettext stuff will happen before the list ...
Countries in Django

Phillip Temple

November 17, 2009
Good start, but: a) wouldn't I want None back rather than 'ZZ'? b) why not add a 'shortcut' boolean, then prepend flagged fields (plus usual '-----' separator) to the actual ...
Countries in Django

djm

November 17, 2009
Am I being a moose or did you mean: from whatever.countries import CountryField instead of from whatever.countries import CharField ? Good post though, cheers.
Countries in Django

Christian Joergensen

November 17, 2009
Wouldn't the ordering get messed up after i18n?
Countries in Django

Steve - Electronic Cigarettes Fan

November 17, 2009
Very well done. Is your blog just you writing? Nicely done, Steven.
Blogger vs Wordpress

vetetix

November 15, 2009
Sorry to bother you nearly two years after you wrote this blog article, but I can't manage to find how to modify an existing field. I am trying to change ...
Three Useful Python Bindings - ClamAV, Apt and Evolution

Manju

November 4, 2009
I am transferring some files using psftp to other device's FAT partition. But the filestamp of the file being transferred is modified to that of FAT device, after the transfer. ...
PuTTY Series: Using PSFTP

iki

November 2, 2009
or simpler: socket.gethostbyname_ex(socket.gethostname())[2]
How to find out your IP address in Python

iki

November 2, 2009
local_ip = set([ i[4][0] for i in socket.getaddrinfo(socket.gethostname(), None) if i[0] == 2 ])
How to find out your IP address in Python

Fred

November 2, 2009
testing rst ------------- - point 1
An Introduction to ReStructuredText

Ano

October 27, 2009
"You simply found the license of the StumbleUpon Toolbar for Internet Explorer." That's possible. I've got some more interesting information to add. Firstly, go to this page: https://addons.mozilla.org/en-US/firefox/addon/138 - this ...
Are your Firefox extensions proprietary software?

Ken

October 21, 2009
Stumbled in here at lunch. This is the best find of the week. Thanks.
Three classic command line tips

Jim

October 19, 2009
Thanks for the rtsp:// post - that's something that has been bugging me for a while!
Three classic command line tips

Zeth

October 18, 2009
Thanks for the comments guys. Great to see the all the gang are still here!
Three classic command line tips

Bubba

October 18, 2009
Is there any way psftp can return the true transfer rates oberved during the actual transfer?
PuTTY Series: Using PSFTP