All opinions are my own, my company wants no part of them.

Partitioning the iPod

August 27, 2004 - 12:54am

No, this isn’t about using Disk Utility to partition it and break it, this is about partitioning it and keeping the iPod’s functionality intact. Useful for those with 40GB of iPod and 25GB of music…

It goes without saying this is not something Apple intended a music player for, so if you break your toy you’re on your own. Apple’s iPod Firmware Updater program can usually restore the iPod back to its former self but reader beware: you may kill your little friend in the process. You have been warned, and since this is merely an educational guide I will take absolutely no responsibility if this fails to work for you even if you follow the directions perfectly.

Step One – Backup

I don’t want to play with iPod Firmware programs or having to send this beast back to Apple after breaking it, so we’re going to make a good backup of the things we need to beforehand. There are two partitions on the iPod: the first is for the firmware, the second for the music. We’ll need a backup of both.

Locate the iPod — disktool

First, you need to discover which disk the iPod is, so do this:


[ codepoet@europa ] $ disktool -l ***Disk Appeared (‘disk2s1’,Mountpoint = ‘’, fsType = ‘’, volName = ‘’) ***Disk Appeared (‘disk2s2’,Mountpoint = ‘’, fsType = ‘’, volName = ‘’) ***Disk Appeared (‘disk2’,Mountpoint = ‘’, fsType = ‘’, volName = ‘’) ***Disk Appeared (‘disk2s3’,Mountpoint = ‘/Volumes/Ganymede’, fsType = ‘hfs’, volName = ‘Ganymede’)

The iPod’s on disk 2.

Partition Map — pdisk

We’ll need to know where which partitions are and their sizes if we are to do a proper restore should the time come, so run the following:


[ codepoet@europa ] $ pdisk /dev/disk2 -dump
/dev/disk2 map block size=512 #: type name length base ( size ) 1: Apple_partition_map partition map 62 1 2: Apple_MDFW firmware 65536 63 ( 32.0M) 3: Apple_HFS disk 78060448 @ 65599 ( 37.2G)

Device block size=512, Number of Blocks=78126040
DeviceType=0×0, DeviceId=0×0

Save the output of your iPod in a safe place.

Firmware — dd

We’ll make a file that contains a binary disk image of the firmware partition on the iPod so that should we do anything crazy we can restore the iPod back to where it was.


[codepoet@europa] $ dd if=/dev/disk2s2 of=iPodFirmware.dd

To restore, switch the arguments to if and of.

Data — ditto

To backup the disk of the iPod we’ll use ditto to make a copy into a folder on the local drive. This works best when you have little to no music on the iPod. You can clear out the iPod quickly by moving it to playlist mode in iTunes and selecting no playlists or moving to manual mode and selecting all songs and deleting them.

You’ll want to trim your iPod’s music down unless you want to spend several dozen minutes copying music back to your Mac that’s already on your Mac.


[codepoet@europa ] $ mkdir iPod\ Backup
[ codepoet@europa ] $ sudo ditto -rsrc /Volumes/Ganymede iPod\ Backup
Password:
[codepoet@europa ] $ ls -l iPod\ Backup/
total 80
drwxr-xr-x 2 root unknown 68 17 Aug 2008 Calendars
drwxr-xr-x 4 root unknown 136 23 Aug 2008 Contacts
-rw-r—r— 1 root unknown 0 23 Aug 10:08 Icon?
drwxr-xr-x 3 root unknown 102 23 Aug 2008 Notes
drwxrwxrwx 6 root unknown 204 23 Aug 10:08 iPod_Control

I ran it as root because I know ditto will keep certain things as root it could not otherwise (i.e. ownership). I do not believe it’s strictly needed but I dislike taking chances. The iPod Backup folder now holds the data from the iPod.

Step Two – Partition

The trick here is that iPod’s firmware is stored on the disk, so you can’t just partition it with Disk Utility as it won’t put the firmware on there. This is why the iPod dies if you do it that way; it has no OS. But there’s a few utilities right in Mac OS X that will help with this.

Partition Table — pdisk

