Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aznlE-0003hM-Dp for mharc-grub-devel@gnu.org; Mon, 09 May 2016 12:10:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aznl7-0003aA-LI for grub-devel@gnu.org; Mon, 09 May 2016 12:10:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aznl3-0007Jg-Cp for grub-devel@gnu.org; Mon, 09 May 2016 12:10:12 -0400 Received: from smtpgw.dds.nl ([91.142.252.201]:48203 helo=smtp1.dds.nl) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aznl3-0007HJ-0V for grub-devel@gnu.org; Mon, 09 May 2016 12:10:09 -0400 Received: from webmail.dds.nl (app1.dds.nl [81.21.136.61]) by smtp1.dds.nl (Postfix) with ESMTP id 957817FCC8 for ; Mon, 9 May 2016 18:10:05 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 09 May 2016 18:10:05 +0200 From: Dryden Personalis To: The development of GNU GRUB Subject: Re: [PATCH] Install to LVM PVs In-Reply-To: <57302925.2000000@gmail.com> References: <572ED720.30800@gmail.com> <57302925.2000000@gmail.com> Message-ID: <74e43e3a3555eec41667a2c3e326c8af@dds.nl> X-Sender: list@xenhideout.nl User-Agent: Roundcube Webmail/1.1.5 X-Virus-Scanned: clamav-milter 0.99.1 at smtp1 X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 91.142.252.201 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2016 16:10:19 -0000 Currently: - still searches in first sector for label, and reports error if found there - get_pvh split into regular and one with 2 extra parameters for first_sector detection - some documentation - VG is not required to install - does not even check for VG, but function is retained - is lvm returns true iff header is found - currently still skips filesystem check for lvm. - untested installing on partitions - note: LVM does not support first sector PVs - we could also skip checking the first sector (my beautiful code) - in that case split get_pvh is (currently) not needed, but you would also not warn people about the bootsector. The header would just not be found. So in principle the solution becomes really simple (not requiring VG). You can however corrupt the thing by first installing a bootloaderareasize PV, then a regular one on top of that, and the code will mistakenly believe there is room. But this is all I can do without diving into the mechanics currently. This is the function I thought Andrei wanted: int grub_util_has_lvm_vg (grub_disk_t disk) { struct grub_diskfilter_pv *pv = NULL; struct grub_diskfilter_vg *vg = NULL; pv = grub_diskfilter_get_pv_from_disk(disk, &vg); return pv && vg && vg == vg->driver->detect(disk, &pv->id, &pv->start_sector) ? 1 : 0; } If you are okay, I will attach the patch, but I also did some cleanup in lvm.c particularly (removing extraneous \n for instance messing up info messages) but I need to separate that with Git. If you still feel VG should be required, let me know. But also whether filesystem check (without -s) should be required when none can ever be found (at least not in our case here). I have reverted to that of the patch (or similar): if (fs_probe) { if (!is_lvm && !fs && !ctx.dest_partmap) grub_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"), dest_dev->disk->name);