# 디폴트 설치 경로
C:\Program Files\Oracle\VirtualBox
VBoxManage modifyhd "D:\Disk\VM\centos2\centos2.vdi" --resize 40960
$ fdisk -l
$ fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000aab80
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2611 20458496 8e Linux LVM
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (2611-5221, default 2611): 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-5221, default 5221): 5221
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 0x8e
Type 0 means free space to many systems
(but not to Linux). Having partitions of
type 0 is probably unwise. You can delete
a partition using the `d' command.
Changed system type of partition 3 to 0 (Empty)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 장치나 자원이 동작 중.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
$ roboot
$ pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created
$ vgextend centos /dev/sda3
vgextend [group][경로] 에서 group을 확인할 수 있는 명령어 $pvscan
참고 - https://fmyson.tistory.com/152
$ vgextend centos /dev/sda3
[Error] Couldn't create temporary archive name
남아 있는 용량이 너무 부족하거나, /etc/lvm/archive 가 읽기전용이기 때문이다.
나의 경우 몇 개의 파일을 지우고나니 자연스럽게 해결되었다.
결국 용량문제였다.
[해결]
참고 - https://unix.stackexchange.com/questions/389539/lvm-couldnt-create-temporary-archive-name/389542#389542
$ lvextend --size +20g /dev/centos/root
[Error] 에러코드 실종
[해결]
$ lvextend --size +19.99g /dev/centos/root
$ resize2fs /dev/centos/root
[Error] resize2fs: Bad magic in super-block while trying to open /dev/centos/root
Couldn't find valid filesystem superblock.
[해결]
$ xfs_growfs /dev/centos/root
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.7M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 37G 17G 21G 46% /
/dev/sda1 1014M 195M 820M 20% /boot
tmpfs 379M 0 379M 0% /run/user/0