xfs_growfs: / 不是已安裝的 XFS 檔案系統

xfs_growfs: / 不是已安裝的 XFS 檔案系統

我有一個虛擬專用伺服器,剛剛升級了硬碟空間,但無法擴展我的驅動器,至少我不知道如何擴展。

root@localhost:~# xfs_growfs /
xfs_growfs: / is not a mounted XFS filesystem

硬體

 *-scsi:0
      physical id: 87
      logical name: scsi2
    *-disk
         description: SCSI Disk
         product: Virtual disk
         vendor: VMware
         physical id: 0.0.0
         bus info: scsi@2:0.0.0
         logical name: /dev/sda
         version: 2.0
         serial: 6000c29d6dd9f71e6d153468cd60d2fb
         size: 160GiB (171GB)
         capabilities: partitioned partitioned:dos
         configuration: ansiversion=6 logicalsectorsize=512 sectorsize=512 signature=520f1760
       *-volume:0
            description: EXT4 volume
            vendor: Linux
            physical id: 1
            bus info: scsi@2:0.0.0,1
            logical name: /dev/sda1
            logical name: /boot
            version: 1.0
            serial: de2cb53e-6086-4fd5-99a9-1c22674a4f91
            size: 487MiB
            capacity: 487MiB
            capabilities: primary bootable journaled extended_attributes large_files huge_files dir_nlink 64bit extents ext4 ext2 initialized
            configuration: created=2021-05-20 11:12:55 filesystem=ext4 lastmountpoint=/boot modified=2022-01-05 19:12:46 mount.fstype=ext4 mount.options=rw,relatime mounted=2022-01-05 18:58:01 state=mounted
       *-volume:1
            description: Linux LVM Physical Volume partition
            physical id: 2
            bus info: scsi@2:0.0.0,2
            logical name: /dev/sda2
            serial: R5VWXg-jamB-5dWM-PpwY-7a49-LRz7-Vrvdl2
            size: 9751MiB
            capacity: 79GiB
            capabilities: primary multi lvm2

root@localhost:~# fdisk -l
Disk /dev/sda: 160 GiB, 171798691840 bytes, 335544320 sectors
Disk model: Virtual disk    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x520f1760

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1  *      2048    999423    997376   487M 83 Linux
/dev/sda2       999424 335544286 334544863 159.5G 8e Linux LVM


Disk /dev/mapper/vg00-lv00: 1.93 GiB, 2046820352 bytes, 3997696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg00-lv01: 77.63 GiB, 83336626176 bytes, 162766848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

讓我困惑的是,這裡說它確實有 160GB,/dev/sda2 999424 335544286 334544863 159.5G 8e Linux LVM但當我檢查它時卻沒有:

root@localhost:~# df -h
Filesystem             Size  Used Avail Use% Mounted on
udev                   3.9G     0  3.9G   0% /dev
tmpfs                  794M  1.2M  793M   1% /run
/dev/mapper/vg00-lv01   77G   31G   43G  43% /
tmpfs                  3.9G   16K  3.9G   1% /dev/shm
tmpfs                  5.0M     0  5.0M   0% /run/lock
tmpfs                  3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1              456M  145M  278M  35% /boot
tmpfs                  794M     0  794M   0% /run/user/0

我想知道是否需要重新啟動伺服器?

答案1

分區類型為左心室容量這表示您的根分割區是一個邏輯磁碟區 (LV)。邏輯磁碟區屬於由一個或多個實體磁碟區 (PV) 組成的磁碟區組 (VG)。嘗試這個:

vgdisplay -v
# Note the following values:
# PV Name, e. g. '/dev/vda3' (physical volume)
# LV Path, e. g. '/dev/ubuntu-vg/ubuntu-lv' (logical volume)

growpart <DISK> <PARTITION_NUMBER> # e.g. 'growpart /dev/vda 3'
pvresize <PV_NAME> # Resize the physical volume
lvresize <LV_NAME> -l 100%VG # Logical Volume should get the whole space of the Volume Group
resize2fs <LV_NAME> # Resize the file system (e. g. ext4)

相關內容