Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

第 67 章 Logical Volume Manager (LVM)

目錄

67.1. 物理卷管理(physical volume)
67.1.1. pvcreate
67.1.2. pvdisplay
67.1.3. pvs
67.2. 卷組管理(Volume Group)
67.2.1. vgcreate
67.2.2. vgdisplay
67.2.3. vgs
67.2.4. vgchange
67.2.5. vgextend
67.2.6. vgreduce
67.3. 邏輯卷管理(logical volume)
67.3.1. lvcreate
67.3.1.1. snapshot
67.3.2. lvdisplay
67.3.3. lvremove
67.3.3.1. snapshot
67.4. Format
67.5. mount
67.5.1. lv
67.5.2. snapshot
67.6. snapshot backup

vg,lv命名規則,建議採用:

1. /dev/vg00/lvol00

2. /dev/VolGroup00/LogVol00

lvm 創建流程 pvcreate - vgcreate - lvcreate

# pvcreate /dev/sdb4
  Physical volume "/dev/sdb4" successfully created

# vgcreate vg1 /dev/sdb4
  Volume group "vg1" successfully created

# lvcreate -l 10239 -n lv0 vg1
  Logical volume "lv0" created
	

67.1. 物理卷管理(physical volume)

67.1.1. pvcreate

將整個硬碟劃為物理卷

# pvcreate /dev/hdb
			

將單個分區創建為物理卷的命令為:

# pvcreate /dev/hda5
			

實例

# pvcreate /dev/sdb4
  Physical volume "/dev/sdb4" successfully created
			

67.1.2. pvdisplay

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb4
  VG Name               vg1
  PV Size               1.02 TiB / not usable 4.90 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              267301
  Free PE               257062
  Allocated PE          10239
  PV UUID               g2xLQ8-7tgm-iNZc-8dVq-vo3z-CFJp-LryYAs

			

67.1.3. pvs

# pvs
  PV         VG   Fmt  Attr PSize PFree
  /dev/sdb4  vg1  lvm2 a-   1.02t 1004.15g