Skip to content

Instantly share code, notes, and snippets.

@DavidBuchanan314
Last active January 21, 2024 04:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBuchanan314/9457d3f35fbe314b634563ab641a84bf to your computer and use it in GitHub Desktop.
Save DavidBuchanan314/9457d3f35fbe314b634563ab641a84bf to your computer and use it in GitHub Desktop.
Classic iPod software reinstall/restore without iTunes, on Linux

iTunes-less Classic iPod Restore Guide

I have tested this on a classic 4th-gen monochrome "clickwheel" iPod. I imagine this process works similarly for iPods of the same era. I'm not the first person to do this, but a lot of documentation is on dead wikis and is generally hard to come by.

Extract your firmware image from an .ipsw file, set the IPOD and FW_IMAGE variables in the bash script, and run it as root. Then cross your fingers.

If everything worked, the partition layout should look something like this:

Disk /dev/sdc: 119.08 GiB, 127865454080 bytes, 249737215 sectors
Disk model: iPod            
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x852a72c7

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdc1        2048     82309     80262 39.2M  0 Empty
/dev/sdc2       83968 249737214 249653247  119G  b W95 FAT32
#!/bin/bash
# update to match your ipod!
IPOD="/dev/sda_EDIT_ME"
# You can extract the firmware binary from .ipsw files (they're just zips)
# I got mine from https://iosindex.com
FW_IMAGE="./ipsws/Firmware-10.3.1.1"
# Shouldn't be necessary, but we're gonna zero the MBR first just to make sure we get a nice fresh one.
dd if=/dev/zero of="$IPOD" bs=512 count=1
sync
# https://superuser.com/a/984637/643697
# to create the partitions programatically (rather than manually)
# we're going to simulate the manual input to fdisk
# The sed script strips off all the comments so that we can
# document what we're doing in-line with the actual commands
# Note that a blank line (commented as "defualt" will send a empty
# line terminated with a newline to take the fdisk default.
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk $IPOD
o # clear the in memory partition table
n # new partition
p # primary partition
1 # partition number 1
# default - start at beginning of disk
+80261 # 80262 sectors (same size as what itunes creates)
t
0 # set type to "0"
n # new partition
p # primary partition
2 # partion number 2
# default, start immediately after preceding partition
# default, extend partition to end of disk
t
2
0b # set type to FAT32
p # print the in-memory partition table
w # write the partition table
q # and we're done
EOF
# just making sure the writes propagate
sync
sleep 1
# Make the FAT32 fs
mkfs.fat -F32 "$IPOD"2
# Write the firmware binary
dd if="$FW_IMAGE" of="$IPOD"1
# Apply writes
sync
# eject drive (triggers ipod reboot, disconnecting should have the same effect)
eject "$IPOD"
echo "Now connect your iPod to a wall charger to complete the restore process."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment