PDA

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



billbear
April 25th, 2008, 07: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, 02:23 PM
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, 05: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, 09: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, 09: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, 10: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, 10: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 26th, 2008, 03:42 AM
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, 08: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, 09: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, 02:38 PM
slayer&monkeytech: are your machines mac?

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

billbear
April 26th, 2008, 04:30 PM
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, 05: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 27th, 2008, 03:05 AM
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 27th, 2008, 04:22 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?

cyberdork33
April 27th, 2008, 04:29 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?
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.

applesjgtl
December 8th, 2008, 10:41 AM
I intentionally cleared my MBR to remove GRUB due to already having rEFIt. Unfortunately, the backup command I ran first did not work and I now have no MBR and cannot boot Windows Vista, Mac OS X Leopard, or Ubuntu Intrepid Ibex off the internal drive. However, I do still have access to the computer through my emergency OS X installation an an external drive. My GPT still appears to be there, but due to the hybrid nature of the drive with Ibex and Vista, it appears unformatted to Disk Utility. A rEFIt Partition Inspector scan spit out the following results:


*** Report for internal hard disk ***

Current GPT partition table:
# Start LBA End LBA Type
1 40 409639 EFI System (FAT)
2 409640 1717452839 Mac OS X HFS+
3 1717452840 1782210652 Basic Data
4 1785085992 1953525127 Basic Data
5 1782210653 1785085991 Linux Swap

Current MBR partition table:
No MBR partition table present!


Any ideas?

pxwpxw
December 8th, 2008, 12:34 PM
I intentionally cleared my MBR to remove GRUB due to already having rEFIt. Unfortunately, the backup command I ran first did not work and I now have no MBR and cannot boot Windows Vista, Mac OS X Leopard, or Ubuntu Intrepid Ibex off the internal drive. However, I do still have access to the computer through my emergency OS X installation an an external drive. My GPT still appears to be there, but due to the hybrid nature of the drive with Ibex and Vista, it appears unformatted to Disk Utility. A rEFIt Partition Inspector scan spit out the following results:


*** Report for internal hard disk ***

Current GPT partition table:
# Start LBA End LBA Type
1 40 409639 EFI System (FAT)
2 409640 1717452839 Mac OS X HFS+
3 1717452840 1782210652 Basic Data
4 1785085992 1953525127 Basic Data
5 1782210653 1785085991 Linux Swap

Current MBR partition table:
No MBR partition table present!


Any ideas?

1. You will still need grub to boot ubuntu.

2. I have done some tests for that situation - clearing the mbr sector and recovering using an external system. It is described in the link below, but you need to use the ubuntu version of the echo command to get the hex55aa. If you have any problem I can make you a 512byte file which will let refit recreate the full MBR as described, after using the dd command from macosx. You need to be very careful.

http://ubuntuforums.org/showpost.php?p=6176317&postcount=3

Alternately I might be able to give you a copy of my GPT mbr that will be just enough to allow Macosx to boot and then refit to sync for your gpt tables and mbr.
Probably try that also.
It is also possible to use a ubuntu CD if it will boot.

But first of all, get a hexdump of what is on the mbr sector now and check that it is indeed 512 bytes of 00.
(If you have not already done that).

thekid42
December 8th, 2008, 10:18 PM
I'm actually having a very similar problem to applesjgtl's...

Initially, I wanted to triple boot my macbook pro, but I found that I could no longer boot into XP after I installed Ubuntu. I decided to remove Windows and Ubuntu to try to start fresh. I then tried clearing the MBR to get rid of GRUB (I messed up when installing Ubuntu and put it in the MBR rather than on my Ubuntu partition...), but now my machine doesn't boot.

I was able to boot up on Leopard from an external drive and run the rEFIt Partition Inspector, which gave me the following:



*** Report for internal hard disk ***

Current GPT partition table:
# Start LBA End LBA Type
1 40 409639 EFI System (FAT)
2 409640 487872879 Mac OS X HFS+

Current MBR partition table:
No MBR partition table present!


Also, when I run "sudo fdisk /dev/rdisk0", I get:



Disk: /dev/rdisk0 geometry: 30401/255/63 [488397168 sectors]
Signature: 0x0
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused


I tried using the Partitioning Tool that rEFIt provides when I boot up, but it was unable to sync the gpt and mbr. Now I'm trying to figure out a way to manually rebuild the MBR based off of the GPT info I was able to get from the Partition Inspector.

