Linux命令-blkid命令(查看块设备的文件系统类型、LABEL、UUID等信息)

说明

在Linux下可以使用 blkid命令 对查询设备上所采用文件系统类型进行查询。blkid主要用来对系统的块设备(包括交换分区)所使用的文件系统类型、LABEL、UUID等信息进行查询。要使用这个命令必须安装e2fsprogs软件包。

语法

复制代码
blkid -L | -U
blkid [-c ] [-ghlLv] [-o] [-s ][-t ] -[w ] [ ...]
blkid -p [-s ] [-O ] [-S ][-o] ...
blkid -i [-s ] [-o] ...

选项

复制代码
-c <file> # 指定cache文件(default: /etc/blkid.tab, /dev/null = none)
-d # don't encode non-printing characters
-h # 显示帮助信息
-g # garbage collect the blkid cache
-o <format> # 指定输出格式
-k # list all known filesystems/RAIDs and exit
-s <tag> # 显示指定信息,默认显示所有信息
-t <token> # find device with a specific token (NAME=value pair)
-l # look up only first device with token specified by -t
-L <label> # convert LABEL to device name
-U <uuid> # convert UUID to device name
-v # 显示版本信息
-w <file> # write cache to different file (/dev/null = no write)
<dev> # specify device(s) to probe (default: all devices)
Low-level probing options:
-p # low-level superblocks probing (bypass cache)
-i # gather information about I/O limits
-S <size> # overwrite device size
-O <offset> # probe at the given offset
-u <list> # filter by "usage" (e.g. -u filesystem,raid)
-n <list> # filter by filesystem type (e.g. -n vfat,ext3)

示例

  1. 列出当前系统中所有已挂载文件系统的类型:

    sudo blkid

  2. 显示指定设备 UUID:

    sudo blkid -s uuID /dev/sda5

  3. 显示所有设备 UUID:

    sudo blkid-s UUID

  4. 显示指定设备 LABEL:

    sudo blkid -s LABEL /dev/sda5

  5. 显示所有设备 LABEL:5、

    sudo blkid -S LABEL

  6. 显示所有设备文件系统:6、

    sudo blkid -s TYPE

  7. 显示所有设备:

    sudo blkid o device

  8. 以列表方式查看详细信息:

    sudo blkid o list

相关推荐
Configure-Handler1 小时前
linux-kernel-fault-codes
linux·运维·服务器
运维行者_1 小时前
通过Applications Manager的TCP监控确保无缝网络连接
运维·服务器·网络·数据库·人工智能
路人蛃1 小时前
【深入理解计算机系统】第二章第一节(信息存储)笔记
服务器·网络·笔记·计算机网络·系统架构
xiaoye-duck1 小时前
《Linux系统编程》Linux 进程间通信之 System V 共享内存:IPC 底层原理与实战
linux
一勺菠萝丶1 小时前
Linux 服务器临时用户创建与删除教程
linux·运维·服务器
lunzi_08261 小时前
《图解HTTP》--第5章-与HTTP协作的Web服务器
服务器·前端·http
曲幽1 小时前
你的FastAPI又在服务器上“跑不起来”了?来,今天咱把打包这件事彻底聊透
linux·windows·python·docker·fastapi·web·pyinstaller·nssm·services
2023自学中1 小时前
imx6ull 开发板,RTMP 推流本地视频 到虚拟机
linux·音视频·嵌入式·开发板
YOLO数据集集合2 小时前
YOLOv11+DeepSeek多技术融合电网缺陷巡检平台|绝缘子破损瓷瓶故障AI识别、前后端一体化电力运维管理系统落地开发
运维·人工智能·yolo
_可乐无糖2 小时前
踩完坑之后的总结:Windows安装docker
运维·windows·docker·容器