Tuesday, September 3, 2013

Removing LVM disk


How to remove physical disk from the system and add new LUN
1. List Volume group
# vgs; pvs
2. Remove the device
# vgreduce dbdatavg DB004p1
3. Remove physical device
# pvremove DB004p1
4.



[root@mylnx200 mapper]# vgs
  VG       #PV #LV #SN Attr   VSize   VFree
  dbdatavg   5   2   0 wz--n- 809.17G 304.17G
  dblogvg    5   4   0 wz--n- 505.72G  65.72G
  system     1   3   0 wz--n-  84.44G  52.44G
[root@mylnx200 mapper]# pvs
  PV                 VG       Fmt  Attr PSize   PFree
  /dev/cciss/c0d0p5  system   lvm2 a--   84.44G  52.44G
  /dev/mpath/DB001p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB002p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB003p1 dbdatavg lvm2 a--  202.29G 101.88G
  /dev/mpath/LOG01p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG02p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG03p1 dblogvg  lvm2 a--  101.14G      0
  /dev/mpath/LOG04p1 dblogvg  lvm2 a--  101.14G  63.43G
  /dev/mpath/LOG05p1 dblogvg  lvm2 a--  101.14G      0
  DB004p1            dbdatavg lvm2 a--  101.14G 101.14G
  DB005p1            dbdatavg lvm2 a--  101.14G 101.14G
  DB006p1                     lvm2 a--  101.15G 101.15G
  DB007p1                     lvm2 a--  101.15G 101.15G
  DB008p1                     lvm2 a--  101.15G 101.15G

[root@mylnx200 mapper]# vgreduce  dbdatavg DB004p1
  Removed "DB004p1" from volume group "dbdatavg"
[root@mylnx200 mapper]# vgreduce dbdatavg DB005p1
  Removed "DB005p1" from volume group "dbdatavg"
[root@mylnx200 mapper]# pvremove DB004p1
  Labels on physical volume "DB004p1" successfully wiped
[root@mylnx200 mapper]# pvremove DB005p1
  Labels on physical volume "DB005p1" successfully wiped
[root@mylnx200 mapper]# pvremove DB006p1
  Labels on physical volume "DB006p1" successfully wiped
[root@mylnx200 mapper]# pvremove DB007p1
  Labels on physical volume "DB007p1" successfully wiped
[root@mylnx200 mapper]# pvremove DB008p1
  Labels on physical volume "DB008p1" successfully wiped
[root@mylnx200 mapper]# pvs
  PV                 VG       Fmt  Attr PSize   PFree
  /dev/cciss/c0d0p5  system   lvm2 a--   84.44G  52.44G
  /dev/mpath/DB001p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB002p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB003p1 dbdatavg lvm2 a--  202.29G 101.88G
  /dev/mpath/LOG01p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG02p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG03p1 dblogvg  lvm2 a--  101.14G      0
  /dev/mpath/LOG04p1 dblogvg  lvm2 a--  101.14G  63.43G
  /dev/mpath/LOG05p1 dblogvg  lvm2 a--  101.14G      0

[root@mylnx200 mapper]# pvcreate /dev/mapper/DB004p1
  Writing physical volume data to disk "DB004p1"
  Physical volume "DB004p1" successfully created
[root@mylnx200 mapper]# pvcreate /dev/mapper/DB005p1
  Writing physical volume data to disk "DB005p1"
  Physical volume "DB005p1" successfully created
[root@mylnx200 mapper]# pvcreate /dev/mapper/DB006p1
  Writing physical volume data to disk "DB006p1"
  Physical volume "DB006p1" successfully created
[root@mylnx200 mapper]# pvs
  PV                 VG       Fmt  Attr PSize   PFree
  /dev/cciss/c0d0p5  system   lvm2 a--   84.44G  52.44G
  /dev/mpath/DB001p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB002p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB003p1 dbdatavg lvm2 a--  202.29G 101.88G
  /dev/mpath/LOG01p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG02p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG03p1 dblogvg  lvm2 a--  101.14G      0
  /dev/mpath/LOG04p1 dblogvg  lvm2 a--  101.14G  63.43G
  /dev/mpath/LOG05p1 dblogvg  lvm2 a--  101.14G      0
  DB004p1                     lvm2 a--  101.15G 101.15G
  DB005p1                     lvm2 a--  101.15G 101.15G
  DB006p1                     lvm2 a--  101.15G 101.15G
[root@mylnx200 mapper]# pvcreate /dev/mapper/DB007p1
  Writing physical volume data to disk "DB007p1"
  Physical volume "DB007p1" successfully created
[root@mylnx200 mapper]# pvcreate /dev/mapper/DB008p1
  Writing physical volume data to disk "DB008p1"
  Physical volume "DB008p1" successfully created
[root@mylnx200 mapper]# pvs
  PV                 VG       Fmt  Attr PSize   PFree
  /dev/cciss/c0d0p5  system   lvm2 a--   84.44G  52.44G
  /dev/mpath/DB001p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB002p1 dbdatavg lvm2 a--  202.29G      0
  /dev/mpath/DB003p1 dbdatavg lvm2 a--  202.29G 101.88G
  /dev/mpath/LOG01p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG02p1 dblogvg  lvm2 a--  101.14G   1.14G
  /dev/mpath/LOG03p1 dblogvg  lvm2 a--  101.14G      0
  /dev/mpath/LOG04p1 dblogvg  lvm2 a--  101.14G  63.43G
  /dev/mpath/LOG05p1 dblogvg  lvm2 a--  101.14G      0
  DB004p1                     lvm2 a--  101.15G 101.15G
  DB005p1                     lvm2 a--  101.15G 101.15G
  DB006p1                     lvm2 a--  101.15G 101.15G
  DB007p1                     lvm2 a--  101.15G 101.15G
  DB008p1                     lvm2 a--  101.15G 101.15G
[root@mylnx200 mapper]#

No comments:

Post a Comment