Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LwKJ8-0006Mf-Ba for mharc-grub-devel@gnu.org; Tue, 21 Apr 2009 14:02:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwKJ7-0006MX-C4 for grub-devel@gnu.org; Tue, 21 Apr 2009 14:02:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwKJ3-0006MH-Nv for grub-devel@gnu.org; Tue, 21 Apr 2009 14:02:57 -0400 Received: from [199.232.76.173] (port=56528 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwKJ3-0006ME-KT for grub-devel@gnu.org; Tue, 21 Apr 2009 14:02:53 -0400 Received: from wf-out-1314.google.com ([209.85.200.174]:44538) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LwKJ2-0002uK-Oa for grub-devel@gnu.org; Tue, 21 Apr 2009 14:02:53 -0400 Received: by wf-out-1314.google.com with SMTP id 23so2300438wfg.24 for ; Tue, 21 Apr 2009 11:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=TFj48sDe4l47rq07O7MKlcDAhQjv6ouek7MulC9XBqg=; b=YMa/oEDhvIXSfmEWeJwgKgO+VBhrqt3VPTj7+EPf5YsRvxHgQPV4AQJ7RWoY82+ngw ikHYj8s7BN7aF1hW7tkXhpBAR1IuZoXzVQ0TMO5KFhUcLWGlODlFHti7EmYWlPb8c0bv lQgWLL1f4vzgBXnqAP6D6jK26Zy7GjsF0KZ00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iB4LoHpCa3eVnxknZjoFxXDbzZD+J76vEI5DeU4c5fg919ufr9anR4aXWza8tNIvcL NsxGX7AfiKExxXwRXDuqMMJLHqYrTCwRTAelMvQccq89XBy8HVUmy6i+TjQZdh5Eanji A/qiksvrR1swRrKvxZtpm+gGNzmQPBuUyQZhc= MIME-Version: 1.0 Received: by 10.143.32.7 with SMTP id k7mr1735394wfj.50.1240336972021; Tue, 21 Apr 2009 11:02:52 -0700 (PDT) In-Reply-To: References: <48f46e890904200223o4f11e73au5935c15155df4a00@mail.gmail.com> <48f46e890904210429mdad5590we5cc81c1417ad96d@mail.gmail.com> Date: Wed, 22 Apr 2009 04:02:51 +1000 Message-ID: <48f46e890904211102m3d5558c3nb6ce3a4fc97597ea@mail.gmail.com> From: Peter Cros To: The development of GRUB 2 Content-Type: multipart/alternative; boundary=00504502dd6c9e815a0468147470 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] gptsync X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2009 18:02:57 -0000 --00504502dd6c9e815a0468147470 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit There appears to be a small bug there. For example - gptsync (hd0) 4 2 3 will write data for GPT partition 4 2 3 to MBR partition table 2 3 4 but also GPT partition 1 to MBR partition 1 (which is actually what happens now for intel mac.) And similarly for other selections will write the next lower gpt partition number to MBR partition 1 slot. I don't think it is compatible with current MBR/GPT hybrid partitioning on intel macs for grub-pc booting. On Wed, Apr 22, 2009 at 1:10 AM, Vladimir Serbinenko wrote: > > > On Tue, Apr 21, 2009 at 1:29 PM, Peter Cros wrote: > >> Hi, >> >> I have been playing with grub gptsync, on apple intel mac with GUID >> partitioned 8 GB usb stick, 8 partitions. #1 is the standard fat32 EFI >> system part for macs. >> >> I am comparing with the gptsync utility from linux, or rEFIt gptsync, >> currently used for macs booting pc-bios bootloader. >> >> It is working to allow selection of GPT partions for MBR 2, 3, 4 but some >> of the numbers look wrong. I have not tried setting flags. >> >> grub gptsync is not handling MBR partition table 1 the same way as current >> linux or refit gptsync, which puts GPT partition 1 (EFI system FAT32) in MBR >> part1. >> > I don't understand what you mean. I will not do any special treatment for > EFI system partition. As far as I'm concerned it's just a partition. I don't > think it's a problem since user can ask which partitions to put in MBR > >> >> >> GPT Partions are >> (512 byte sectors) >> Current GPT partition table: >> # Start LBA End LBA Type >> 1 40 409639 EFI System (FAT) >> 2 409640 2395367 Mac OS X HFS+ >> 3 2395368 4573255 Mac OS X HFS+ >> 4 4835400 7141399 Mac OS X HFS+ >> 5 7403544 9965767 Mac OS X HFS+ >> 6 10227912 13046359 Mac OS X HFS+ >> 7 13308504 15642623 Mac OS X HFS+ >> 8 15904768 15949783 Mac OS X HFS+ >> >> There seems to be agreement about start and end on MBR table partitions 2 >> 3 4, using grub> gptsync (hd0) 2 3 4. >> Other bytes differ (type, flags). >> >> This is after grub> gptsync (hd0) 2 3 4 >> (MBR part1 was initially set by linux gptsync) >> >> pxw@im81:~$ sudo hexdump -Cn80 -s432 /dev/sdb >> [sudo] password for pxw: >> 000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> 000001c0 02 00 ee 7f 0e 19 01 00 00 00 27 40 06 00 00 7f >> |..........'@....| >> 000001d0 0f 19 83 1a 2d 95 28 40 06 00 c0 4c 1e 00 00 1a >> |....-.(@...L....| >> 000001e0 2e 95 83 ab 57 1c e8 8c 24 00 60 3b 21 00 00 fc >> |....W...$.`;!...| >> 000001f0 59 2c 83 87 63 bc 48 c8 49 00 d0 2f 23 00 55 aa >> |Y,..c.H.I../#.U.| >> 00000200 >> >> Then as seen in linux gptsync, >> >> Current MBR partition table: >> # A Start LBA End LBA Type >> 1 1 409639 ee EFI Protective >> 2 409640 2395367 83 Linux >> 3 2395368 4573255 83 Linux >> 4 4835400 7141399 83 Linux >> >> Status: MBR table must be updated. >> >> Proposed new MBR partition table: >> # A Start LBA End LBA Type >> 1 1 409639 ee EFI Protective >> 2 * 409640 2395367 af Mac OS X HFS+ >> 3 2395368 4573255 af Mac OS X HFS+ >> 4 4835400 7141399 af Mac OS X HFS+ >> May I update the MBR as printed above? [y/N] y >> Yes >> > Here there are 2 differences. First partition type for hfs+ isn't > autodetected, I will fix this, just I thought it ws unnecessary AFAIK every > OS which understands HFS+ understands GPT. The second thing is that none of > partiion is active. Here you have just to tell which partition is active. > You can have the same behavior as OSX gptsync with command > gptsync hd0 2+0xaf 3-0xaf 4-0xaf > Once I add hfs+ autodetect it will be enough to do > gptsync hd0 2+ 3 4 > >> >> pxw@im81:~$ sudo hexdump -Cn80 -s432 /dev/sdb >> 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 c0 4c 1e 00 00 fe >> |......(@...L....| >> 000001e0 ff ff af fe ff ff e8 8c 24 00 60 3b 21 00 00 fe >> |........$.`;!...| >> 000001f0 ff ff af fe ff ff 48 c8 49 00 d0 2f 23 00 55 aa >> |......H.I../#.U.| >> 00000200 >> >> >> >> -- >> Cros (pxw) >> >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> http://lists.gnu.org/mailman/listinfo/grub-devel >> >> > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > -- Cros (pxw) --00504502dd6c9e815a0468147470 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
There appears to be a small bug there.
For example -
gptsync (hd0) 4 2 3
will write data for GPT partition 4 2 3 to= MBR partition table 2 3 4
but also GPT partition 1 to MBR partit= ion 1 (which is actually what happens now for intel mac.)
And similarly for other selections will write the next lower gpt parti= tion number to MBR partition 1 slot.
I don't think it is comp= atible with current MBR/GPT hybrid =A0partitioning on intel macs for grub-p= c booting.


