PDA

View Full Version : [ubuntu] 8.04 cleared the MBR partition table


billbear
April 25th, 2008, 02:24 AM
I was quad booting leopard/vista/ubuntu/xp on my macbook. Last month I replaced the internal HD with a larger one, and installed leopard/vista/xp, and left some unallocated space for ubuntu hardy. I installed 8.04 last night, and found vista/xp/ubuntu unable to boot. It erased the MBR table!
Apple uses a hybrid GPT/MBR partition table for multi-booting with 'legacy' OSes. Ubuntu understands GPT but grub doesn't. When creating new partitions (beyond the first four) on a hybrid GPT/MBR disk, gusty updates the GPT table and leaves the MBR table untouched, but hardy updates the GPT table and erases the MBR table, thus makes xp/vista/ubuntu unbootable (because grub needs MBR)
Fortunately i have saved the MBR table information before (run fdisk /dev/rdisk0)
I then opened a terminal in leopard and ran the command sudo fdisk -e /dev/rdisk0, rebuilt the MBR table manually. After that all my OSes came back.

cyberdork33
April 25th, 2008, 09:23 AM
I was quad booting leopard/vista/ubuntu/xp on my macbook. Last month I replaced the internal HD with a larger one, and installed leopard/vista/xp, and left some unallocated space for ubuntu hardy. I installed 8.04 last night, and found vista/xp/ubuntu unable to boot. It erased the MBR table!
Apple uses a hybrid GPT/MBR partition table for multi-booting with 'legacy' OSes. Ubuntu understands GPT but grub doesn't. When creating new partitions (beyond the first four) on a hybrid GPT/MBR disk, gusty updates the GPT table and leaves the MBR table untouched, but hardy updates the GPT table and erases the MBR table, thus makes xp/vista/ubuntu unbootable (because grub needs MBR)
Fortunately i have saved the MBR table information before (run fdisk /dev/rdisk0)
I then opened a terminal in leopard and ran the command sudo fdisk -e /dev/rdisk0, rebuilt the MBR table manually. After that all my OSes came back.
Yea, this is confirmed by several people. Even dual boots don't work unless you sync with rEFIt first. Can you file a bug? This only happened very recently (RC or Final).

ey1416
April 25th, 2008, 12:28 PM
I was dual booting windows and Ubuntu, then upgraded from Gutsy to hardy. Now my windows partition doesn't show up, which sounds similar to your problem. Is there any way for me to fix this?

cyberdork33
April 25th, 2008, 04:20 PM
I filed a bug report. Please add info.
https://bugs.edge.launchpad.net/ubuntu/+source/ubiquity/+bug/222126

I was dual booting windows and Ubuntu, then upgraded from Gutsy to hardy. Now my windows partition doesn't show up, which sounds similar to your problem. Is there any way for me to fix this?Are you on a mac?

either way, you can check what the MBR table looks like with fdisk

slayer^_^
April 25th, 2008, 04:54 PM
i confirm this bug, my partitions went out of the windows after i installed hardy.

moreover i got error 17 : can't mount partition after i installed and i had to edit manually the grub config file changing my hd from (0,0) to (1,0).


DAMN !!!

michaels
April 25th, 2008, 05:38 PM
synchronizing GPT and MBR is dangerous in some cases. The much better way is trying to handle and the stuff by yourself, which means installing grub on specific partition, not mbr. Besides, you have to always remember that grub can only be installed on first four partitions on your hard drive.

Good luck! Buddy!:)

cyberdork33
April 25th, 2008, 05:59 PM
synchronizing GPT and MBR is dangerous in some cases. The much better way is trying to handle and the stuff by yourself, which means installing grub on specific partition, not mbr. Besides, you have to always remember that grub can only be installed on first four partitions on your hard drive.
where grub is installed is a different matter... if there is no MBR partition table, it won't matter where you install grub.

cyberdork33
April 25th, 2008, 10:42 PM
can you guys give some details about the options you chose during install? I just installed from scratch and didn't have a problem at all with it dumping the table. I used amd64 and chose to install to the free space.

slayer^_^
April 26th, 2008, 03:58 AM
i chose the manual partition configuration.

i've got 2 hds, a sata one and an ide one

on the sata i got 3 partitions : 2 ext3 and a swap
on the ide i got 2 partitions : a ntfs and an ext3

i installed on the little ext3 of the sata drive

result?

grub freaked out : it couldn't boot at all (error 17 : can't mount selected partition) - i solved it by editing the boot options and changing hd(0,0) to hd(1,0)

if i boot the ide hard drive i can't boot weendoos anymore - wendoos also disappeared in grub

ubuntu in the installation process recognized the partitions of the ide, now it recognized an unmountable scsi device and i can't do anything with it... gparted recognizes still the partitions on the ide hard drive, but can't access them.

what can i do?

