Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HsraH-0003I9-68 for mharc-grub-devel@gnu.org; Mon, 28 May 2007 22:37:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HsraF-0003Hm-C0 for grub-devel@gnu.org; Mon, 28 May 2007 22:37:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HsraD-0003Ha-LM for grub-devel@gnu.org; Mon, 28 May 2007 22:37:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HsraD-0003HX-Fh for grub-devel@gnu.org; Mon, 28 May 2007 22:37:13 -0400 Received: from smtp01.maxnet.net.nz ([202.89.32.6]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HsraC-0007fL-KT for grub-devel@gnu.org; Mon, 28 May 2007 22:37:13 -0400 Received: from [192.168.0.50] (202-78-151-54.cable.telstraclear.net [202.78.151.54]) by smtp01.maxnet.net.nz (Postfix) with ESMTP id 8566C72A874 for ; Tue, 29 May 2007 14:37:03 +1200 (NZST) From: "Centurion Computer Technology (2005) Ltd" To: The development of GRUB 2 In-Reply-To: <1180320551.24543.8.camel@xerces> References: <1180320551.24543.8.camel@xerces> Content-Type: text/plain Organization: Centurion Computer Technology (2005) Ltd Date: Tue, 29 May 2007 14:37:02 +1200 Message-Id: <1180406222.19258.55.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-detected-kernel: Linux 2.4-2.6 Subject: Re: patch for partmap probing on RAID/LVM 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, 29 May 2007 02:37:15 -0000 On Mon, 2007-05-28 at 03:49 +0100, Sam Morris wrote: > Here's the beginning of a patch for grub-probe itself to make it handle > RAID/LVM more intelligently. This will work for the most common > use-cases; the comments describe an idea to make the probing process > recursive to handle more interesting situations such as LVM-on-RAID. I assume this isn't complete or working yet. By the way I don't think that LVM on LVM is actually supported by LVM itself, and raid on LVM is an unlikely scenario. > > diff --git a/util/grub-probe.c b/util/grub-probe.c > index 29d0d0a..8e10986 100644 > --- a/util/grub-probe.c > +++ b/util/grub-probe.c > @@ -118,8 +118,36 @@ probe (const char *path) > > if (print == PRINT_PARTMAP) > { > - if (dev->disk->partition == NULL) > - grub_util_error ("Cannot detect partition map for %s", drive_name); > + if (dev->disk->partition == NULL) { > + /* If the device does not have a partition map, it may still be a > + RAID or LVM device. */ > + /* What happens for LVM-on-RAID, or RAID-on-LVM, or nested LVM? > + Maybe this should be recursive, e.g.: > + > + Where (md0) consists of two devices: a whole disk and a pc partition: > + probe_partmap (md0) > + probe_partmap (hd0) -> raid > + probe_partmap (hd1,1) -> raid > + probe_partmap (hd1) -> pc > + > + Where (foo-bar) is an LVM Logical Volume on a RAID array on disks using > + gpt partitions: > + probe_partmap (foo-bar) > + probe_partmap (md0) -> lvm > + probe_partmap (hd0,1) > + probe_partmap (hd0) -> gpt > + probe_partmap (hd1,1) > + probe_partmap (hd1) -> gpt > + */ > + if (drive_name[0] == 'm' && drive_name[1] == 'd') > + printf ("pc gpt raid\n"); > + else if (strchr (drive_name, '-') != NULL) > + printf ("pc gpt lvm\n"); > + else > + grub_util_error ("Cannot detect partition map for %s", drive_name); > + > + goto end; > + } > > if (strcmp (dev->disk->partition->partmap->name, "amiga_partition_map") == 0) > printf ("amiga\n"); > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Daniel Reurich Centurion Computer Technology (2005) Limited. Ph: 021 797 722