Virtual Private Server가 있고 방금 HDD 공간을 업그레이드했지만 드라이브를 확장할 수 없습니다. 적어도 방법을 모르겠습니다.
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
파티션 유형은 다음과 같습니다.LVM이는 루트 파티션이 논리 볼륨(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)