LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI (http://www.linuxquestions.org/questions/linux-newbie-8/efi-main-gpt-overwritten-everytime-when-windows-7-runs-structure-of-efi-4175417560/)

masuch 07-19-2012 05:48 AM

EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI
 
Hi,

I have came across some weird behavior.

I have Ubuntu 12.04 64 bit cloned from another disk to my main SSD disk.
---partitions:
efi - ext2
swap
ext4 - RAID0 - created from four partitions.
Ubuntu OS is not booting from this RAID but from different disk.

Every time when I start windows 7 64 bit and switch back to Ubuntu I have got into problem that my first partition of the RAID0 array is damaged.

I have to always run gdisk - expert option -> and copy backup GPT to main GPT.
After that it works properly again - but It annoyed me to do it every time I start linux after have been in windows 7. (maybe time to delete windows forever :-)

I have binary compared before and after those changes and have found differences in it:

---before (when windows 7 made damage):
Quote:

*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00 |EFI PART....\...|
00000210 e4 4d c2 88 00 00 00 00 01 00 00 00 00 00 00 00 |.M..............|
00000220 fb 3b f3 1b 00 00 00 00 22 00 00 00 00 00 00 00 |.;......".......|
00000230 da 3b f3 1b 00 00 00 00 fb 29 98 2c 0f cd b1 47 |.;.......).,...G|
00000240 b4 50 4f df aa f8 e9 fc 02 00 00 00 00 00 00 00 |.PO.............|
00000250 80 00 00 00 80 00 00 00 71 80 6e 53 00 00 00 00 |........q.nS....|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
---after (gdisk repaired it and RAID0 works properly again):
Quote:

*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00 |EFI PART....\...|
00000210 4a 4b d0 1d 00 00 00 00 01 00 00 00 00 00 00 00 |JK..............|
00000220 2f cf fc 06 00 00 00 00 22 00 00 00 00 00 00 00 |/.......".......|
00000230 0e cf fc 06 00 00 00 00 fb 29 98 2c 0f cd b1 47 |.........).,...G|
00000240 b4 50 4f df aa f8 e9 fc 02 00 00 00 00 00 00 00 |.PO.............|
00000250 80 00 00 00 80 00 00 00 71 80 6e 53 00 00 00 00 |........q.nS....|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
(Difference in 6 bytes.)

I would like to more investigate but I did not find much documentation about gpt , efi structure of partition. (MBR documentation I have)
Is somewhere detailed [documentation/s|URLs|books] about the GPT/EFI structure and functionality (very detailed for developers would be nice) ?

thank you,
kind regards,
M.

smallpond 07-20-2012 10:14 AM

Windows first checks block 0 for MBR. If it finds that it assumes it is dos partition table and boots with that. If it does not, it will use GPT or fail depending on Windows version and level. GPT starts at block 1 to avoid clobbering or being clobbered by MBR-using programs like Windows. In your case you probably have both MBR and GPT. If your Windows is ok with GPT, then just clear block 0.

masuch 07-20-2012 02:49 PM

Quote:

Originally Posted by smallpond (Post 4733767)
Windows first checks block 0 for MBR. If it finds that it assumes it is dos partition table and boots with that. If it does not, it will use GPT or fail depending on Windows version and level. GPT starts at block 1 to avoid clobbering or being clobbered by MBR-using programs like Windows. In your case you probably have both MBR and GPT. If your Windows is ok with GPT, then just clear block 0.

Well,
than why windows 7 even touching/changing that disk/partitions if boots up from different disk than Linux is ?
Linux disk/RAID0 is on different disk - efi/ext2/ext4 partitions ( and is not possible to even boot from it - as Windows as Linux )
(I do not even have to have efi on Linux disk/partition - I have it there for future experiment/s - at this moment it is completely not in use) ?
Windows 7 is on MBR.
Linux is on GPT (but boots up from different disk ~ MBR).
I can convert disk where is Windows from MBR to GPT (I did it for many other disks) but it is not necessary.


All times are GMT -5. The time now is 03:40 PM.