Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 97143  / 1 Year ago, sat, april 8, 2023, 5:59:58

Is there a command to list all partition labels?



I can list the partitions with



sudo fdisk -l


but it doesn't show the labels of unmounted partitions.


More From » disk

 Answers
7

Simply labels?



$ ls /dev/disk/by-label/              
Download MuruHome Ubuntu Windows8 arch


Or better:



$ tree /dev/disk/by-label/  # or use ls -l
/dev/disk/by-label/
├── Download -> ../../sda6
├── MuruHome -> ../../sdc2
├── Ubuntu -> ../../sdc1
├── Windows8 -> ../../sda2
└── arch -> ../../sda1


If you're willing to use sudo (which blkid requires), then you could also use the lsblk command:



$ sudo lsblk -o NAME,LABEL
NAME LABEL
sda
├─sda1 System Reserved
├─sda2 windows
├─sda3 ubuntu
├─sda4
├─sda5 arch
├─sda6
│ └─lvmg-homelvm (dm-0) homelb
└─sda7
sdb
└─sdb1
└─lvmg-homelvm (dm-0) homelb

[#23090] Sunday, April 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
etzelmortg

Total Points: 430
Total Questions: 105
Total Answers: 106

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;