Just an FYI that this process didn't work for me on a 3G ipod running firmware version 2.2.
Everything worked until I tried to dd the firmware back to partition 1. During that, I got a "device out of space" error.
The bad thing is that, since the firmware wasn't there, the ipod wouldn't boot--just hung at the apple logo screen forever. I ended up popping it into the dock and putting it into forced-firewire mode, and using "iPod Restore" from my wife's mac.
Now, looking in more detail...
Sure enough, looking at the firmware file vs. partition size, the firmware file is slightly larger than the partition.
Backing up the firmware:
Code:
root@grenoble:~/ipod# dd if=/dev/sda2 of=backup_firmware
65536+0 records in
65536+0 records out
33554432 bytes transferred in 32.646649 seconds (1027806 bytes/sec)
Creating the 1st partition:
Code:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19073, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19073, default 19073): +33M
Writing the firmware back to the partition:
Code:
root@grenoble:~/ipod# dd if=backup_firmware of=/dev/sda1
dd: writing to `/dev/sda1': No space left on device
65505+0 records in
65504+0 records out
33538048 bytes transferred in 83.290233 seconds (402665 bytes/sec)
Size of backup firmware file:
Code:
root@grenoble:~/ipod# ls -l backup_firmware
-rw-r--r-- 1 root root 33554432 2005-01-30 10:19 backup_firmware
I'm not hip to all nuances of fdisk, so maybe there's an easy way around this. But, no matter what I seemed to try to do to get a partition sized appropriately for the size listed of the firmware, I couldn't convince fdisk to do it. FWIW, fdisk version is 2.12.