[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Install to LVM PVs
From: |
Dryden Personalis |
Subject: |
Re: [PATCH] Install to LVM PVs |
Date: |
Mon, 09 May 2016 18:10:05 +0200 |
User-agent: |
Roundcube Webmail/1.1.5 |
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);
Re: [PATCH] Install to LVM PVs, Andrei Borzenkov, 2016/05/08