Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Nd6U9-0004y8-6J for mharc-grub-devel@gnu.org; Thu, 04 Feb 2010 13:31:25 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd6U6-0004vA-Hv for grub-devel@gnu.org; Thu, 04 Feb 2010 13:31:22 -0500 Received: from [199.232.76.173] (port=46457 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd6U6-0004uF-09 for grub-devel@gnu.org; Thu, 04 Feb 2010 13:31:22 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd6U4-00062X-8L for grub-devel@gnu.org; Thu, 04 Feb 2010 13:31:21 -0500 Received: from smarthost03.mail.zen.net.uk ([212.23.3.142]:48280) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd6U3-00062N-TN for grub-devel@gnu.org; Thu, 04 Feb 2010 13:31:20 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost03.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Nd6Tz-0005qK-BI for grub-devel@gnu.org; Thu, 04 Feb 2010 18:31:15 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1Nd6Ty-0005Ds-00; Thu, 04 Feb 2010 18:31:14 +0000 Date: Thu, 4 Feb 2010 18:31:14 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20100204183114.GV4409@riva.ucam.org> References: <27271057.01265282770941.JavaMail.root@wombat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27271057.01265282770941.JavaMail.root@wombat> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost03-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: Search GPT partition in GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 18:31:22 -0000 On Thu, Feb 04, 2010 at 06:26:10AM -0500, gburanov@gmail.com wrote: > I am currently trying to realize the following functionality: I want > grub to load the kernel from GPT partition. I am using grub build for > UEFI. So, I got following questions for now: > > I don't want to use standart naming conversion, here are some reasons: > > * It is not clear what is (hd1, 0). I understand that is means first > partition on the first disk, but what is first disk on EFI? I know, > for example, that you can easy change the order in BIOS (SCSI first or > IDE first), but what about UEFI? What disk exactly is hd1, and what is > hd2? Or that's platform specific? Platform-specific, and you should avoid relying on it. Getting hold of partitions this way is very close to being legacy functionality in GRUB. > I am currently looking into "search" grub command, it seems it can > search by filesystem UUID, This is almost always the right approach. > but I want to load from NTFS. Do we have UUID on NTFS? Yes. > Is UUID really unique? I guess no. The NTFS "UUID" (actually the volume serial number rather than a proper UUID) is 64 bits long, so we have a space of 2^64 possible UUIDs. That's very close to the number of stars in the observable universe. I believe that the volume serial number is typically generated based on the date and some amount of randomness, although of course I can't verify that for certain from Microsoft's implementation (linux-ntfs simply generates a 64-bit random number). Even with fairly conservative assumptions, though, the probability of an NTFS volume serial number collision is extremely small. The probability of an NTFS volume serial number collision *on the same machine* - well, I rather expect that it's on the same general order as the probability of an asteroid dropping on your head. I wouldn't worry about it if I were you! > It would be ideal if we can search the GPT partition/disk by GUID - > that's what we got NTFS GUID for =) That would be nice, and it might not be all that difficult to implement, but of course it would take up extra precious space in the core image. I don't think it's really necessary in this case. Cheers, -- Colin Watson [cjwatson@ubuntu.com]