为什么 CentOS 7 中的 DATA 分区报告不一致?

为什么 CentOS 7 中的 DATA 分区报告不一致?

df -T -h当我使用、parted ... print和 时,为什么在 CentOS 7 安装过程中创建的 DATA 分区的图片不一致/冲突fdisk -l 如果重要的话,请使用 xfs 文件系统,因为这是默认的。

该过程的背景是:

在最近安装 CentOS 7 的过程中,我在安装目标部分选择了手动分区。 这个链接里的教程包含说明安装过程的屏幕截图,创建 DATA 分区的过程中的屏幕如下所示(来自同一教程)。


(来源:howtoing.com

在上面的屏幕截图中,我的安装向导自动创建了一个/homeDATA 分区。我缩小了自动创建的分区,并使用屏幕截图中显示的屏幕/home创建了四个新的 300 GB DATA 分区,名为/public/vpn/data、 ,然后完成了安装。/test


df -T -h结果:


在最终的安装中,键入df -T -h结果:

[root@localhost ~]# df -T -h
Filesystem              Type      Size  Used Avail Use% Mounted on
/dev/mapper/centos-root xfs        50G 1016M   49G   2% /
devtmpfs                devtmpfs  3.8G     0  3.8G   0% /dev
tmpfs                   tmpfs     3.8G     0  3.8G   0% /dev/shm
tmpfs                   tmpfs     3.8G   17M  3.8G   1% /run
tmpfs                   tmpfs     3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/sda2               xfs       494M  139M  355M  29% /boot
/dev/mapper/centos-home xfs       605G   33M  605G   1% /home
/dev/sda1               vfat      200M  9.8M  191M   5% /boot/efi
/dev/mapper/centos-01   xfs       280G   33M  280G   1% /public
/dev/mapper/centos-02   xfs       280G   33M  280G   1% /data
/dev/mapper/centos-03   xfs       280G   33M  280G   1% /test
/dev/mapper/centos-00   xfs       280G   33M  280G   1% /vpn

**parted ... quit结果:


然而parted似乎并没有看到这四个新的DATA分区,如下图:

[root@localhost ~]# parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD20EZRX-00D (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  211MB   210MB   fat16        EFI System Partition  boot
 2      211MB   735MB   524MB   xfs
 3      735MB   1912GB  1911GB

fdisk -l结果:


结果似乎是上面显示的和结果fdisk -l的混合,但这里将四个新分区视为一个单独的类别: parteddf

[root@localhost ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt

#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      1435647    500M  Microsoft basic 
 3      1435648   3734071295    1.8T  Microsoft basic 

Disk /dev/mapper/luks-49495fd0-6120-48d9-915a-d88903765021: 1911.1 GB, 1911107354624 bytes, 3732631552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-swap: 8187 MB, 8187281408 bytes, 15990784 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-home: 649.2 GB, 649223733248 bytes, 1268015104 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-00: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-01: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-02: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-03: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

(parted) quit  

答案1

您似乎选择使用逻辑卷 (LVM) 而不是分区。这些不是分区,并且使用不同的机制进行管理。

尝试使用 LVM 命令,例如sudo lvm lvs.这应该列出逻辑卷。

相关内容