Currently I use the following script to get the target mount point of a specific Logical Volume.

df $(lvs --noheadings -o path VG_NAME/lv_name) | tail -1 | awk '{print $1, $NF}'

findmnt -l | grep $(lvdisplay --noheadings -C -o "lv_dm_path" VG_NAME/lv_name) | awk '{print $2, $1}'

Any shorter way to achieve this?

  • 1
    Is there some reason why you aren't reading /proc/mounts or /etc/fstab? – telcoM Mar 6 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.