monkeytech
April 26th, 2008, 04:07 AM
I had the same issue as above,

1 sata drive, 1 ide drive

installed to sata (with windows on it) rebooted and couldnt boot from partion... as above i had to change ide to frist drive in boot options in bios for it to see partions and boot from them..

billbear
April 26th, 2008, 09:38 AM
slayer&monkeytech: are your machines mac?

cyberdork33
April 26th, 2008, 10:24 AM
slayer&monkeytech: are your machines mac?
yea that is what i am thinking too.

billbear
April 26th, 2008, 11:30 AM
I basically replayed the quad boot process i posted last year at http://forum.onmac.net/showthread.php?t=2793 to my newly bought HD.
onmac has been down for at least one month, so i'd like to post it here:

A. Boot from OS X install DVD to partition the disk as
0 GPT reserved (This is created automatically and invisible)
1 MS-DOS File System (for vista, will be ntfs)
2 MS-DOS File System (fat32 for sharing files between OSes, and grub will be installed here)
3 MS-DOS File System (for xp, will be ntfs)
4 Mac OS Extended (Journaled) (for OS X)
5 free space (for linux)
Make sure to use GPT. And disk utility will create a hybrid of GPT/MBR if there is any fat32 partition.

B. Close disk utility and install OS X to its partition. Install rEFIt.

C. Install vista to its partition. (Format it ntfs of course)

D. Mark the xp partition "active". (Use fdisk in OS X or Disk Management in Vista) This will make xp installer see xp partition as C: so xp will be independent of vista.

E. Install xp to its partition. Format it ntfs. (Or FAT32, if you decide to use FAT32 you still have to format it with xp installer or xp won't boot)

F. Boot from ubuntu cd and create partitions in the unallocated space. (At least a / and a swap) At the last step choose to install GRUB to (hd0,2) and proceed with the install. This time I played a trick, i did not burn a cd. i installed vmware in xp and built a virtual machine using the whole physical disk as HD and iso file as cd. Set VM bios to first boot from cd. (Or the physical disk will boot xp in the VM while the same xp install is running in real machine and will cause unpredictable result) After install, shut down the virtual machine and boot the installation in the real machine, enter recovery mode to fix x server.

Then i found MBR table empty, i could only boot into OS X. I had saved the output of "sudo fdisk /dev/rdisk0" before, so i ran "sudo fdisk -e /dev/rdisk0" to manually rebuild the MBR partition table. After that vista complained it still needed a repair. After repair it was ok.

My laptop is a c2d 2Ghz macbook and i use ubuntu-8.04-desktop-i386.

billbear
April 26th, 2008, 12:38 PM
Just tested with an external HD in VMware:
Gparted is also dangerous. Gparted from the live cd 8.04 or from the 8.04 HD installation also hates a GPT/MBR hybrid. Even format a partition will erase the whole MBR table and convert the HD to pure GPT.
This process is safe:
Boot from gusty live cd and create/delete/format linux partitions with gparted. Don't create a swap. If there is one, delete it.
Boot from hardy live cd and install without a swap. Don't format any partition. (If there is a swap the installer will format it anyway)
You can add a swap partition or a swap file after install. Again only use gparted in gusty if you are to use a swap partition. I personally will use the windows swap file pagefile.sys (move pagefile.sys to the shared fat partition and let vista/xp/ubuntu share one swap)

cyberdork33
April 26th, 2008, 10:05 PM
i don't get it. I used gparted in Hardy livecd and installed (creating a swap) and I didn't have this problem at all.

i checked several times throughout my experience to make sure the tables were good.

billbear
April 26th, 2008, 11:22 PM
cyberdork:
please give me a detailed process of how you installed all your operating systems, output of 'diskutil list' and 'sudo fdisk /dev/rdisk0'
Maybe you don't have more than 4 partitions so hardy is convinced to use the mbr table?

cyberdork33
April 27th, 2008, 11:29 AM
cyberdork:
please give me a detailed process of how you installed all your operating systems, output of 'diskutil list' and 'sudo fdisk /dev/rdisk0'
Maybe you don't have more than 4 partitions so hardy is convinced to use the mbr table?
that may be the kicker here. I defintely do not have more than 4 partitions. In fact, I have exactly four (after installing Ubuntu).

I started the amd64 live cd, started gparted and deleted my old linux partitions (sda3 and sda4) and applied changes. Checked the gpt and mbr tables with 'sudo parted /dev/sda print' and 'sudo fdisk -l /dev/sda' respectively. Both looked good. I then started the installer and chose to use the largest free space where the installer created a root and swap partition again. I immediately checked all this with the above commands again, and again after the completion of the install. I thought maybe it was just a bug in the 32bit installer so I downloaded and burned that, but I cannot hit enter on the cd bootloader to start it up for some reason and I didn't do any further debugging of that yet.