Linux磁盤擴容

Linux磁盤擴容

例:

1.查看磁盤文件可用空間,發現可用磁盤空間只有30多個

[root@server tomcat-atm]# df -h

Linux磁盤擴容


2.查看磁盤空間對的詳細信息,可見有一個160G的磁盤

[root@servertomcat-atm]#fdisk-l

Linux磁盤擴容


3.創建磁盤分區,使用‘8e’類型來使其可用於LVM

[root@server tomcat-atm]# fdisk /dev/sdb

Linux磁盤擴容


4.創建物理卷

root@server tomcat-atm]# pvcreate /dev/sdb

Physical volume "/dev/sdb" successfully created

5. 檢查物理卷的創建情況

[root@server tomcat-atm]# pvdisplay

Linux磁盤擴容


6. 擴展卷組

[root@server tomcat-atm]# vgextend centos /dev/sdb

Volume group "centos" successfully extended

7. 查看卷組

[root@server tomcat-atm]# vgdisplay

Linux磁盤擴容


8. 擴展lvm卷

[root@servertomcat-atm]#lvextend-l+100%FREE /dev/mapper/centos-root

Size of logical volume centos/root changed from 35.47 GiB (9080 extents) to 185.50 GiB (47489 extents).

Logical volume root successfully resized.

9. 擴展容量

[root@server tomcat-atm]# xfs_growfs /dev/mapper/centos-root

Linux磁盤擴容


10.查看磁盤空間,可以看到擴容成功

Linux磁盤擴容


分享到:


相關文章: