When attaching to existing logical volumes, the file is tested against a list of VALID_RAW_CONTENT which is not always completely sensible for cases where lvm is used to manage logical volumes.
As an example, the logical volume's "device" /dev/example-group/example-disk would be a symlink back to /dev/dm-1, and as the symlink is checked, it would fail validation.
This change adds a behavior to check if the file is a symlink, and if so, to check whether the symlink points back to a /dev/dm-* device, and if so, the device is considered valid. If the file is not a symlink, the original logic is retained.
When attaching to existing logical volumes, the file is tested against a list of VALID_RAW_CONTENT which is not always completely sensible for cases where lvm is used to manage logical volumes. As an example, the logical volume's "device"
/dev/example-group/example-disk
would be a symlink back to/dev/dm-1
, and as the symlink is checked, it would fail validation.This change adds a behavior to check if the file is a symlink, and if so, to check whether the symlink points back to a /dev/dm-* device, and if so, the device is considered valid. If the file is not a symlink, the original logic is retained.