I have the following problem: I have a machine running arch and which contains a encrypted LV in a LVM. Inside the (encrypted) LV is another PV located. So I have in fact two VGs: One which contains the unencrypted data and one that contains only encrypted data.
I am now trying to get things running smoothly. I have scripts to scan for the PV in the encrypted volume and mount things. Unfortunately this does not work well due to timing problems.
As far as I can tell, when I invoke pvscan
, vgscan
or lvscan
the disks are searched for a LVM signature and if such is found the new VG is activated. This works so far. Then udev
is notified and creates different links under /dev
.
Unfortunately this happens asynchronously. Thus my script continued running and did not find the links needed to check/mount the file systems.
So my questions:
- Is there a possibility to wait for
udev
until all links are generated and ready to be used? - Is there a possibility to register a rule in
udev
that will call a script with all links as parameters/environ variables/...? - Is there a possibility to register a rule that matches a link generated via
udev
instead the block device itself? - Is there a way to wait until
vgscan
& Co. have terminated andudev
has settled?
If you have another idea, I would like to hear it.