티스토리 뷰

EN/Debian 6

Debian 6 LVM Volume Groups

ServerWorld 2016.05.23 22:16

Debian 6 LVM Volume Groups


Volume Groups




1. Create a Volume Group


root@debian:~# vgcreate VZ /dev/sdb1   # create a Volume group 'VZ'

  Volume group "VZ" successfully created


# insert a space like below if you specify some devices

root@debian:~# vgcreate VZ /dev/sdb1 /dev/sdd1

  Volume group "VZ" successfully created

  

  

  

2. Display Volume Groups


root@debian:~# vgdisplay

  --- Volume group ---

  VG NameVZ

  System ID

  Formatlvm2

  Metadata Areas 2

  Metadata Sequence No1

  VG Accessread/write

  VG Statusresizable

  MAX LV0

  Cur LV0

  Open LV0

  Max PV0

  Cur PV2

  Act PV2

  VG Size227.89 GB

  PE Size4.00 MB

  Total PE 58339

  Alloc PE / Size0 / 0

  Free PE / Size58339 / 227.89 GB

  VG UUIDAFGDj5-xi8k-e3JO-Sj0j-wVsx-pyA2-3MosMH

  

  

  

3. Change name of Volume Group


root@debian:~# vgrename VZ RX-7# change current name 'VZ' to new name 'RX-7'


  Volume group "VZ" successfully renamed to "RX-7"

root@debian:~# vgdisplay

  --- Volume group ---

  VG NameRX-7# changed

  System ID

  Formatlvm2

  Metadata Areas 2

  Metadata Sequence No1

  VG Accessread/write

  VG Statusresizable

  MAX LV0

  Cur LV0

  Open LV0

  Max PV0

  Cur PV2

  Act PV2

  VG Size227.89 GB

  PE Size4.00 MB

  Total PE 58339

  Alloc PE / Size0 / 0

  Free PE / Size58339 / 227.89 GB

  VG UUIDAFGDj5-xi8k-e3JO-Sj0j-wVsx-pyA2-3MosMH

  

  

  

4. Output reports of Volume Groups


root@debian:~# vgs

  VG #PV#LV#SNAttrVSizeVFree

  VZ200wz--n-227.89G227.89G

  Xen2350wz--n-227.06G84.06GG

  

  

  

5. Scan Volume Groups


root@debian:~# vgscan

  Reading all physical volumes. This may take a while...

  Found volume group "VZ" using metadata type lvm2

  Found volume group "Xen" using metadata type lvm2


  

  

6. Extend a Volume Group


root@debian:~# vgdisplay

  --- Volume group ---

  VG NameVZ

  System ID

  Formatlvm2

  Metadata Areas 1

  Metadata Sequence No1

  VG Accessread/write

  VG Statusresizable

  MAX LV0

  Cur LV0

  Open LV0

  Max PV0

  Cur PV1

  Act PV1

  VG Size153.38 GB

  PE Size4.00 MB

  Total PE39266

  Alloc PE / Size0 / 0

  Free PE / Size39266 / 153.38 GB

  VG UUIDl4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9


root@debian:~# vgextend VZ /dev/sdd1   # add sdd1 in VZ

  Volume group "VZ" successfully extended

root@debian:~# vgdisplay

  --- Volume group ---

  VG NameVZ

  System ID

  Formatlvm2

  Metadata Areas 2

  Metadata Sequence No2

  VG Accessread/write

  VG Statusresizable

  MAX LV0

  Cur LV0

  Open LV0

  Max PV0

  Cur PV2

  Act PV2

  VG Size227.89 GB

  PE Size4.00 MB

  Total PE58339

  Alloc PE / Size0 / 0

  Free PE / Size58339 / 227.89 GB

  VG UUIDl4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9


   

  

7. Reduce a Volume Group

root@debian:~# vgreduce VZ /dev/sdd1   # remove sdd1 from VZ

  Removed "/dev/sdd1" from volume group "VZ"

root@debian:~# vgdisplay

  --- Volume group ---

  VG NameVZ

  System ID

  Formatlvm2

  Metadata Areas 1

  Metadata Sequence No3

  VG Accessread/write

  VG Statusresizable

  MAX LV0

  Cur LV0

  Open LV0

  Max PV0

  Cur PV1

  Act PV1

  VG Size153.38 GB

  PE Size4.00 MB

  Total PE39266

  Alloc PE / Size0 / 0

  Free PE / Size39266 / 153.38 GB

  VG UUIDl4fisd-ke1o-E0HA-eICL-QuZN-jt30-652mC9

  

  

  

8. Remove a Volume Group


root@debian:~# vgchange -a n VZ# make VZ non-active first

  0 logical volume(s) in volume group "VZ" now active

root@debian:~# vgremove VZ# remove VZ

  Volume group "VZ" successfully removed


※ Next manual


저작자 표시 비영리 변경 금지
신고

'EN > Debian 6' 카테고리의 다른 글

Debian 6 Clamav - Anti-Virus  (0) 2016.05.23
Debian 6 LVM Logical Volumes  (0) 2016.05.23
Debian 6 LVM Volume Groups  (0) 2016.05.23
Debian 6 LVM Physical Volumes  (0) 2016.05.23
Debian 6 Create SSL Certificates  (0) 2016.05.23
Debian 6 Desktop Env VNC Server  (0) 2016.05.23
댓글