原本VM是給6G,根目錄空間只有3.4G,拿來測試SQL Server on Linux不太夠

1.先在vCenter中把該vm的硬碟的空間加大,此例是6G調大到12G
2.先查看磁碟列表
lsblk 可列出系統上的所有磁碟列表

parted 列出磁碟的分割表類型與分割資訊
parted /dev/sda print
因為Centos 7還是MBR的分割表,得用fdisk來分割
來看一下分割的格式
fdisk -l

可看到已經抓到12G了
如果沒更新可重新掃瞄硬碟一下
echo 1 > /sys/block/sda/device/rescan
3.新增分割區sda3
fdisk /dev/sda


4.用partprobe 更新 Linux 核心的分割表資訊(強制生效)
partprobe5.建立新的PV
pvcreate /dev/sda3

6.將VG擴充 (先用vgdisplay確定 VG Name)
vgdisplay
vgextend centos /dev/sda3

7.將LV擴充
lvextend -l+100%FREE /dev/centos/root
lvdisplay /dev/centos/root

8.將filesystem xfs擴充
xfs_growfs /dev/mapper/centos-root

9.完成


parted 列出磁碟的分割表類型與分割資訊
parted /dev/sda print

因為Centos 7還是MBR的分割表,得用fdisk來分割
來看一下分割的格式
fdisk -l

可看到已經抓到12G了
如果沒更新可重新掃瞄硬碟一下
echo 1 > /sys/block/sda/device/rescan
3.新增分割區sda3
fdisk /dev/sda



4.用partprobe 更新 Linux 核心的分割表資訊(強制生效)
partprobe5.建立新的PV
pvcreate /dev/sda3

6.將VG擴充 (先用vgdisplay確定 VG Name)
vgdisplay

vgextend centos /dev/sda3

7.將LV擴充
lvextend -l+100%FREE /dev/centos/root
lvdisplay /dev/centos/root

8.將filesystem xfs擴充
xfs_growfs /dev/mapper/centos-root

9.完成

0 意見:
張貼留言