On Wed, Apr 22, 2009 at 1:10 = AM, Vladimir Serbinenko <phcoder@gmail.com> wrote:


On Tue, Apr 21, 2009 a= t 1:29 PM, Peter Cros <pxwpxw8@gmail.com> wrote:
Hi,

I have been playing with grub gptsync, on= apple intel mac with GUID partitioned 8 GB usb stick, 8 partitions. #1 is = the standard fat32 EFI system part for macs.

I am comparing with the gptsync utility from linux, or rEFIt gptsync, curre= ntly used for macs booting pc-bios bootloader.

It is working to allow selection of GPT partions for MB= R 2, 3, 4 but some of the numbers look wrong. I have not tried setting flag= s.

grub gptsync is not handling MBR partition tabl= e 1 the same way as current linux or refit gptsync, which puts GPT partitio= n 1 (EFI system FAT32) in MBR part1.
I don't understand what you mean.=A0= I will not do any special treatment for EFI system partition. As far as I&= #39;m concerned it's just a partition. I don't think it's a pro= blem since user can ask which partitions to put in MBR


GPT Partions are
<= div> (512 byte sectors)
Current GPT partition table:
=A0# =A0 =A0 =A0Start LBA =A0 = =A0 =A0End LBA =A0Type
=A01 =A0 =A0 =A0 =A0 =A0 =A0 40 =A0 =A0 = =A0 409639 =A0EFI System (FAT)
=A02 =A0 =A0 =A0 =A0 409640 =A0 =A0 =A02395367 =A0Mac OS X HFS+
<= div>=A03 =A0 =A0 =A0 =A02395368 =A0 =A0 =A04573255 =A0Mac OS X HFS+
=A04 =A0 =A0 =A0 =A04835400 =A0 =A0 =A07141399 =A0Mac OS X HFS+=A05 =A0 =A0 =A0 =A07403544 =A0 =A0 =A09965767 =A0Mac OS X HFS+
=A06 =A0 =A0 =A0 10227912 =A0 =A0 13046359 =A0Mac OS X HFS+
= =A07 =A0 =A0 =A0 13308504 =A0 =A0 15642623 =A0Mac OS X HFS+
=A08 = =A0 =A0 =A0 15904768 =A0 =A0 15949783 =A0Mac OS X HFS+

