Re: [PATCH 1/1] Make sure Udev does not screw us up.

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

 



On Tue, Apr 14, 2009 at 08:17:08PM +0200, Hans de Goede wrote:
> I'm not following this you seem to be mixing and matching dmraid and mdraid

yes, yes, yes.  my fingers play tricks on me sometimes :)  its with
mdriad.

> in the description here, also you seem to be changing the format
> of the disk in the code, not of the partition, which atleast for

Well, thats just the thing.  What do you do when a disk, that holds
partitions has a format of LVM, for example?  This is a situation that
is contrary to a sane setup and it occurs when you have metadata of one
format in the disk and a partition table in the _same_ disk.

The logic here is:  since we dont really handle disk formats (the have
to be on partitions) then choose the partitions.  note that I'm trying
to avoid the disk format in the devicetree tree, which does not mean it
will get erased.

The bug was showing its ugly face in custom partitioning.  Where the
installer would let me create a VG (after pressing the LVM button), but
there where no PVs in the list.  It allowed me to create the VG because
it had a PV that had nothing on top of it in the tree.  And the PV was
not shown in the list, I assume, because the partition was seen first
and the disk was considered to house a partition table instead of a PV.

I have a new patch that checks not only the mdraid, but all the
partitions.  I also want to add a question to the user, so he might be
able to ignore a whole disk if we are doing the wrong thing.

Hope I made my self clear.

Regards.
> mdraid seems wrong to me.
>
> Can you please explain ?
>
> Regards,
>
> Hans
>
>
> On 04/14/2009 06:19 PM, Joel Granados Moreno wrote:
>> I have seen instances where Udev says there is an lvm format in device
>> and also asserts that there is dmraid format in device# (the partition).
>> This tries to verify that all the parents of the mdarray that are
>> partitions are contained in a disk that has format = None.
>> ---
>>   storage/devicetree.py |   19 +++++++++++++++++++
>>   1 files changed, 19 insertions(+), 0 deletions(-)
>>
>> diff --git a/storage/devicetree.py b/storage/devicetree.py
>> index 7540ff2..ed50ad8 100644
>> --- a/storage/devicetree.py
>> +++ b/storage/devicetree.py
>> @@ -1558,6 +1558,25 @@ class DeviceTree(object):
>>                       lvm.lvm_cc_addFilterRejectRegexp(parent.name)
>>               return
>>
>> +        elif device.type == "mdarray":
>> +            # Make sure Udev does not screw us up.  I have seen instances where
>> +            # Udev says there is an lvm format in device and also asserts that
>> +            # there is dmraid format in device# (the partition).  This tries to
>> +            # verify that all the parents of the mdarray that are partitions
>> +            # are contained in a disk that has format = None.
>> +            # FIXME: We should clean the metadata on disk somehow.
>> +            # FIXME: should we ask the user?
>> +            for parent in device.parents:
>> +                if parent.type == "partition" and \
>> +                    parent.parents[0].format.type is not None:
>> +                        format = formats.getFormat(None)
>> +                        log.error("Automatically corrected fomrat error on %s. "
>> +                                "Changed from %s to %s." %
>> +                                (device.name,parent.parents[0].format, format))
>> +                        parent.parents[0].format = format
>> +
>> +
>> +
>>       def populate(self):
>>           """ Locate all storage devices. """
>>           # each iteration scans any devices that have appeared since the
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux