From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MWGJZ-0002cs-CZ for mharc-grub-devel@gnu.org; Wed, 29 Jul 2009 17:03:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWGJX-0002XB-38 for grub-devel@gnu.org; Wed, 29 Jul 2009 17:03:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWGJS-0002JR-K4 for grub-devel@gnu.org; Wed, 29 Jul 2009 17:03:54 -0400 Received: from [199.232.76.173] (port=34179 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWGJS-0002Is-7v for grub-devel@gnu.org; Wed, 29 Jul 2009 17:03:50 -0400 Received: from c60.cesmail.net ([216.154.195.49]:63546) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MWGJR-00014I-9g for grub-devel@gnu.org; Wed, 29 Jul 2009 17:03:49 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 29 Jul 2009 17:03:47 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 8F9CF34C6D for ; Wed, 29 Jul 2009 17:15:23 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <20090729183547.GP11691@riva.ucam.org> References: <20090729183547.GP11691@riva.ucam.org> Content-Type: text/plain Date: Wed, 29 Jul 2009 17:03:44 -0400 Message-Id: <1248901424.4253.2.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: grub-probe, but in reverse? 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: Wed, 29 Jul 2009 21:03:55 -0000 On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote: > $ sudo grub-probe -d /dev/sda1 -t drive > (hd0,1) > > I have a reason to want to do the reverse of this: I have a > libparted-based program that ensures that at least one partition on a > disk is marked active (needed for some BIOSes), and would like to call > it on the disk selected for installation of GRUB in d-i. Of course > libparted is only going to understand OS device names. If possible I'd > rather avoid reading device.map by hand to figure out how to map (hd0,1) > back to /dev/sda1. Is there any way to do this with the code as it > stands, and if not would it make sense to make it possible to pass GRUB > device names to grub-probe? I think device.map is fundamentally unreliable and should be obsoleted. I don't know where you are getting the GRUB device names, but I suggest that you use UUID instead. -- Regards, Pavel Roskin