列出所有分区标签


Answers:


11

只是标签?

$ 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

如果您愿意使用sudoblkid需要),那么还可以使用以下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

1
太好了,我将sudo lsblk -f在脚本unix.stackexchange.com/questions/157102/…中使用
rubo77 2014年

sudo不需要在Artful盒子上。
Gringo Suave

@GringoSuave很棒,那个错误终于被修复了。
muru

15
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

2
正是我一直在寻找的!谢谢!
johann_ka

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.