Operating System - HP-UX
1837524 Members
3919 Online
110117 Solutions
New Discussion

Re: Reallocating a Volume group

 
SOLVED
Go to solution
RedBack
Frequent Advisor

Reallocating a Volume group

I have created a temporary Volume group. In the VG are 2 logical volumes with file systems in each. I want to remove all of this and get back to having just the raw disk. I then want to allocate the disk to an existing Volume group. What are the steps required to remove all of this then reallocated the raw disk to a existing VG?
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: Reallocating a Volume group

Mark,

You can use vgexport.

HTH,
Pete

Pete
RedBack
Frequent Advisor

Re: Reallocating a Volume group

To do what? I was hoping for a little more detail?
James R. Ferguson
Acclaimed Contributor

Re: Reallocating a Volume group

Hi Mark;

The easist method is to simply 'vgexport /dev/vgXX'. This will cleanup '/etc/lvmtab' (and optionally '/etc/lvmpvg'); and remove the device files in /dev/vgXX. When done you will need to edit '/etc/fstab' to remove any mountpoints and yo( will need to do a forced 'pvcreate' ('pvcreate -f /dev/rdsk/cXtYdZ) on the physical disk that were associcated with vgXX to remove their LVM information.

This method is far faster than 'lvremove'; 'vgreduce'; 'vgremove'; and then manually cleanup 'dev/vgXX'.

Regards!

...JRF...
Arockia Jegan
Trusted Contributor
Solution

Re: Reallocating a Volume group

Hi,

First unmount the file system that is in the drive. Make sure any application/prcoesses are not using that file systems

#umount

Deactivate the volume group

#vgchange -a n /dev/
#vgexport /dev/

#pvcreate -f /dev/rdsk/
#vgextend /dev/dsk/



PIYUSH D. PATEL
Honored Contributor

Re: Reallocating a Volume group

Hi,

Use vgexport /dev/vg02

Then you can always vgextend

#vgextend /dev/vg03 /dev/dsk/c1t2d0

( if vgextend does not work then you can use)

#pvcreate -f /dev/rdsk/c1t2d0

Then you can do a vgextend.

Piyush
Pete Randall
Outstanding Contributor

Re: Reallocating a Volume group

Sorry, Mark. I guess that was a little sparse. JRF, as usual, has given you a nicely detailed procedure that should walk you right through.

Good Luck,
Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Reallocating a Volume group

Hi (again):

I should have added (of course) that you will first need to unmount any mounted filesystems and do:

# vgchange -a n /dev/vgXX

Regards!

...JRF...
V. V. Ravi Kumar_1
Respected Contributor

Re: Reallocating a Volume group

hi,
use SAM to do this.
run SAM
then DISKs and file systems
then volume groups
select the vg
then Actions and remove.
it automatically removes all the LVs under it. the disk will be freed.

then select existing volume group and Actions then extend the volume group add this disk.

regds
Never Say No
MANOJ SRIVASTAVA
Honored Contributor

Re: Reallocating a Volume group

Hi


Let us call the temp vg as test


1. lvreduce /dev/test/lvol1
2. lvreduce /dev/test/lvol2
3. vgreduce /dev/test /dev/dsk/cxtydz
4. vgexport /dev/test
5. pvdisplay /dev/dsk/cxtydz ( assume that this disks belonged to the vg test)
6. pvcreate /dev/rdsk/cxtydz
6. vgextend /dev/test1 ( exisitng vg which you have to extednd ) /dev/dsk/cxtydz


and you are good to go.


Manoj Srivastava
Arockia Jegan
Trusted Contributor

Re: Reallocating a Volume group

Once you make sure that none of the application or processes are using the file systems in the drive you can unmount the file systems. Still if you couldn't unmount the file system use fuser -ck . Be cautious while using fuser command.

Then do the rest other steps ..
PIYUSH D. PATEL
Honored Contributor

Re: Reallocating a Volume group

Hi,

To be very sure...you can always go to the Init level s and make the changes. make sure that the users are not using the system. Or if you are very sure that nobody is using the system, you can do it in the run level 3 also.

Piyush