Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Npjbm-0003XO-1i for mharc-grub-devel@gnu.org; Thu, 11 Mar 2010 09:43:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npjbk-0003WJ-Vd for grub-devel@gnu.org; Thu, 11 Mar 2010 09:43:29 -0500 Received: from [140.186.70.92] (port=45411 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npjbj-0003Uc-S8 for grub-devel@gnu.org; Thu, 11 Mar 2010 09:43:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Npjbi-0003HT-LH for grub-devel@gnu.org; Thu, 11 Mar 2010 09:43:27 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:34210) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Npjbi-0003HC-06 for grub-devel@gnu.org; Thu, 11 Mar 2010 09:43:26 -0500 Received: by bwz19 with SMTP id 19so91152bwz.26 for ; Thu, 11 Mar 2010 06:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=rn6AuviFPB0cCuA9H78krd/dNMwDaQnowTBDGZ6lG1I=; b=Oq1H5DXN4pxPzZZRi/YR34weg+/Um19faCGstniar3D20K8xP33SBBR/kNdQLmxM0f 2opZAP91Qhf9/CoNzJF3G65lQcEQoqfJeakFEdLH0t2je/QUR+aXmCGYhAMYh06mBHka 5pK9TlW2qcE9kGq6yGc6hBMbiB97X+gZjQidg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lrhsUuaKKBwUhC/IoL0tpXqB3NEshCmj5OLr3aKRuh21poQF8dsMTYY4ywBABunZGv mCSmSx6jbnTB0afYrxYMNGz1zomJaZ+5T0Cz8V09FvOMVghRe4VN7Mmv7AACtqv+G6uI XGgfWwMpVVOGplE8nW7HdGcx+mR3wbaFeh11A= MIME-Version: 1.0 Received: by 10.204.0.77 with SMTP id 13mr407401bka.5.1268318604565; Thu, 11 Mar 2010 06:43:24 -0800 (PST) Date: Thu, 11 Mar 2010 20:13:24 +0530 Message-ID: <3c6a49541003110643y505bb8bdn187e1883c044e23f@mail.gmail.com> From: "KESHAV P.R." To: grub-devel Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [patch] search for partition using GPT GUID 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, 11 Mar 2010 14:43:29 -0000 GPT GUID is one of the best FILESYSTEM-INDEPENDENT way of uniquely identifying a partition. Most people who use GPT are thos who have need for many primary partitions. I use GPT in my internal 320 GB HDD (12 partitions) and 500 GB USB 2.0 external (11 partitions). My guess of the workflow of grub2's search command :- 1) Read the partition table both the disks. 2) Find the starting/ending sectors of First Partition. 3) Detect its filesystem 4) Check for its UUID/GUID (length/uniqueness depends on the FS. 5) If the UUID matches, set it as the root part (set root=*) 6) If the UUID is different repeat steps 2,3,4 and 5 for 2nd partition (and so on). The time taken for this operation depends on the number of partitions and the filesystem in each part. If one uses a 4 TB drive with 40 partitions of 100 GB (approx) each. GRUB2 has to read all the partitions, its filesystems in order till a UUID match is found. This will take a long time and will take more time depending on the not of disks connected. But if GPT GUID is used, only the partition table needs to be accessed and each partition entry is checked for its "Partition Unique GUID" till a match is found. This is way faster since no filesystem is accessed and that accessing time is saved (especially for more no. of partitions). Maybe even the GPT Disk GUID can be used to reference a GPT disk (instead of confusion over whether it is (hd1) or (hd2) and so on. Also I have no-FS partitions like BIOS-Boot incase of grub2, ie lets say I dd copy some bootloader to an unknown (my own random) GUID partition (like the way grub2 core.img is embedded in GPT-BIOS mode) in one of the external HDD, and I connect 2 external HDDs, how will I know which one is /dev/sdb and which one is /dev/sdc. SInce that part has no FS, the only way to uniquely reference that partition is using it "Unique GPT GUID". Also FS like FAT do not have UUIDs which can be regarded as unique. The main reason GPT table is good is because it provided FS-independent way to reference a part thus removing abiguity. Hope this test case is sufficient. Thank you. PS : Please change the behavior of "help" command in grub2 shell as it is not possible to see all possible commands (it scrolls past screen and I see commands starting from s-alphabet only)