Looking for the layout spec of the iPod Master Boot Record

Hi,

I'm a developer of the free software GNU Parted and one of our user complained about Parted not being able to edit iPod partitions when using the windows format. After investigating, I discovered that the iPod Master Boot Record is an horrible mix of a faulty MBR (system partition 1 has ID 0...) and a faulty DBR (sector size is set to 2 bytes instead of 512 !!! because of incorrect endianness). Because true DBR looks like true MBR (same signature), Parted is configured to reject MBR that have some "FAT" has well known places because they would indeed be DBR... except on the new stupid mix Apple introduced where DBR are also MBR or the reverse.

So I'm looking for detailed specification of the boot sector used by iPods configured to have the windows format...

Thanks to anybody knowing about such technical stuffs.
(I would also thank apple staff if they managed to fix their mess, but I've no real hope 😝 )

Posted on Oct 4, 2005 4:00 PM

Reply
4 replies

Oct 5, 2005 7:47 AM in response to Guillaume Knispel

faulty MBR (system partition 1 has ID 0...)


What's wrong with that? ID 0 is used to designate an unused partition table entry, which prevents Windows from seeing that partition at all. Which is likely what is intended, as that partition contains the iPod system software itself.

and a faulty DBR (sector size is set to 2 bytes instead of 512 !!! because of incorrect endianness).


Call me stupid, but what's the difference between the DBR and the MBR? As for endianness, the iPod operates in a different endianness than the Windows machine does, so I suspect this "incorrect" endian issue is to allow the iPod to see the system partition in the correct way. Remember, the Windows machine only has to see the thing as a valid FAT32 partition, but the iPod actually has to boot from the thing.

Oct 6, 2005 6:08 AM in response to Guillaume Knispel

Obviously the "boot" record of the iPod (first sector of it's hard drive) is not used by the iPod firmware (but maybe to load its partition table), particularly the code is x86 code and I doubt there's an x86 chip in the iPod 🙂

This sector is used when you plug the iPod on a PC. The fact that the partition table is in PC format allows it to be able to use the partitions that are on the iPod. The x86 code probably just display an error message if you try to boot your PC using your iPod has an hard drive.

A DBR is the first sector of a FAT partition. I don't really know why apple merged a DBR with the MBR (I've a little idea, but it's quite useless in front of the problem this introduced, so I hope apple had a better reason to do that), but I do know that if there's endianness issue it's not because the iPod use a field but because of a mistake. The endianness of the DBR is well defined and changing it in just one field makes absolutely no sense. It break compatibility with other software reading the disk at this low level stage.

Using 0 has the ID is just stupid. It's true that 0 mean the partition entry is empty... but it ISN'T! Not really hard to understand that lying about the entry just to make it invisible to one particular brand of operating system doesn't makes any sense. Some partitioning tool will mistake the first partition has a truly empty entry (indeed they will not mistake, they will see it in the right way) and overwrite its content. Apple should just have used a non 0 ID and non FAT/NTFS ID. Windows would have shown it has a third party partition in its partition list and no logical drive would have appear.

So I am absolutly sure the layout is just stupid, and remember I do write a partition editing tool (which support many partition tables format like DVH / GPT / MSDOS / MAC / ...) so I know what i'm talking about. But that's not the point.

The point is either I find the exact layout (or deduce it from lots of first sectors from lots of iPod, the solution i'm currently considering), or because of the odd mix apple chose to do nobody will be able to do non destructive resizing of iPod partitions with a free software (which support FAT / HFS+, ...) if the iPod is windows formatted. And this tool might be useful for some people like those writing iPodLinux.

Oct 6, 2005 9:30 AM in response to Guillaume Knispel

Well, if it helps, the iPod Updater contains several firmware images for the iPod's. These are simply written to the iPod drive directly, so the first sector in these should match the first sector on the drive, more or less. I do know that there's some form of code in these images that causes it to reflash the iPod's flash rom on the first boot, and then the boot process changes itself to not do that anymore. I assume the partition table is also setup for that particular iPod at that particular time.

You can extract these images from the updater program with ResHacker or any simple Windows resource editor.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Looking for the layout spec of the iPod Master Boot Record

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.