1833959 Members
2000 Online
110063 Solutions
New Discussion

Re: Removing the VG.

 
SOLVED
Go to solution
Prasad Joshi
Regular Advisor

Removing the VG.

Hi All,

These are the PV's in VG. As you can see c10t0d0 is an alternate path to c80t0d0. which means it is DMP.

sliam16:/ # vgdisplay -v vg01 | grep "PV Name"
PV Name /dev/dsk/c8t0d0
PV Name /dev/dsk/c10t0d0 Alternate Link

Now I want to remove this vg. But, I am not able to do it.

sliam16:/ # vgreduce vg01 /dev/dsk/c10t0d0
Device file path "/dev/dsk/c10t0d0" is an alternate path.
vgreduce: Couldn't delete physical volume:
No such device or address

sliam16:/ # vgreduce vg01 /dev/dsk/c8t0d0
Device file path "/dev/dsk/c8t0d0" is an primary link.
Removing primary link and switching to an alternate link.
vgreduce: Couldn't delete physical volume:
No such device or address

sliam16:/ # vgremove vg01
vgremove: Volume group "vg01" still contains more than one physical volume path.
vgremove: Couldn't remove volume group "vg01".

Can any one suggest what should i do?

Thanks & regards,
Prasad.
12 REPLIES 12
Enrico P.
Honored Contributor

Re: Removing the VG.

Hi,
you can try with

vgexport /dev/vg01

This remove your vg01 confguration.

Enrico
Siddhartha M
Frequent Advisor

Re: Removing the VG.

Could you try vgreduce with the -f option?
before you apply vgremove?

From the man page:

Force reduction of missing PVs from volume group: vg01
vgreduce -f /dev/vg01
Chan 007
Honored Contributor
Solution

Re: Removing the VG.

Hi,

Before doing vgexport you should do
vgchange -a n vg01
vgexport vg01

Chan
Asif Sharif
Honored Contributor

Re: Removing the VG.

Hi Prasad,

Please read the below fourm.

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1016761

Regards,
Asif Sharif
Regards,
Asif Sharif
m saravanan
Valued Contributor

Re: Removing the VG.


# vgexport /dev/vg01

This will do the needful

Regds,
Saravanan
Prasad Joshi
Regular Advisor

Re: Removing the VG.

Thanks for your replies.

Just having another question, When can we use vgremove command? Because vgexport and vgchamge commands removes the vg from configuration.

Then What is the use of vgremove command?

Thanks!
Prasad.


m saravanan
Valued Contributor

Re: Removing the VG.

Prasad,
vgremove is equivalent to the inverse of executing vgcreate for one physical volume. Wherein, vgexport simply removes the vg information from the system.

Normally "vgexport" is used in the situation where we use to move the vg between systems & to take map file. But, vgremove will remove information from the PV also. So one cannot reimport the VG, after the vgremove performed on that particular VG.


Regds,
Saravanan
Chan 007
Honored Contributor

Re: Removing the VG.

Hi,

From my understanding vgexport just assists you to manipulate LUNs/VG from one system to other (Keeping the data intact) & use mapfile to get it back.

Where for vgremove you need to remove all lvs by lvremove and then vgremove. You will have no data.

Chan
Prasad Joshi
Regular Advisor

Re: Removing the VG.

Hi All,

Thanks for your answers, they have solved my problem.

As Chan007 said some mapfile can be used to get back data after doing vgexport.

Can any one explore on that?
Which is this mapfile? What is exactly the procedure to do it? etc.


Thanks & regards,
Prasad.
Ninad_1
Honored Contributor

Re: Removing the VG.

Prasad,

If you want to say move disks between servers, or you have a cluster where the same VGs need to be available to the nodes in the cluster - in such scenario a map file is created with vgexport command, its distributed to the hosts which need to see these VGs and then imported there.
e.g.
host1
vgexport -m mapfile -pv /dev/vgname
This will create a mapfile due to -m option but will not actually export the VG due to -p option.
vgchange -a n /dev/vgname
vgexport /dev/vgname

Then you can copy this mapfile to say host2
on host2. Move the disks to host2 if not already visible.
vgimport -m mapfile /dev/vgname
vgchange -y /dev/vgname

Note there are several modifications to these commands or other prerequisites - if the VGs are in shared mode etc. This was just to help you understand how this can be done.

regards,
Ninad
Chan 007
Honored Contributor

Re: Removing the VG.

Prasad,

Fine on vgexport (map and text file)

When you do vgexport /dev/vg01 - it will remove all the information related to that vg.

Whereas, when you use the below along with vgexport (important -p -m -f)
-m (you provide the name for the mapfile)
map file contains info on LV
-f (you provide the name for the textfile) text file contains info on disk

see below

testos:/ # vgexport -p -v -s -m vg01.map -f vg01.txt /dev/vg01
Beginning the export process on Volume Group "/dev/vg01".
vgexport: Volume group "/dev/vg01" is still active.
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0
testos:/ # cat vg01.map
VGID 23b09ac53b812904
1 lvol1
2 lvol2
3 lvol3
4 lvol4
5 lvol5
6 lvol6
7 lvol7
8 lvol8
11 lvcrash

testos:/ # cat vg01.txt
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0

Copy them to the other system e.g testos1
vgimport -v -m -f
Some times the PV may be different from the source system so vi vg01.txt and change

This is very useful in clustering and migrating/moving.

Hope this helps
Chan
Prasad Joshi
Regular Advisor

Re: Removing the VG.

Information provided by this forum is awesome.

Thanks HP.

Thanks a lot for all knowledgable people like you.

Regards,
Prasad