Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Which bash command shows the volume label?
/sbin/blkid /dev/sdXY # needs rootpriv for internal drives
ls -l /dev/disk/by-label/ | grep sdXY # workaround for unprivileged users
To display the label for the currently mounted partition at / use:
lsblk -o LABEL,MOUNTPOINT | grep " /$" | cut -d' ' -f1
Added benefit no sudo required.