centos 查看磁盘分区的文件系统类型

2023-03-07 14:43:20 浏览数 (2)

1. lsblk -f

这个命令是查看系统可以识别出的所有分区的文件系统类型

代码语言:javascript复制
NAME            FSTYPE      LABEL UUID                                   MOUNTPOINT
sda                                                                  
├─sda1          xfs               d296d532-3b6f-4356-97d5-8eea439d3187   /boot
└─sda2          LVM2_member       CY71gX-G43e-taNL-1XFc-LyU1-939X-iqPF1t 
  ├─centos-root xfs               dac3b400-0af5-43c6-9bd9-a7867bfb3051   /
  ├─centos-swap swap              fc6c66c0-0790-4b9d-89b1-068410710219   [SWAP]
  └─centos-home xfs               f07d25d8-9813-4c4e-a520-c6988bba1e75   
nvme0n1                                                              
└─nvme0n1p1     ext3              93f8545f-8fef-4f33-ad13-419baba99a54   /home

2. blkid

查看已格式化分区的 UUID 和文件系统。使用 blkid 可以输出分区或分区的文件系统类型,查看 TYPE 字段输出。

代码语言:javascript复制
/dev/mapper/centos-root: UUID="dac3b400-0af5-43c6-9bd9-a7867bfb3051" TYPE="xfs" 
/dev/sda2: UUID="CY71gX-G43e-taNL-1XFc-LyU1-939X-iqPF1t" TYPE="LVM2_member" 
/dev/nvme0n1p1: UUID="93f8545f-8fef-4f33-ad13-419baba99a54" TYPE="ext3" 
/dev/sda1: UUID="d296d532-3b6f-4356-97d5-8eea439d3187" TYPE="xfs" 
/dev/mapper/centos-swap: UUID="fc6c66c0-0790-4b9d-89b1-068410710219" TYPE="swap" 
/dev/mapper/centos-home: UUID="f07d25d8-9813-4c4e-a520-c6988bba1e75" TYPE="xfs" 
/dev/nvme0n1: PTTYPE="dos" 

3. parted -l

parted -l 命令会输出分区类型 ( msdos gpt ) 参数 l (list)表示列出所有设备的分区信息。

代码语言:javascript复制
Model: Intel RMS25CB080 (scsi)
Disk /dev/sda: 249GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  标志
 1      1049kB  1075MB  1074MB  primary  xfs          启动
 2      1075MB  249GB   248GB   primary               lvm

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-home: 190GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  标志
 1      0.00B  190GB  190GB  xfs

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-swap: 4295MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     标志
 1      0.00B  4295MB  4295MB  linux-swap(v1)

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-root: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  标志
 1      0.00B  53.7GB  53.7GB  xfs

Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 1600GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  标志
 1      1049kB  1600GB  1600GB  primary  ext3

4. df -T

只可以查看已经挂载的分区和文件系统类型

代码语言:javascript复制
文件系统                类型          1K-块      已用      可用 已用% 挂载点
devtmpfs                devtmpfs  115411020         0 115411020    0% /dev
tmpfs                   tmpfs     115423048         0 115423048    0% /dev/shm
tmpfs                   tmpfs     115423048     19464 115403584    1% /run
tmpfs                   tmpfs     115423048         0 115423048    0% /sys/fs/cgroup
/dev/mapper/centos-root xfs        52403200   2526588  49876612    5% /
/dev/sda1               xfs         1038336    155008    883328   15% /boot
tmpfs                   tmpfs      23084612         0  23084612    0% /run/user/0
/dev/nvme0n1p1          ext3     1538158724 495456276 964561812   34% /home

我自己比较常用的是lsblk -f 好记,好用

债见

版权属于:七云‘s Blog

本文链接:https://cloud.tencent.com/developer/article/2235194

版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。

0 人点赞