Centos

為什麼 CentOS 7 中沒有一致地報告 DATA 分區?

  • March 20, 2019

為什麼當我使用df -T -hparted ... print和時,在 CentOS 7 安裝過程中創建的 DATA 分區的圖片不一致/衝突fdisk -l 萬一這很重要,請使用 xfs 文件系統,因為這是預設設置。

該過程的背景是:

在最近安裝 CentOS 7 的過程中,我在安裝目標部分選擇了手動分區。 此連結中的教程包含說明安裝過程的螢幕截圖,創建 DATA 分區的過程中的螢幕如下所示(來自同一教程)。

(來源:tecmint.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  

您似乎選擇使用邏輯卷 (LVM) 而不是分區。這些不是分區,而是使用不同的機制進行管理。

嘗試使用 LVM 命令,例如sudo lvm lvs. 這應該列出邏輯卷。

引用自:https://unix.stackexchange.com/questions/231627