Instead of using only the 3rd element return the entire string after
the split to handle device names with dashes.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
Closes #15567
if is_linux; then
if is_real_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
- | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3
+ | awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3-
elif is_mpath_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
| awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \