Tag Info

Hot answers tagged

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-" ...


1

Ok, it's been a long time, but I'll still answer my question with the best option I found as of now. The best way is to create a udev rule, associated with some scripts (that will create / remove directories and mount / unmount removable devices), and attached to partition udev device event type. 1 - Creating add / remove scripts Add this script ...



Only top voted, non community-wiki answers of a minimum length are eligible