[linux-lvm] [RFC] Let udev play with snapshots

Jan Blunck jblunck at suse.de
Wed Oct 11 17:34:21 UTC 2006


it seems that the snapshot problem isn't solved completely by our latest
changes. I looked into it and found something:

The problem is that udev isn't able to differentiate between dm targets that
aren't supposed to be opened by anything else than the lvm2 tools itself or
not. When we are creating a snapshot, this is what we do:

- creating "vg-snapshot"
- clearing the start of "vg-snapshot"
- removing "vg-snapshot"                                                  (1)
- creating "vg-origin-real"
- creating "vg-snapshot-cow"
- creating "vg-snapshot"
- suspending "vg-origin" and "vg-origin-real"
- reload tables
- resuming "vg-origin-real", "vg-snapshot-cow", "vg-snapshot" and         (2)

At the point (1) udev already run vol_id on vg-snapshot. This LV is only
created to clear the exception store of the snapshot to be created. So
lvcreate tries to remove the still open vg-snapshot.

What we need to do is to tell udev that it shouldn't open the intermediate
vg-snapshot target but wait until (2) to open it.

I'm not quite certain about how to do this. IIRC Heinz told me during the
summit about the tagging possibilities. The problem is that tags are not
supported by snapshots but as the first LV isn't a snapshot ... So I propose
the tagging of all kind of intermediate LVs so that udev can easily
differentiate by calling "dmsetup lstag" (or maybe lsattr ;)


More information about the linux-lvm mailing list