grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub-probe gets a segfault


From: Pavel Roskin
Subject: Re: grub-probe gets a segfault
Date: Wed, 21 May 2008 21:06:22 -0400

On Wed, 2008-05-21 at 20:20 -0430, Isaac M. Marcos wrote:
> El Friday 16 May 2008 13:32:40 Pavel Roskin escribió:

> > I think because it has no LVM label.  Maybe /dev/sda6 was holding a LVM
> > physical volume before, and the label was not erased when it became a
> > RAID partition.
> 
> I cheked, and both partitions (sda5,sda6) have LVM labels, and correctly so:
> 
> /dev/sda5 (for example):
> 0000:0200 LABELONE........?ÍÉC ...LVM2 001npzaBI7ZXIhG29Uxcg1lkUIlTNTS6wbR
> 0000:0240 .../.............................................ð..............
> 
> sda5,sdb5,sdc5,sdd5 form a RAID5 disk (md1) ON which LVM was set up.
> sda6,sdb6,sdc6,sdd6 form a RAID5 disk (md2) ON which LVM was set up.

I suspected something like that.

> pvck /dev/md1
>   Found label on /dev/md1, sector 1, type=LVM2 001
>   Found text metadata area: offset=4096, size=192512
> pvck /dev/md2
>   Found label on /dev/md2, sector 1, type=LVM2 001
>   Found text metadata area: offset=4096, size=192512
> 
> Some kind of deep interaction is going on?

Nothing deep, really.  It just shows that searching for some marker on a
partition is inherently wrong.  Whatever fixed marker is used, there is
a substantial probability of it being found without it being a valid
marker.  Data on partitions is not random.

> Let me explain something:
> Neither "/" or "/boot" has anything to do with RAID or LVM in this system. It 
> was setup like this exactly to prevent this kind of interferences on boot. 
> They are "/dev/sda1" and "/dev/sda2", plain ext3 partitions.
> 
> And here comes grub-probe, testing every disk and partition on the system, 
> testing for LVM, and many other things, and failing in the process.

I can fix the LVM code not to overrun the buffer.  The right solution
would be to improve check for LVM partitions to match pvck behavior (in
addition to the overrun check).

> I think it boils down to this main idea:
> Could it test simple partitions first and if / is found, stop scanning?
> Why it needs to scan anything else if the requested partition has been found?

I think the idea is to reuse the code used in the bootloader.  We want
to give the user the full list of partitions at the boot time.  And we
don't want the bootloader to hang.  It's better to check the same code
while in the OS and find possible problems early and in the protected
environment.

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]