Linux Command – How to List Partition Labels from the Command Line

command linedisklinuxpartition

Is there a command that will list all partitions along with their labels? sudo fdisk -l and sudo parted -l don't show labels by default.

EDIT: (as per comment below) I'm talking about ext2 labels – those that you can set in gparted upon partitioning.

EDIT2: The intent is to list unmounted partitions (so I know which one to mount).

Best Answer

With udev, You can use

ls -l /dev/disk/by-label

to show the symlinks by label to at least some partition device nodes.

Not sure what the logic of inclusion is, possibly the existence of a label.

Related Question