I need an algorithm, that can determine the possible children, parents and siblings for any given block device (virtual or physical). In the past I have solved that problem for multipath devices and LVM Logical Volumes, but I'd like to have a complete algorithm.
For example a multipath device is given. That device could have four paths (disks), and the device could be partitioned. One partition could be part of an MD-RAID, the RAID could be partitioned, too, and one such partition could be used as LVM Physical Volume (PV) to build a Volume Group (VG) with several Logical Volumes (LV).