7

Given the partition device file /dev/sdh1, I need to find out the label of this device.

dmesg doesn't mention its label while GParted reveals that it is called H2N_SD:

gparted info about /dev/sdh

I need to build a way to be able to run something similar to

$ partlabel /dev/sdh1
H2N_SD

This question is nearly the opposite of getting device name & mount point from label.

1 Answer 1

5

Use blkid:

$ blkid -s LABEL -o value /dev/sdh1
H2N_SD
1
  • 5
    Or lsblk -no label /dev/sdh1... Nov 8, 2015 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .