Bug 862085 - automatically filter disks with imsm or ddf superblocks
Summary: automatically filter disks with imsm or ddf superblocks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: rawhide
Hardware: Unspecified
OS: Linux
medium
low
Target Milestone: ---
Assignee: Peter Rajnoha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1067350
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-01 20:02 UTC by Miquel van Smoorenburg
Modified: 2015-01-30 17:29 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.116-3.fc22
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-30 17:29:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
PATCH (7.69 KB, patch)
2012-10-01 20:02 UTC, Miquel van Smoorenburg
no flags Details | Diff

Description Miquel van Smoorenburg 2012-10-01 20:02:31 UTC
Created attachment 619982 [details]
PATCH

Description of problem:

lvm.conf has a setting called md_component_detection, which makes lvm
ignore disks with a linux "md" raid superblock. This patch adds detection
of more raid superblock formats, ddf and imsm.

Version-Release number of selected component (if applicable):

LVM2-2.02.97

Additional info:

This was discussed on the linux-lvm mailinglist in Spetember 2012, Subject "automatically filter disks with imsm or ddf superblocks". This is v3 of the patch, as posted on 22-09-2012.

Comment 1 Zdenek Kabelac 2012-10-19 09:01:39 UTC
Is this patch ok ?
Are we going to add more and more built-in detections or we outsource this into util-linux binaries ?

Comment 2 Fedora End Of Life 2013-04-03 16:00:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 3 Dmitrijs Ledkovs 2013-12-02 11:30:52 UTC
In util-linux/libblkid/src/superblocks/ there are already checks for both "DDF" and "ISW" (aka Intel Matrix / Intel Software Raid / Rapid Storage / etc.) in ddf_raid.c and isw_raid.c respectively.

Thus one can query for superblock types with libblkid.

Comment 4 Zdenek Kabelac 2013-12-02 11:34:25 UTC
It's more complex.

lvm2 should probably be able to use  udev database here, which already keeps the info - so as soon as  udev is used - it should be used for more things than just obtaining list of devices.

Comment 5 Peter Rajnoha 2013-12-02 12:25:13 UTC
(In reply to Zdenek Kabelac from comment #4)
> It's more complex.
> 
> lvm2 should probably be able to use  udev database here, which already keeps
> the info - so as soon as  udev is used - it should be used for more things
> than just obtaining list of devices.

...I agree - it would make the existing filtering even faster (md, mpath,partitioned dev) as the scan and variables are already set in udev (based on blkid call and some additional processing by each subsystem's rules).

Also, the mpath filtering would work even better as we don't know whether the device is an mpath member or not until the mpath device is fully set up. But mpath itself already knows which device is going to be a part of the top-level mpath device and it marks such devices in udev already.

So these are the arguments for giving the udev db a try I think... The only danger here is that sometimes we encountered problems while reading udev db with older versions of libudev where races were still present directly in libudev interface. But we could just enable it for those newer versions, of course.

Comment 6 Alasdair Kergon 2014-02-05 22:42:01 UTC
There've been some enhancements since that last comment was written.
Let's re-evaluate the situation.

Comment 7 Miquel van Smoorenburg 2014-02-06 08:45:32 UTC
I can see the appeal of using libblkid or similar instead of one-off solutions like this patch. I see that libblkid based wiping has already been added in dev/dev-type.c. 

Should similar support be added to filters/filter-md.c ? Or a new filters/filter-blkid.c ?

Comment 8 Peter Rajnoha 2014-02-06 08:59:47 UTC
Yes, we'd definitely like to reuse the existing information in the system instead of doing the scans again (there's at least the blkid cache as well as udev information that already has what we need). I'll certainly revisit this - but at the moment I'm a bit overloaded with other high prio bugs to resolve, unfortunately. I'll try to get to this as soon as possible - this should be easy to add so once I've more time... I should be able to prepare patches for this quickly then.

Comment 9 Peter Rajnoha 2015-01-30 12:55:16 UTC
The patchset that uses udev db info for filtering is now upstream (lvm2 version 2.02.116). To use this feature, you need to enable it by setting following items in lvm.conf:

  devices {
    external_device_info_source = "udev"
    fw_raid_component_detection = 1
  }


Note You need to log in before you can comment on or make changes to this bug.