Linux on iPod Project

Home

Screen Shots

Documentation

Download

Forums

Support & Help

Project Sponsors

FAQ's

Legal

Linux on iPod at SourceForge.

SourceForge.net Logo

Linux on iPod - Partitioning

The iPods are partitioned as either Win-iPods or Mac-iPods, the difference being that the Win versions use a FAT32 partition and the Mac versions HFS+ to store the music. From a technical perspective the two versions look something like:

   [FAT32]
   hda1 Firmware partition
   hda2 Music partition (FAT32)

   [HFS+]
   hda1 Partition map
   hda2 Firmware partition
   hda3 Music partition (HFS+)

In order to run Linux on your iPod you need a suitable root partition where the Linux operating system (not the kernel) can be stored. There are basically two possibilities either use use the Music partition, or create a new partition specifically for Linux.

For Win-iPods if you use the music partition you will be using the UMSDOS filesystem for the root partition. This works fine under 2.4 but it looks like it won't be in 2.6. Furthermore, the standard kernel configuration (and the binary releases) don't have UMSDOS support and expect the root filesystem to be on hda3 so repartitioning is required to use that version.

For Mac-iPods the HFS+ partition wlil work fine as a root partition so no repartition is required.

If however you want a native Linux partition to use with uClinux the rest of this document shows you how!

Re-partitioning the iPod

Please be aware, this has not been widely tested. Please don't skip the backup steps. Feedback on this process would be greatly appreciated!

This process is currently for Win-iPods. If someone tries this with a Mac-iPod please let me know the changes required!

In this process we will split the existing firmware partition into two partitions, the first will contain the firmware as it is now, the second will be our new root partition. This process will resize the firmware partition to 8MB and create a new 32MB EXT3 partition.

The text in bold is typed in.

  1. Plug in your iPod but don't mount it. It should show up as /dev/sda. E.g. for a 3g iPod;
    # fdisk -l /dev/sda
    Disk /dev/sda: 20.0 GB, 20000268288 bytes
    255 heads, 63 sectors/track, 2431 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/sda1   *         1         5     40131    0  Empty
    /dev/sda2   *         6      2431  19486845    b  Win95 FAT32
    
  2. Backup the MBR (Mast Boot Record).
    # dd if=/dev/sda of=mbr.backup bs=512 count=1
  3. Backup the firmware partition, replace x with something meaningful.
    # dd if=/dev/sda1 of=firmware_x.backup
  4. Start fdisk.
    # fdisk /dev/sda
    The number of cylinders for this disk is set to 2431.
    There is nothing wrong with that, but this is larger than 1024,
    and could in certain setups cause problems with:
    1) software that runs at boot time (e.g., old versions of LILO)
    2) booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)

    Command (m for help):
  5. Delete the firmware partition.
    Command (m for help): d
    Partition number (1-4): 1
  6. Create a new primary partition with a length of 1 cylinder.
    Command (m for help): n
    Command action
    e extended
    p primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-2431, default 1): 1
    Last cylinder or +size or +sizeM or +sizeK (1-5, default 5): 1
  7. Activate the first partition.
    Command (m for help): a
    Partition number (1-4): 1
  8. Set partition type to 'Empty'.
    Command (m for help): t
    Partition number (1-4): 1
    Hex code (type L to list codes): 0
  9. Create the 3rd primary partition from 2nd to 5th Cylinder.
    Command (m for help): n
    Command action
    e extended
    p primary partition (1-4)
    p
    Partition number (1-4): 3
    First cylinder (1-2431, default 1): 2
    Last cylinder or +size or +sizeM or +sizeK (1-5, default 5): 5
  10. Review the changes. Note, this is for a 20GB verison, the sda2 partition size will vary.
    Command (m for help): p
    Disk /dev/sda: 20.0 GB, 20000268288 bytes
    255 heads, 63 sectors/track, 2431 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/sda1   *         1         1      8001    0  Empty
    /dev/sda2   *         6      2431  19486845    b  Win95 FAT32
    /dev/sda3             2         5     32130   83  Linux
    
    Partition table entries are not in disk order
    	
  11. If everything looks ok, write out the partition table.
    Command (m for help): w
  12. fdisk will now exit and we can create the new filesystem.
    # mke2fs -j /dev/sda3
  13. Optionally, you may like to set the maximal mount count to never.
    # tune2fs -c 0 /dev/sda3
    tune2fs 1.34 (25-Jul-2003)
    Setting maximal mount count to -1
  14. Install the root filesystem to /dev/sda3 and the kernel to /dev/sda1.

Acknowledgements

This document is based on the fine work by Daniel Palffy!