一 LVM管理
1. LVM 友善硬碟空間的管理,可以動态擴充磁盤空間,避免磁盤浪費。
2. 管理邏輯卷: 添加邏輯卷 擴充邏輯卷
3. 基本概念
Physical volumes(PV) :由1塊或多塊實體硬碟注冊為實體卷
Volume Groups(VG) : 由1塊或多塊PV組成 邏輯卷組
Logical volumes(LV): 邏輯卷是在 VG的基礎上劃分
二 LVM配置
建立實體卷
pvcreate /dev/vda3 /dev/vda4
2.建立VG
vgcreate vg-test /dev/vda3 /dev/vda4
3.建立LV
lvcreate -n hercules -L 2G vg-alpha
擴充邏輯卷
lvextend -l 128
lvextend -L +128M 添加128M空間
-L 128M 擴充到128M空間
xfs_growfs /mountpoint expands the file system to occupy the extended LV.
4. lvm顯示狀态
pvdisplay /dev/vda3
三 案例
1.建立2塊硬碟,建立vgtest,邏輯卷lv01并且格式化為xfs,并通過uuid挂載硬碟到/data下。
2.擴充邏輯卷lv01,擴充2G
lvextend -l +extents /dev/vgname/lvname
resize2fs /dev/vg-alpha/hercules
note:
xfs_growfs and resize2fs
本文轉自 woshiwei201 51CTO部落格,原文連結:http://blog.51cto.com/chenwei/1841956