- VM increasing the size of Disk.
sudo fdisk -l
確認是否已經DISK空間是否擴增。sudo fdisk /dev/sda
[root@localhost ~]# fdisk /dev/sda Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
命令 (m 以獲得說明):p
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O 大小 (最小/最佳化):512 位元組 / 512 位元組 Disk label type: dos 磁碟識別碼:0x000c35eb
所用裝置 開機 開始 結束 區塊 識別號 系統 /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM
命令 (m 以獲得說明):n Partition type: p primary (2 primary, 0 extended, 2 free) e extended Select (default p): p 分割區編號 (3,4, default 3): 3 起初 sector (41943040-104857599, 預設 41943040): 使用預設值 41943040 最後 sector, +sectors 或 +大小{K,M,G} (41943040-104857599, 預設 104857599): 使用預設值 104857599 Partition 3 of type Linux and of size 30 GiB is set
命令 (m 以獲得說明):w 分割表已變更!
sudo reboot
重啟sudo pvcreate /dev/sda3
sudo vgextend centos /dev/sda3
可透過vgdisplay確認vg group namesudo lvextend -l +100%FREE /dev/mapper/centos-root
sudo xfs_growfs /dev/mapper/centos-root
,可透過lvdisplay確認lv狀況sudo df -lh