← Back to team overview

mactel-support team mailing list archive

[Bug 222126] Re: Partition Table is cleared during install on Intel Macs

 

I did some tests to provide data about this bug - failure of intel mac
MBR boot loaders to restart after ubuntu install.

Used:
Ubuntu parted partition editor in ubuntu 704 and 810.
MacBook2.1 with 80GB disk, assisted by a second external system and efi bootloader.

1. The /dev/sda sector0 and MBR was wiped to 00 leaving only the 55aa
msdos MBR disk signature.

MBR here meaning = the 4x16byte partition entries above 446 bytes.

# dd if=/dev/zero of=/dev/sda bs=510 count=1
# hexdump -Cn512 /dev/sda
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

2. Then using the 704 live cd -
 
 #  parted /dev/sda toggle 1 boot 
 This was done twice, no net effect, but causing a write to the disk MBR. 

 The MBR as 704 parted left it (there is a boot flag at 0x1ce on
partition#2, unexplained).

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 fe  |................|
000001c0  ff ff ee fe ff ff 01 00  00 00 27 40 06 00 80 fe  |..........'@....|
000001d0  ff ff af fe ff ff 28 40  06 00 30 a1 7e 02 00 fe  |......(@..0.~...|
000001e0  ff ff af fe ff ff 58 e1  88 02 08 20 ae 00 00 fe  |......X.... ....|
000001f0  ff ff 83 fe ff ff 60 01  37 03 de 0e e9 02 55 aa  |......`.7.....U.|
00000200

 gptsync reports "Status: Tables are synchronized, no need to sync."

 Ubuntu 704 installation can then boot on restart using MBR loaders without using gptsync (boot sector code below MBR partition data appeared later).
 ===================

3. Wipe the MBR again to check 810 parted (from xububtu810 on external
disk)

root@wdc:/home/pxw# hexdump -Cn512 /dev/sda
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200

root@wdc:/home/pxw# gptsync /dev/sda
reports Current MBR partition table:
 No partitions defined

Status: MBR table must be updated.

Offers to update, Not done. just checking its valid for gptsync, but
leave as is for test.

root@wdc:/home/pxw# parted
Then use 810 parted toggle operation to trigger write to disk.

This resets the sector0 mbr to one partition, full disk size, valid for gptsync,
and the same format found after initial partitioning by macosx10.4.8 diskutility.
 
root@wdc:/home/pxw# hexdump -Cn512 /dev/sda
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001c0  01 00 ee fe ff ff 01 00  00 00 af f8 50 09 00 00  |............P...|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200
(disk size shown here in 512byte sectors is 0x950F8AF = 156301487 =whole disk)

This requires running gptsync from the ubuntu refit package to create
full MBR partiton data to allow grub or windows loader to boot.

After running gptsync the MBR is updated ready for MBR booting.
root@wdc:/home/pxw# hexdump -Cn512 /dev/sda
(boot code appears before here)-----
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 fe  |................|
000001c0  ff ff ee fe ff ff 01 00  00 00 27 40 06 00 00 fe  |..........'@....|
000001d0  ff ff af fe ff ff 28 40  06 00 30 a1 7e 02 00 fe  |......(@..0.~...|
000001e0  ff ff af fe ff ff 58 e1  88 02 08 20 ae 00 80 fe  |......X.... ....|
000001f0  ff ff 83 fe ff ff 60 01  37 03 de 0e e9 02 55 aa  |......`.7.....U.|
00000200
======

Solution:

The refit package should be part of the installation, and a user option provided after partitioning to sync MBR for intel mac MBR loaders. (Not necessary for efi/gpt loaders).
This will improve the install/restart experience for intel apple mac users.
It will still be necessary to run gptsync after any re-partitioning.

But preferably revert to the previous partitioner version for apple
intel macs, unless there are good reasons not to do so.

(Full details in attachment)
======


** Attachment added: "bug222126.gz"
   http://launchpadlibrarian.net/19617439/bug222126.gz

-- 
Partition Table is cleared during install on Intel Macs
https://bugs.launchpad.net/bugs/222126
You received this bug notification because you are a member of Mactel
Support, which is the registrant for Mactel Support.

Status in grub-installer: New
Status in Mactel Support: Confirmed
Status in “parted” source package in Ubuntu: Confirmed
Status in “ubiquity” source package in Ubuntu: Confirmed

Bug description:
Binary package hint: ubiquity

Ubuntu 8.04 Final

Intel Macs have an EFI system and a GPT. The installer seems to handle the GPT correctly (as it has in the past), but it has recently come up that the installer is completely emptying the contents of the MBR partition table which is still required to boot Windows and Ubuntu (GRUB relies on the MBR partition table). The two tables are not synced automatically.

When users install Hardy, they are suprised to find that the system is unbootable (the EFI loader cannot "see" the partition as bootable). a tool such as rEFIt or gptsync can copy the information in the GPT into the MBR table thus fixing the issue (for most). 

This is even more serious for users with other working OS installs in addition to Ubuntu (such as other linux distros and Windows) since it completely dumps the information needed to boot these installs as well.

The expected procedure (and how the previous Ubuntu install seems to have handled it) is to 'update' both the GPT and the MBR table with changes instead of completely losing the information stored there.

gparted / parted seemed to update both tables properly previously as well.

I will be doing a full install on my iMac later and will be able to add additional information.



References