Answers:
只是标签?
$ ls /dev/disk/by-label/
Download MuruHome Ubuntu Windows8 arch
或更好:
$ tree /dev/disk/by-label/ # or use ls -l
/dev/disk/by-label/
├── Download -> ../../sda6
├── MuruHome -> ../../sdc2
├── Ubuntu -> ../../sdc1
├── Windows8 -> ../../sda2
└── arch -> ../../sda1
如果您愿意使用sudo
(blkid
需要),那么还可以使用以下lsblk
命令:
$ 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
sudo lsblk -f
在脚本unix.stackexchange.com/questions/157102/…中使用
sudo blkid -o list
列出所有带有标签的设备:
device fs_type label mount point UUID
----------------------------------------------------------------------------------
/dev/sda1 ntfs WINRE_DRV (not mounted) 604C3A6A4C3A3B5C
/dev/sda2 vfat SYSTEM_DRV (not mounted) 6C3C-72E3
/dev/sda3 vfat LRS_ESP (not mounted) 5240-1BEE
/dev/sda5 ntfs Windows8_OS /media/Win8 A47A42FF7A42CDAC
/dev/sda6 ntfs Daten /media/Daten 72860971860936DF
使用命令
lsblk -nPo MOUNTPOINT,UUID,LABEL
您将获得最适合您的需求的字段列表。