James Porteous

Tuesday, 25 August 2009

How to repair / restore iPod firmware on linux

I have recently moved to linux and been pleased with the results. So pleased in fact that I decided to port my iPod over to an open-source OS, Rockbox.

The Rockbox OS has a lot of admirers but I found it fiddly, buggy and counter-intuitive. The simple matter that you can't simply select a 'shuffle' equivalent put paid to it for me.

But after uninstalling, I found my iPod buggy. There were clearly some remnants left of the Rockbox OS. I tried deleting everything I could find on the disk to no avail, so took the nuclear option of deleting the drive's partitions, figuring it would be easy to restore the original iPod firmware later. Nope.

Apple, helpfully, no longer supply individual firmware files: you must install iTunes. So I tried installing it in Wine. Nope.

A quick Google should provide the solution right? Nope. Nearly all the posts I found simply said, 'You're screwed, use a friend's Windows machine'.

That wasn't good enough. Eventually, after about two days' trying, I finally figured out what to do and was so pleased I decided to post about it to hopefully help other people.

First, go to this old but useful guide to see how to set up partitions on iPod. Ignore the stuff about HFS unless your iPod was originally formatted under Mac.

These are the relevant commands:

% fdisk /dev/sd*
n [make new partition]
p [primary]
1 [first partition]
[just press enter -- default first sector is 1]
5S [5 sectors -- big enough to hold 32MB]
[on 20GB models, Corrin Lakeland suggests using "+33MB" instead of 5S]

n [make new partition]
p [primary]
2 [second partition]
[just press enter -- default first sector is 6]
[just press enter -- default size uses all remaining space]

t [modify type]
1 [first partition]
0 [first partition has no filesystem; ignore warning]

t [modify type]
2 [second partition]
b [second partition is FAT32]

p [show partition map]

Device Boot Start End Blocks Id System
/dev/sd*1 1 5 40131 0 Empty
/dev/sd*2 6 3647 29254365 b Win95 FAT32

w [commit changes to disk]
* You need to know what the device name of your iPod is. Find out by 'sudo fdisk -l' without it attached then with it attached and note what was added. It will probably be sda, sdb, etc.

This creates two partitions on your iPod, sd*1 for the firmware and sd*2 for storage.

Then download the right firmware for your iPod from this site. Extract it somewhere convenient. Note the name of the firmware file.

To install the firmware type this command 'sudo dd if=FIRMWAREFILENAME of=/dev/sd*1.

BE 100% CERTAIN YOU TYPE THE RIGHT SD*1 NAME! For example, don't do what I did and try to install iPod firmware on your computer hard disk by accidentally typing 'sda1' instead of 'sdb1'. Unless you like reinstalling your operating system.

To format the storage partition type this command: 'mkfs.vfat -F 32 -n "ipod" /dev/sd*2.' This creates a vfat partition of F32 type named "ipod".

Unplug your iPod. Reboot if necessary. You should see a picture on the screen telling you to plug it back in. Do so - hopefully all should be fixed, it will automatically mount and Rhythmbox or whatever iTunes equivalent you use will recognise it. Then you can select 'initialise iPod' to create the directory structure.

Appendix - this site is also useful for editing fstab if your iPod does not automount.


12 comments:

James McLauchlan Johnston said...

Wow, you've totally geeked out!

mjp said...

I've been searching for exactly these instructions. Thank you!

Marco said...

"The simple matter that you can't simply select a 'shuffle' equivalent put paid to it for me."

Of course you can! All playback features on the ipod are by default available in rockbox (IIRC shuffle is under playback settings). Rockbox is great if not for the simple fact that you can drag and drop basically any type of media file into it and it will play. Of course, other syncing options are available, but ITunes isn't far off from slavery.

Otherwise, thanks for the guide. I formatted my IPOD for use as a usb device to install linux/windows on a laptop with a failing optical drive. Unfortunately I accidentally sacked my boot partition in the process.

contact said...

Fantastic!

I have just screwed my iPod Classic 1G and I couldn't restore it with iTunes on Windows - always getting the unknown error 1493.

With your instructions I got it working again. I used gparted to make the partitions. sd*1 had to be 100MB big as the recent firmware was 94MB big.

Thanks a lot, Thomas

Destined3 said...

these instructions were awsome. took a lil while to get my bearings on my linux mint system, but once i got it it, i got it.

my problem was that on a freinds ipod, it was completely bricked, just stuck on a permanant apple symbol. on my windows machine i kept getting the error 1439. when i investigated these errors, i got suggestions ranging from "change what usb port you plug into" to "re-register your dll's"

i found your instructions here, followed them, and it SAVED his ipod. the only problem i had was that the ipod told me i still needed to restore things through Itunes, but that worked fine, once i had followed all of your instructions.

many thanks. i wish i could send you a bit of the proceeds from this job, but i don't think they would let me send you a half pint of Jim Beam in the mail.

Rojer Fredrick said...

Excellent information provide for us...................
Dallas ipad Repair

Dirk Storck said...

Hi,

I have followed your advice and after I have seen thatpicture on the screen telling to plug it back in I seen "Do not disconect" on my iPod screen an in the upper left corner I see an rotating icon....How long should I wait on that screen? How long does it normaly take?

Thank you!

Dirk Storck said...

Don't know how long I should wait....
Thank you!

hira salman said...

Thank you so much sharing post I also share with you some tips hope you Instead of typing an email, tap the microphone icon on the keyboard and start talking. Tap Done, and your words will appear as text. Use dictation to write messages, take notes, update your Facebook status, tweet, and more.Iphone Repairs Melbourne

Smith Mosan said...

Nice one post I also share with you something hope you like it. After having dropped my iPhone 4 while in its case and finding out the screen was cracked i was determine to find a fix. Before when i had an iPod touch 2nd generation the screen was easily removed by taking out pins on the front of the screen, along with the iPhone 3 and 3gs the screen popped out after removing two screws. I assumed it would be as simple as that having done the procedure plenty of times for my friends broken gadgets.
Iphone Repairs

Carl U said...

Thank you very much! The filesystem corrupted on my 160GB iPod Classic and this guide just helped me get it back up and running without having to find a Mac or Windows PC.

Carl U said...
This comment has been removed by the author.