* Allow symlinks as target device (for supporting /dev/disk/by-id)
* Use correct test (-L) for checking if it is a symlink
Co-authored-by: Jakob Lell <jakob@srlabs.com>
+ # Resolve symlinks now, will be needed to look up information about the device in
+ # the /sys/ filesystem, for example /sys/class/block/${DISK#/dev/}/start
+ # The main use case is supporting /dev/disk/by-id/ symlinks instead of raw devices
+ if [ -L "$DISK" ]; then
+ DISK=$(readlink -e -n "$DISK")
+ fi