Hot answers tagged hot-plug
3
Yes, you can find the information in /sys/block/$DEVICE/slaves. If you only have the canonical name you can use readlink to get the details, e.g:
devdm="$(readlink -f /dev/mapper/extern-1-crypt)"
dm="${devdm#/dev/}"
ls /sys/block/$dm/slaves/
If you want to remove all you can just utilize directly the sys filesystem:
echo 1 > ...
2
There is a lot of possibilities:
:> # 1
:> pvscan
:> # 2
:> vgscan -v extern-1
:> # 3
:> dmsetup table /dev/mapper/extern-1-crypt
:> # 4
:> cd /sys/devices/virtual/block/
:> for dmdev in dm-*; do
:> if [ xyz = $(< "${dmdev}/dm/name") ]; then
:> ls -l "${dmsev}/slaves/"
:> fi
:> done
Or take the "dm-" ...
Only top voted, non community-wiki answers of a minimum length are eligible
