Dec 222009

So in the interests of science (ok, I wanted a new toy with a large amount of storage for music), I bought a pre-upgraded iPod 5.5 with a 240Gbyte hard disk in it. Loaded up Rockbox as soon as it arrived with the special version for upgraded iPods and everything was working …

Well … sort of. I could copy most of my music onto it, but nothing with a filename that broke the rules of pure FAT … no long extensions (so no FLAC files!!), no UTF-8 filenames (and “f#a#oo” isn’t quite a catchy a name as “f♯a♯∞”). So I rebuild the filesystem with the standard Linux tool mkfs.vfat

Bad move! Whilst all the files now copied onto the iPod, the Rockbox bootloader was now unable to load the main rockbox binary (“rockbox.ipod”). Seems that Rockbox’s idea of FAT32 on large disks isn’t quite the same as Linux’s version (or to be fair OSX either). So I spend ages hunting around to see how to create an appropriate filesystem on the iPod to allow things to work, without success.

Thus this page.

First of all, connect up the iPod and determine what device it is (mine showed up as /dev/sdh). The command fdisk -l is quite helpful here particularly as we use that next.

Once you find the iPod’s device, use that to display the partition table using fdisk :-

# fdisk /dev/sdh
# fdisk /dev/sdh
Note: sector size is 2048 (not 512)

The number of cylinders for this disk is set to 22506.
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): p

Disk /dev/sdh: 240.1 GB, 240057409536 bytes
84 heads, 62 sectors/track, 22506 cylinders
Units = cylinders of 5208 * 2048 = 10665984 bytes
Disk identifier: 0x20202020

 Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1          13      128394    0  Empty
Partition 1 does not end on cylinder boundary.
/dev/sdh2              13       22507   234302542    b  W95 FAT32

Command (m for help): q

Here we use the “p” command to list the partition table, and “q” to quit. The key bit of information we are looking for are the number of cylinders, heads and sectors per track (22506, 84, 62). For the number of cylinders, we need to subtract the number of cylinders used by the first partition … or perhaps easier the value of the cylinder that the second partition starts on (13). This gives the values we use for mformat to format the filesystem.

Next we need to create a “drive letter” (!! – why doesn’t mtools allow you to specify a device to work with in the proper Unix fashion?) by editing /etc/mtools.conf and adding a line at the end like “drive z: file=”/dev/sdh2″”.

Finally we need to use mformat to create the filesystem :-

mformat -t 22493 -h 84 -n 62 -S 4 -M 2048 -F -v FATBOX -N deadcafe z:

The “-v” and “-N” options are unnecessary, but at least the “-v” option is kind of handy to allow the iPod to be automatically mounted in an appropriate place. And I usually take every opportunity to assign some funky hex value 🙂

WP2Social Auto Publish Powered By :