=
There seems to be agreement about start and end on MBR table partition= s 2 3 4,=A0using grub> gptsync (hd0) 2 3 4.
Other bytes differ (type, flags).

This is aft= er grub> gptsync (hd0) 2 3 4=A0
(MBR part1 was initially set b= y linux gptsync)

pxw@im81:~$ sudo hexdump -Cn80 -s= 432 /dev/sdb
[sudo] password for pxw:
000001b0 =A000 00 00 00 00 00 00 00= =A000 00 00 00 00 00 00 00 =A0|................|
000001c0 =A002 = 00 ee 7f 0e 19 01 00 =A000 00 27 40 06 00 00 7f =A0|..........'@....|
000001d0 =A00f 19 83 1a 2d 95 28 40 =A006 00 c0 4c 1e 00 00 1a =A0|....-.(@= ...L....|
000001e0 =A02e 95 83 ab 57 1c e8 8c =A024 00 60 3b 21 0= 0 00 fc =A0|....W...$.`;!...|
000001f0 =A059 2c 83 87 63 bc 48 c8= =A049 00 d0 2f 23 00 55 aa =A0|Y,..c.H.I../#.U.|
00000200

Then as seen in linux gptsync,=A0

Current MBR partition table:
=A0# A =A0 = =A0Start LBA =A0 =A0 =A0End LBA =A0Type
=A01 =A0 =A0 =A0 =A0 =A0 = =A0 =A01 =A0 =A0 =A0 409639 =A0ee =A0EFI Protective
=A02 =A0 =A0 =A0 =A0 409640 =A0 =A0 =A02395367 =A083 =A0Linux
=A03 =A0 =A0 =A0 =A02395368 =A0 =A0 =A04573255 =A083 =A0Linux
= =A04 =A0 =A0 =A0 =A04835400 =A0 =A0 =A07141399 =A083 =A0Linux
Status: MBR table must be updated.

Proposed new MBR partition table:
=A0# A =A0 =A0St= art LBA =A0 =A0 =A0End LBA =A0Type
=A01 =A0 =A0 =A0 =A0 =A0 =A0 = =A01 =A0 =A0 =A0 409639 =A0ee =A0EFI Protective
=A02 * =A0 =A0 = =A0 409640 =A0 =A0 =A02395367 =A0af =A0Mac OS X HFS+
=A03 =A0 =A0 =A0 =A02395368 =A0 =A0 =A04573255 =A0af =A0Mac OS X HFS+<= /div>
=A04 =A0 =A0 =A0 =A04835400 =A0 =A0 =A07141399 =A0af =A0Mac OS X = HFS+
May I update the MBR as printed above? [y/N] y
Yes=
Here there are 2 differences. First partition type for hfs+ isn't autod= etected, I will fix this, just I thought it ws unnecessary AFAIK every OS w= hich understands HFS+ understands GPT. The second thing is that none of par= tiion is active. Here you have just to tell which partition is active. You = can have the same behavior as OSX gptsync with command
gptsync hd0 2+0xaf 3-0xaf 4-0xaf
Once I add hfs+ autodetect it will be e= nough to do

gptsync hd0 2+ 3 4

pxw@im81:~$ sudo hexdump -Cn80 -s432 = /dev/sdb
000001b0 =A000 00 00 00 00 00 00 00 =A000 00 00 00 00 00 00 fe =A0|...= .............|
000001c0 =A0ff ff ee fe ff ff 01 00 =A000 00 27 40= 06 00 80 fe =A0|..........'@....|
000001d0 =A0ff ff af fe ff= ff 28 40 =A006 00 c0 4c 1e 00 00 fe =A0|......(@...L....|
000001e0 =A0ff ff af fe ff ff e8 8c =A024 00 60 3b 21 00 00 fe =A0|...= .....$.`;!...|
000001f0 =A0ff ff af fe ff ff 48 c8 =A049 00 d0 2f= 23 00 55 aa =A0|......H.I../#.U.|
00000200

<= div>

--=A0
Cros (pxw)



_______________________________________________=
Grub-devel mailing list
Grub-devel@gnu.org<= /a>
http://lists.gnu.org/mailman/listinfo/grub-devel



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel




--
Cros (pxw)

<= br> --00504502dd6c9e815a0468147470--