Any help would be greatly appreciated as I have two CS finals this week, and a functional computer kind of helps for studying. Thanks in advance.

applesjgtl
December 8th, 2008, 10:55 PM
1. You will still need grub to boot ubuntu.

2. I have done some tests for that situation - clearing the mbr sector and recovering using an external system. It is described in the link below, but you need to use the ubuntu version of the echo command to get the hex55aa. If you have any problem I can make you a 512byte file which will let refit recreate the full MBR as described, after using the dd command from macosx. You need to be very careful.

http://ubuntuforums.org/showpost.php?p=6176317&postcount=3

Alternately I might be able to give you a copy of my GPT mbr that will be just enough to allow Macosx to boot and then refit to sync for your gpt tables and mbr.
Probably try that also.
It is also possible to use a ubuntu CD if it will boot.

But first of all, get a hexdump of what is on the mbr sector now and check that it is indeed 512 bytes of 00.
(If you have not already done that).

I do indeed have 512 bytes of zeroes. I have installed rEFIt on the external drive and when I try using the partition editor it reports no MBR press any key to continue (approximately, that's not precisely what is said) and does not sync GPT to MBR. How would I go about creating said 512 byte file, and where/how would I place the file for rEFIt?

Thanks,
Gregory

applesjgtl
December 8th, 2008, 10:57 PM
I'm actually having a very similar problem to applesjgtl's...

Initially, I wanted to triple boot my macbook pro, but I found that I could no longer boot into XP after I installed Ubuntu. I decided to remove Windows and Ubuntu to try to start fresh. I then tried clearing the MBR to get rid of GRUB (I messed up when installing Ubuntu and put it in the MBR rather than on my Ubuntu partition...), but now my machine doesn't boot.

I was able to boot up on Leopard from an external drive and run the rEFIt Partition Inspector, which gave me the following:



Also, when I run "sudo fdisk /dev/rdisk0", I get:



I tried using the Partitioning Tool that rEFIt provides when I boot up, but it was unable to sync the gpt and mbr. Now I'm trying to figure out a way to manually rebuild the MBR based off of the GPT info I was able to get from the Partition Inspector.

Any help would be greatly appreciated as I have two CS finals this week, and a functional computer kind of helps for studying. Thanks in advance.

that's exactly what my problem is...

pxwpxw
December 8th, 2008, 11:11 PM
I'm actually having a very similar problem to applesjgtl's...

Initially, I wanted to triple boot my macbook pro, but I found that I could no longer boot into XP after I installed Ubuntu. I decided to remove Windows and Ubuntu to try to start fresh. I then tried clearing the MBR to get rid of GRUB (I messed up when installing Ubuntu and put it in the MBR rather than on my Ubuntu partition...), but now my machine doesn't boot.

I was able to boot up on Leopard from an external drive and run the rEFIt Partition Inspector, which gave me the following:



Also, when I run "sudo fdisk /dev/rdisk0", I get:



I tried using the Partitioning Tool that rEFIt provides when I boot up, but it was unable to sync the gpt and mbr. Now I'm trying to figure out a way to manually rebuild the MBR based off of the GPT info I was able to get from the Partition Inspector.

Any help would be greatly appreciated as I have two CS finals this week, and a functional computer kind of helps for studying. Thanks in advance.
Please use the external Macosx terminal to do a hexdump of the 512 bytes of the MBR sector. I am doing this example from my external drive wd:~ pxw$


wd:~ pxw$ sudo hexdump -Cn512 /dev/disk1

it may be /dev/disk0.
check using


wd:~ pxw$ diskutil list

post the result.

applesjgtl
December 8th, 2008, 11:15 PM
Please use the external Macosx terminal to do a hexdump of the 512 bytes of the MBR sector. I am doing this example from my external drive wd:~ pxw$


wd:~ pxw$ sudo hexdump -Cn512 /dev/disk1

it may be /dev/disk0.
check using


wd:~ pxw$ diskutil list

post the result.

00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200

Mostly zeros, other than that 2?

pxwpxw
December 8th, 2008, 11:23 PM
I do indeed have 512 bytes of zeroes. I have installed rEFIt on the external drive and when I try using the partition editor it reports no MBR press any key to continue (approximately, that's not precisely what is said) and does not sync GPT to MBR. How would I go about creating said 512 byte file, and where/how would I place the file for rEFIt?

Thanks,
Gregory

I can post a 512 byte dummy mbr sector in a file, I have checked this method here. You will have to download this, check it in a macosx terminal with hexdump, and if it is ok write it to the mbr sector using the dd command in a terminal. Then you can probably boot Macosx on the internal drive, or run refit and it will now see that there is an MBR table to synchronise.

Please say if you understand that.

thekid42
December 8th, 2008, 11:24 PM
Please use the external Macosx terminal to do a hexdump of the 512 bytes of the MBR sector. I am doing this example from my external drive wd:~ pxw$


wd:~ pxw$ sudo hexdump -Cn512 /dev/disk1

it may be /dev/disk0.
check using


wd:~ pxw$ diskutil list

post the result.


00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200

Looks like the exact same result as what applesjgtl got...


EDIT:

I can post a 512 byte dummy mbr sector in a file, I have checked this method here. You will have to download this, check it in a macosx terminal with hexdump, and if it is ok write it to the mbr sector using the dd command in a terminal. Then you can probably boot Macosx on the internal drive, or run refit and it will now see that there is an MBR table to synchronise.

I understand everything except checking it with hexdump. What exactly should we see when we do that?

applesjgtl
December 8th, 2008, 11:30 PM
I can post a 512 byte dummy mbr sector in a file, I have checked this method here. You will have to download this, check it in a macosx terminal with hexdump, and if it is ok write it to the mbr sector using the dd command in a terminal. Then you can probably boot Macosx on the internal drive, or run refit and it will now see that there is an MBR table to synchronise.

Please say if you understand that.

I understand what I have to do, though I'm not sure exactly what command I would enter with hexdump and dd. I don't really know all that much about writing unix commands.

pxwpxw
December 8th, 2008, 11:38 PM
I understand what I have to do, though I'm not sure exactly what command I would enter with hexdump and dd. I don't really know all that much about writing unix commands.

I will post an example and an attached 512byte dummymbr and how to check it and write it. Take 15 minutes or so to get that ready with the attachment.

applesjgtl
December 8th, 2008, 11:41 PM
I will post an example and an attached 512byte dummymbr and how to check it and write it. Take 15 minutes or so to get that ready with the attachment.

okay, thanks a million for your help.

pxwpxw
December 8th, 2008, 11:56 PM
okay, thanks a million for your help.

Check the attachment like this, you should see exactly this result, or we may need to do it another way.

I had to rename it with .txt extension to attach it.

This is from terminal in macosx.


wd:~/test pxw$ hexdump -C dummymbr
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 ea 42 25 00 00 |............B%..|
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

I will post next step.

applesjgtl
December 9th, 2008, 12:02 AM
Check the attachment like this, you should see exactly this result, or we may need to do it another way.

I had to rename it with .txt extension to attach it.

This is from terminal in macosx.


wd:~/test pxw$ hexdump -C dummymbr
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 ea 42 25 00 00 |............B%..|
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

I will post next step.

hm. slightly different. is this normal?

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 ea 42 25 00 00 |..????....??B%..|
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

applesjgtl
December 9th, 2008, 12:06 AM
hm. slightly different. is this normal?

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 ea 42 25 00 00 |..????....??B%..|
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

0xED hex editor reports the same as your output.

thekid42
December 9th, 2008, 12:06 AM
Check the attachment like this, you should see exactly this result, or we may need to do it another way.

I had to rename it with .txt extension to attach it.

This is from terminal in macosx.


wd:~/test pxw$ hexdump -C dummymbr
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 ea 42 25 00 00 |............B%..|
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

I will post next step.



hm. slightly different. is this normal?


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 ea 42 25 00 00 |..????....??B%..|
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


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 ea 42 25 00 00 |..????....??B%..|
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


It looks like the hex part is the same, so I don't know why the part on the right is different...

By the way, thanks for the help!

pxwpxw
December 9th, 2008, 12:18 AM
Check the attachment like this, you should see exactly this result, or we may need to do it another way.

I had to rename it with .txt extension to attach it.

This is from terminal in macosx.


wd:~/test pxw$ hexdump -C dummymbr
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 ea 42 25 00 00 |............B%..|
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

I will post next step.
Please confirm the correct hexdump of dummymbr before proceeding.

and post the partition info from dislkutil

This example is from terminal in macosx on external 300GB, when the internal hd is 80GB. You need to be absolutely sure to write the dummymbr to the correct drive. I will post the dd howto info after seeing your diskutil list and the name of drive you need to fix (/dev/disk? ).


wd:~/test pxw$ diskutil list
/dev/disk0
#: type name size identifier
0: GUID_partition_scheme *74.5 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS macosx 20.0 GB disk0s2
3: Apple_HFS hfsplus 5.4 GB disk0s3
4: Microsoft Basic Data 23.3 GB disk0s4
5: Linux Swap 1.9 GB disk0s5
6: Microsoft Basic Data 8.0 GB disk0s6
7: Microsoft Basic Data 7.4 GB disk0s7
8: Microsoft Basic Data DISK0S8 8.3 GB disk0s8
/dev/disk1
#: type name size identifier
0: GUID_partition_scheme *298.1 GB disk1
1: EFI 200.0 MB disk1s1
2: Apple_HFS wdp2 19.4 GB disk1s2
3: Microsoft Basic Data 39.5 GB disk1s3
4: Linux Swap 2.4 GB disk1s4
5: Microsoft Basic Data 39.7 GB disk1s5
6: Microsoft Reserved 10.2 GB disk1s6
wd:~/test pxw$

========================

applesjgtl
December 9th, 2008, 12:27 AM
Please confirm the correct hexdump of dummymbr before proceeding.

and post the partition info form dislkutil

This example is from terminal in macosx on external 300GB, when the internal hd is 80GB. You need to be absolutely sure to write the dummymbr to the correct drive. I will post the dd howto info after seeing your diskutil list and the name of drive you need to fix (/dev/disk? ).


wd:~/test pxw$ diskutil list
/dev/disk0
#: type name size identifier
0: GUID_partition_scheme *74.5 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS macosx 20.0 GB disk0s2
3: Apple_HFS hfsplus 5.4 GB disk0s3
4: Microsoft Basic Data 23.3 GB disk0s4
5: Linux Swap 1.9 GB disk0s5
6: Microsoft Basic Data 8.0 GB disk0s6
7: Microsoft Basic Data 7.4 GB disk0s7
8: Microsoft Basic Data DISK0S8 8.3 GB disk0s8
/dev/disk1
#: type name size identifier
0: GUID_partition_scheme *298.1 GB disk1
1: EFI 200.0 MB disk1s1
2: Apple_HFS wdp2 19.4 GB disk1s2
3: Microsoft Basic Data 39.5 GB disk1s3
4: Linux Swap 2.4 GB disk1s4
5: Microsoft Basic Data 39.7 GB disk1s5
6: Microsoft Reserved 10.2 GB disk1s6
wd:~/test pxw$

========================

I was already aware that my internal drive was disk0, but anyway, here are the results:

/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: *931.5 Gi disk0
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *465.8 Gi disk1
1: EFI 200.0 Mi disk1s1
2: Apple_HFS Scooby! 465.4 Gi disk1s2
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *931.5 Gi disk2
1: EFI 200.0 Mi disk2s1
2: Apple_HFS Time Machine 931.2 Gi disk2s2
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *465.8 Gi disk3
1: Apple_partition_map 31.5 Ki disk3s1
2: Apple_HFS Bootish 465.6 Gi disk3s3
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *16.0 Mi disk4
1: Apple_partition_map 31.5 Ki disk4s1
2: Apple_HFS rEFIt 16.0 Mi disk4s2

I have two terabyte drives, as well as two 500GB drives. I also have a DVD with rEFIt mounted.

pxwpxw
December 9th, 2008, 12:31 AM
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 ea 42 25 00 00 |..????....??B%..|
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


It looks like the hex part is the same, so I don't know why the part on the right is different...

By the way, thanks for the help!

Yes thats ok, just need to see your diskutil results before next bit

pxwpxw
December 9th, 2008, 12:57 AM
Writing the new mbr sector - this is an example log


1. recheck what you are about to write.
wd:~/test pxw$ hexdump -C dummymbr.txt
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 ea 42 25 00 00 |............B%..|
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

2. Be sure you are writing to the disk you intend to fix. Here it is /dev/disk0.

wd:~/test pxw$ sudo dd if=dummymbr.txt of=/dev/disk0 bs=512 count=1
Password:
dd: /dev/disk0: Resource busy

If that happens, you need to use the Macosx graphical Disk Utility to Unmount anything from the target drive. (I am using Macosx Tiger, Leopard might be slightly different.)

wd:~/test pxw$ sudo dd if=dummymbr.txt of=/dev/disk0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.350948 secs (1459 bytes/sec)
wd:~/test pxw$

check the disk

wd:~/test pxw$ sudo hexdump -Cn512 /dev/disk0
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 ea 42 25 00 00 |............B%..|
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
wd:~/test pxw$

If that looks good, try a restart, the internal should start up, please report the result, there are other options.

I may need to edit this after posting.
Looks ok, post if in doubt.

pxwpxw
December 9th, 2008, 01:56 AM
deleted

applesjgtl
December 9th, 2008, 02:11 AM
Looking at that, your internal Macosx (if there is only 1) is not on /dev/disk0 in that configuration, it looks like disk1 or disk2 - but only in that configuration.

disk0 is illegible to diskutil due to its hybrid nature and missing MBR. I am booting off of disk1 externally to write this comment, and disk2 is my Time Machine Backup.

pxwpxw
December 9th, 2008, 02:24 AM
deleted

pxwpxw
December 9th, 2008, 02:43 AM
applesjgtl

Edited and deleted some of my posts above, they were not useful.

Noted that with the mbr sector all zero, Macosx diskutil list shows only the disk size.
However the partitons and data on the disk are still there.
Here I have used my /dev/disk2 to show this.
The disk was later restored by writing the dummymbr (see previous posts)



mb:~ pxw$ diskutil list /dev/disk2

/dev/disk2
#: type name size identifier
0: *298.1 GB disk2

mb:~ pxw$ sudo hexdump -Cn512 /dev/disk2
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
mb:~ pxw$

Writing the 512byte dummymbr restored it, it also immediately automounted the Macosx partition on my desktop.

applesjgtl
December 9th, 2008, 09:54 PM
Writing the new mbr sector - this is an example log


1. recheck what you are about to write.
wd:~/test pxw$ hexdump -C dummymbr.txt
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 ea 42 25 00 00 |............B%..|
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

2. Be sure you are writing to the disk you intend to fix. Here it is /dev/disk0.

wd:~/test pxw$ sudo dd if=dummymbr.txt of=/dev/disk0 bs=512 count=1
Password:
dd: /dev/disk0: Resource busy

If that happens, you need to use the Macosx graphical Disk Utility to Unmount anything from the target drive. (I am using Macosx Tiger, Leopard might be slightly different.)

wd:~/test pxw$ sudo dd if=dummymbr.txt of=/dev/disk0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.350948 secs (1459 bytes/sec)
wd:~/test pxw$

check the disk

wd:~/test pxw$ sudo hexdump -Cn512 /dev/disk0
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 ea 42 25 00 00 |............B%..|
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
wd:~/test pxw$

If that looks good, try a restart, the internal should start up, please report the result, there are other options.

I may need to edit this after posting.
Looks ok, post if in doubt.

Hey, thanks for the help, worked perfectly! Sorry didn't respond sooner, had somewhere to be.

thekid42
December 10th, 2008, 12:56 AM
applesjgtl

Edited and deleted some of my posts above, they were not useful.

Noted that with the mbr sector all zero, Macosx diskutil list shows only the disk size.
However the partitons and data on the disk are still there.
Here I have used my /dev/disk2 to show this.
The disk was later restored by writing the dummymbr (see previous posts)



mb:~ pxw$ diskutil list /dev/disk2

/dev/disk2
#: type name size identifier
0: *298.1 GB disk2

mb:~ pxw$ sudo hexdump -Cn512 /dev/disk2
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200
mb:~ pxw$

Writing the 512byte dummymbr restored it, it also immediately automounted the Macosx partition on my desktop.

Sorry it took me until now to respond, but thanks a ton for all your help. The dummymbr file was enough to boot the machine, then I resync'd the partition tables with rEFIt.

pxwpxw
December 10th, 2008, 02:28 AM
Sorry it took me until now to respond, but thanks a ton for all your help. The dummymbr file was enough to boot the machine, then I resync'd the partition tables with rEFIt.

Thanks for the feedback, it is good to know the fix worked.

pxwpxw
December 15th, 2008, 06:46 AM
Hey, thanks for the help, worked perfectly! Sorry didn't respond sooner, had somewhere to be.

Thanks, glad it worked for you.