HOW TO RENAME VG (VOLUME GROUP ) IN LINUX

In this post i’ll show you how to rename vg ( volume group ) in linux

  • First lets create partition .
[root@localhost ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 68514.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57368-68514, default 57368):
Using default value 57368
Last cylinder or +size or +sizeM or +sizeK (57368-68514, default 68514): +500M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57430-68514, default 57430):
Using default value 57430
Last cylinder or +size or +sizeM or +sizeK (57430-68514, default 68514): +500M
  • Command w to save
Command (m for help): w
  • Run partprobe command to save all changes made .
[root@localhost ~]# partprobe /dev/sda
  • Now change these partitions into pv ( physical volumes )
[root@localhost ~]# pvcreate /dev/sda5 /dev/sda6
  Wiping software RAID md superblock on /dev/sda5
  Physical volume "/dev/sda5" successfully created
  Wiping software RAID md superblock on /dev/sda6
  Physical volume "/dev/sda6" successfully created
  • Then create vg ( volume group ) over physical volume
[root@localhost ~]# vgcreate vg11 /dev/sda5 /dev/sda6
  Volume group "vg11" successfully created
  • Check by vgs command
[root@localhost ~]# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg11   2   0   0 wz--n- 968.00M 968.00M
  • Now type below command to rename vg
  • To rename volume group type –   vgrename   currentvg   newname for vg
[root@localhost ~]# vgrename /dev/vg11 /dev/3usa
  Volume group "vg11" successfully renamed to "3usa"
  • Again check by vgs command
[root@localhost ~]# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  3usa   2   0   0 wz--n- 968.00M 968.00M

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s