Thank you for your prompt reply Chris/Murphy!
Unfortunately though, I got really impatient last night and thought that I can study the crap out of this post (especially your instruction as well as the changes in your instruction stemming from the replies of the OP) and that I could do it myself.
Forgive me for I may also be using the wrong jargon. When I said "mismatch" I meant generally that something is off because OS X wouldn't recognize the partition, and also I noticed that the code for partition 4 is not 07 as it seemingly should be based on everything else in this post/thread.
I also forgot to mention that before I found this post yesterday, I found another one and followed the advice to resize the OS X partition a little and then resize back, and that Disk Utility might fix everything on its own. That of course did not happen, but now there might be an actual sizing mismatch, though I wouldn't know about to how to verify. I will ad though that in Disk Utility, I have the OS X partition as well as the disk0s4, however, between them, there is a bunch of unused space. That should not be. That's not how it was when I left OS X to use Windows 7 for months, and that's not how it was in Windows 7 during the whole time I was working in it.
So, anyway, I went ahead and tried to make an MBR from the GPT and I got this:
Code:
Recovery/transformation command (? for help): g
MBR command (? for help): ?
a toggle the active/boot flag
c recompute all CHS values
l set partition as logical
o omit partition
p print the MBR partition table
q quit without saving changes
r set partition as primary
s sort MBR partitions
t change partition type code
w write the MBR partition table to disk and exit
MBR command (? for help): p
** NOTE: Partition numbers do NOT indicate final primary/logical status,
** unlike in most MBR partitioning tools!
** Extended partitions are not displayed, but will be generated as required.
Disk size is 976773168 sectors (465.8 GiB)
MBR disk identifier: 0x15E666CE
MBR partitions:
Can Be Can Be
Number Boot Start Sector End Sector Status Logical Primary Code
1 40 409639 primary Y Y 0xEF
2 409640 822264639 primary Y 0xAF
3 822264640 823631831 primary Y 0xAB
4 878731264 976773119 primary Y Y 0x07
MBR command (? for help): w
Converted 4 partitions. Finalize and exit? (Y/N): y
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Andre-Bulatovs-MacBook-Pro:~ andrebulatov$ sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if
you don't want to convert your MBR partitions to GPT format!
***************************************************************
Bogus UTF-16 name found in GPTPart::SetName()! Name not changed!
Bogus UTF-16 name found in GPTPart::SetName()! Name not changed!
So then, I freaked out, calmed down and attempted to recreate the table that now went poof (I honestly thought that since the GPT was intact, it would reate a matching MBR from it, but instead, it deleted 3 partitions. Clearly, there is knowledge I am missing which confidently led me to the wrong conclusion.)
Anyway, here is the result of my ignorant labor:
Code:
Command (? for help): p
Disk /dev/disk0: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 151C89F8-FD1C-42D3-A0A3-6AFC2AFDB104
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 55099453 sectors (26.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00
2 409640 822264639 391.9 GiB AF00
3 822264640 823631831 667.6 MiB AB00
4 878731264 976773119 46.8 GiB 0700
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
Andre-Bulatovs-MacBook-Pro:~ andrebulatov$ sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/disk0: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 151C89F8-FD1C-42D3-A0A3-6AFC2AFDB104
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 55099453 sectors (26.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00
2 409640 822264639 391.9 GiB AF00
3 822264640 823631831 667.6 MiB AB00
4 878731264 976773119 46.8 GiB 0700
Command (? for help): r
Recovery/transformation command (? for help): o
Disk size is 976773168 sectors (465.8 GiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 976773167 primary 0xEE
Recovery/transformation command (? for help): p
Disk /dev/disk0: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 151C89F8-FD1C-42D3-A0A3-6AFC2AFDB104
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 55099453 sectors (26.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00
2 409640 822264639 391.9 GiB AF00
3 822264640 823631831 667.6 MiB AB00
4 878731264 976773119 46.8 GiB 0700
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 2 3 4
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF):
Set the bootable flag? (Y/N): n
Creating entry for GPT partition #3 (MBR partition #3)
Enter an MBR hex code (default AB):
Set the bootable flag? (Y/N): n
Creating entry for GPT partition #4 (MBR partition #4)
Enter an MBR hex code (default 07):
Set the bootable flag? (Y/N): y
Recovery/transformation command (? for help): o
Disk size is 976773168 sectors (465.8 GiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 409639 primary 0xEE
2 409640 822264639 primary 0xAF
3 822264640 823631831 primary 0xAB
4 * 878731264 976773119 primary 0x07
Recovery/transformation command (? for help): p
Disk /dev/disk0: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 151C89F8-FD1C-42D3-A0A3-6AFC2AFDB104
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 55099453 sectors (26.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00
2 409640 822264639 391.9 GiB AF00
3 822264640 823631831 667.6 MiB AB00
4 878731264 976773119 46.8 GiB 0700
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
Andre-Bulatovs-MacBook-Pro:~ andrebulatov$ ?
-bash: ?: command not found
Andre-Bulatovs-MacBook-Pro:~ andrebulatov$ sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: present
Found valid GPT with hybrid MBR; using GPT.
Command (? for help): r
Recovery/transformation command (? for help): o
Disk size is 976773168 sectors (465.8 GiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 409639 primary 0xEE
2 409640 822264639 primary 0xAF
3 822264640 823631831 primary 0xAB
4 * 878731264 976773119 primary 0x07
Recovery/transformation command (? for help): p
Disk /dev/disk0: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 151C89F8-FD1C-42D3-A0A3-6AFC2AFDB104
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 55099453 sectors (26.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 40 409639 200.0 MiB EF00
2 409640 822264639 391.9 GiB AF00
3 822264640 823631831 667.6 MiB AB00
4 878731264 976773119 46.8 GiB 0700
Recovery/transformation command (? for help):
Now, the tables seem intact and matching, but OS X still sees the partition as disk0s4 and won't read it or repair it, and W7 still does not boot and actually now says
No operating system found
I am assuming the operating system was destroyed by me when I resized the OS X partition over onto the W7 partition...
Also, I have rEFIt installed, and when I restart the laptop and hold down Option, I get the typical Mac menu except instead of Macintosh, it has rEFIt as a choice, then Windows and Recovery. If I choose windows I get the No OS message, if I choose rEFIt, I get the rEFIt menu with OS X and Legacy options. OS X of course works well, I am here now.
When I try the command you just gave me, I get:
Code:
Andre-Bulatovs-MacBook-Pro:~ andrebulatov$ dd if=/dev/disk0s4 of=~/4sdisk0s4.bin count=4
dd: /dev/disk0s4: Permission denied
Please advise dear kind wiseman Chris.
- Andre