Operating System - HP-UX
1834721 Members
2256 Online
110069 Solutions
New Discussion

reducing a disk from the volume group

 
sheevm
Regular Advisor

reducing a disk from the volume group

We have a volume group has one big one logical
volume size of 25GB. It has three 9gb drives.
It is a vxfs file system and about 8GB data is in the filesystem.

I want to remove one of the drives. Do I have to do lvreduce and vgreduce? If I do that is the existing data is safe? I want to retain the data without going thru restoring from the backup.

What is the best way to do this?

Thanks for the help
be good and do good
15 REPLIES 15
Christopher McCray_1
Honored Contributor

Re: reducing a disk from the volume group

Hello,

You also have to shrink the size of the rlvol and, unless you have OnlineJFS, you will have to run newfs, which destroys the data and you will have to restore from backup.

Chris
It wasn't me!!!!
Bill McNAMARA_1
Honored Contributor

Re: reducing a disk from the volume group

use the pvmove command to move the lv off the drive you want to vgreduce out of the vg.

lvreduce is only a good idea if you have
a> backed up
b> defragged the filesystem

You need onlineJFS to do a.

Otherwise, backup fs, lvremove, lvcreate new size. Then pvmove.

You can find out what lvs are on the disk with lvdisplay -v and/or pvdisplay -v.

Later,
Bill
It works for me (tm)
Hai Nguyen_1
Honored Contributor

Re: reducing a disk from the volume group

It depends on the way you have configured the volume. Can you post "vgdisplay -v /dev/vg_volume_name?

Hai
Deshpande Prashant
Honored Contributor

Re: reducing a disk from the volume group

HI
You will have to have the Online JFS to reduce the VG/LV on fly.
Before reducing LV/VG, defrag the LV and keep backup of your data.
With out Online JFS, you will have to backup your data delete the existing LV and re-create the LV of desired size.

Thanks.
Prashant Deshpande.
Take it as it comes.
sheevm
Regular Advisor

Re: reducing a disk from the volume group

hai Nguyen:

Here is vgdisplay output. This logical volume is 25gb. and in production. I cannot afford to take time in restoring process. I need to remove one of the drives from this logical volume keeping the data safe.

If I do the pvmove can I reduce that drive from the volume group?

See the attached vgdisplay output.

Thanks
be good and do good
Victor_5
Trusted Contributor

Re: reducing a disk from the volume group

Are you using mirroring? What is your current value of mirror copy?
sheevm
Regular Advisor

Re: reducing a disk from the volume group

Victor:

These drives are not mirrored.
Thanks
be good and do good
Hai Nguyen_1
Honored Contributor

Re: reducing a disk from the volume group

Raji,

I think Online JFS is the only choice for you now.

Can you run the following command and post the output. If the output means this FS is not really busy, I may have a solution for you.
# fuser -cu /

Hai
sheevm
Regular Advisor

Re: reducing a disk from the volume group

Hai:

This time file system is getting used. When I am ready to do this the file syste will not be in use. So PLEASE GIVE ME THE TRICK.

Thanks
be good and do good
MANOJ SRIVASTAVA
Honored Contributor

Re: reducing a disk from the volume group

Hi Raji


There is ac onfusion here in the vgdisplay o/p there are only 55 PE which are free ie you ahve about 200 mb free space where as you have stated that there is only 8gb used , If the o/p is of the volume group you want to remove first you need to reduce the data as all the 3 disks have nearly 100 % utilization. After teh data is removed or tarred then depending on which volume it frees it can be possible to remove the disk

Manoj Srivastava
Hai Nguyen_1
Honored Contributor

Re: reducing a disk from the volume group

Raji,

This time file system is getting used. When I am ready to do this the file syste will not be in use. So PLEASE GIVE ME THE TRICK.

Here is what I think can work.
Assumptions:
- A is the current FS on which /dev/vg07/lvol1 is mounted.
- B is an existing FS which has more than 8GB empty disk space.
- A has STATIC data.

With the assumptions above, here are the sequence

# mkdir /B/A
# cp -pR /A/* /B/A
# umount /A (only when A is not busy)
# rmdir /A
# ln -s /B/A /A (this will behave as the original A now.)
# lvremove -f /dev/vg07/lvol1
# vgreduce /dev/vg07 /dev/dsk/c4t1d2
# use SAM to recreate /dev/vg07/lvol1 with /A_temp as a mount point.
# cp -Rp /B/A/* /A_temp
# rm /A (it is only a soft link. Do this when it is not busy only)
# mv /A_temp /A
# vi /etc/fstab to change /A_temp to /A
# rm -r /B/A
# done

Hai
Victor_5
Trusted Contributor

Re: reducing a disk from the volume group

I prefer you use the standard steps,

lvreduce --> vgreduce --> pvmove.
sheevm
Regular Advisor

Re: reducing a disk from the volume group

Hi Guys:

Thanks for the help. I want to ssign points for some reason that button is disappered "assign points". Can you tell me what is wrong?

Thanks
be good and do good
Christopher McCray_1
Honored Contributor

Re: reducing a disk from the volume group

Hello again,

It is possible that your seesion has logged out from underneath you. Log out and log back in and see if this helps.

Regards

Chris
It wasn't me!!!!
sheevm
Regular Advisor

Re: reducing a disk from the volume group

Hi Guys:

Still I cannot get "assign points" button after logging out and logging in. Please do not think I am ignoring to assign points.


Thanks
be good and do good