Now we get to the fun part: partitions. We know that the iPod, in my case, is on disk2, so let’s take a look at it in pdisk:


[ codepoet@europa ] $ pdisk
Top level command (? for help): l
Name of device: /dev/disk2
/dev/disk2 map block size=512 #: type name length base ( size ) 1: Apple_partition_map partition map 62 1 2: Apple_MDFW firmware 65536 63 ( 32.0M) 3: Apple_HFS disk 78060448 @ 65599 ( 37.2G)

Device block size=512, Number of Blocks=78126040
DeviceType=0×0, DeviceId=0×0

I have about 26GB of music, so a 30GB partition should be more than enough, especially when I remove the crap I never listen to. Laughing out loud First, do the following in Terminal:

If you do this in the Finder or iTunes the iPod will exit disk mode and you will not be able to proceed.


[ codepoet@europa ] $ sudo umount /Volumes/Ganymede/
[ codepoet@europa ] $ disktool -r
Refreshing Disk Arbitration …

Then back in pdisk, choose ‘e’ for edit and specify the location of the iPod.


[ codepoet@Europa ] $ pdisk
Top level command (? for help): e /dev/disk2
/dev/disk2

We’re editing the iPod’s map now. Press ‘p’ to print it out and make sure we’re on the right disk.


Command (? for help): p
/dev/disk2 map block size=512 #: type name length base ( size ) 1: Apple_partition_map partition map 62 1 2: Apple_MDFW firmware 65536 63 ( 32.0M) 3: Apple_HFS disk 78060448 @ 65599 ( 37.2G)

Device block size=512, Number of Blocks=78126040
DeviceType=0×0, DeviceId=0×0

Looks good. You have a backup of the disk, right? You’ll need it because you’ll need to restore it after this. Delete the main disk.


Command (? for help): d3
Command (? for help): p
/dev/disk2 map block size=512 #: type name length base ( size ) 1: Apple_partition_map Apple 62 1 2: Apple_MDFW firmware 65536 63 ( 32.0M) 3: Apple_Free Extra 78060448 @ 65599 ( 37.2G)

Device block size=512, Number of Blocks=78126040
DeviceType=0×0, DeviceId=0×0

Now create a smaller disk. The formula for length is:

size in MB * 1024 * 1024 * 2 = sector/block count

So if you wanted a 30 GB disk:

30 * 1024 * 1024 * 2 = 62914560


Command (? for help): c
First block: 65600
Length in blocks: 62914560
Name of partition: disk
Command (? for help): p
/dev/disk2 map block size=512 #: type name length base ( size ) 1: Apple_partition_map Apple 62 1 2: Apple_MDFW firmware 65536 63 ( 32.0M) 3: Apple_HFS disk 62914560 65599 ( 30.0G) 4: Apple_Free Extra 15145880 62980160 ( 7.2G)

Device block size=512, Number of Blocks=78126040
DeviceType=0×0, DeviceId=0×0

Now write the table out by pressing ‘w’ and return. Then quit pdisk.


Command (? for help): w
Writing the map destroys what was there before. Is that okay? [n/y]: y
The partition table has been altered!

Command (? for help): q
Top level command (? for help): q
The end

Then erase that partition in Disk Utility so it has a good filesystem on it (or use newfs). Now copy that backup back to the disk so that iTunes can sync with it.


[ codepoet@europa ] $ sudo ditto -rsrc iPod\ Backup /Volumes/Ganymede
Password:

To get a second partition you can repeat the partition creating step for the remaining space … or boot a Linux CD and have at it like I did. Eye

Yes, I installed Linux on my iPod. I’m that pathetic. The secret for the bootloader is that it will always be disk2 as long as no other disks are present (disk0 = hard drive, disk1 = CD). But then my music collection grew and I remembered why I don’t use Linux anymore, so I trashed all this and put more music on the iPod. Laughing out loud

Hell, we all know the answer: Because I Could™.

“Psychoanalysis is a science conducted by lunatics for lunatics. They are generally concerned with proving that people are irresponsible; and they certainly succeed in proving that some people are.” — ILN, 6/23/28 – G. K. Chesterton

Syndicate content