I know about df, of course, but df does not output volume labels. I have 5 USB hard drives plugged into my NAS box, and would love to know which is which.

Current df output:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              27G  2.2G   24G   9% /
none                   56M  476K   55M   1% /dev
none                   60M     0   60M   0% /dev/shm
none                   60M  332K   59M   1% /var/run
none                   60M     0   60M   0% /var/lock
none                   60M     0   60M   0% /lib/init/rw
/dev/sde1             150G  102G   48G  68% /media/usb0
/dev/sdb1             299G  196G  103G  66% /media/usb1
/dev/sdc1             233G  183G   51G  79% /media/usb2
/dev/sdd1             233G  209G   25G  90% /media/usb3
/dev/sdf1             150G  101G   49G  68% /media/usb4
  • Have you looked into using fdisk -l ? May 31, 2012 at 20:44
  • Strangely, fdisk -l isn't showing me any volume labels. It is giving me lots of nice info about partitions, though...
    – DavidH
    May 31, 2012 at 23:05

2 Answers 2


Sure. Here's a shell one-liner that wraps df with the information from blkid:

df | while read line; do dev=${line%% *}; \
  blkid -s LABEL $dev | sed 's/.*LABEL=//; s/"//g'; \
  echo "$line"; done

That will print the label before each line from df, when there is a label. You can play around with it to suit the formatting to taste.


You can use df to find out the disk space information and use blkid -o list to obtain information about the disk labels and UUIDs.

# blkid -o list
device     fs_type label    mount point    UUID
/dev/sda1  ext4             /              2ea411b8-f6eb-456b-9ac8-efc1f264bee4
/dev/sda5  swap             <swap>         e5732469-d123-4f24-948b-ab356576c140

You have to be root to see the label and UUID values.

  • Funny... blkid isn't reading my filesystem's label although I can see it with e2label.
    – devius
    May 31, 2012 at 22:55
  • Thanks. There isn't any way to get both volume labels and disk space usage back from the same utility, is there? It's easy enough to cross-reference between the two when I'm running them manually, but I'm trying to write a nightly script that will send me a disk space report for each drive (and include volume labels).
    – DavidH
    May 31, 2012 at 23:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.