Operating System - HP-UX
1833780 Members
2219 Online
110063 Solutions
New Discussion

Re: lvreduce and lvextend

 
SOLVED
Go to solution
john schiwitz
Occasional Contributor

lvreduce and lvextend

I am moving lvs from one disk to another using lvextend newdisk and lvreduce olddisk/primary mirror. A HP engineer told me that I would have to umount the lvs prior to lvreduce or I would risk filesystem corruption. I trust the HP engineer but my response was, "what good is OnlineJFS"?

I don't have to do this on AIX ;->>

Is this an old lvm bug or just a design feature? Has anyone else heard of this feature/recommendation?
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: lvreduce and lvextend

John,

I don't see where OnlineJFS comes into this. You're adding a mirror with lvextend, then using lvreduce to get rid of the original primary? That involves MirrorDisk/UX, not OnlineJFS - and I may be wrong, but I don't think you have to unmount the filesystem.


Pete


Pete
Bryan D. Quinn
Respected Contributor

Re: lvreduce and lvextend

Hello,

I would have to agree with Pete, I don't see where umounting or the use of OnlineJFS has anything to do with this.

Say these are your disks:

c0t1d0 old disk
c0t2d0 new disk

You should be able to do this:

lvextend -m 1 /dev/vgXX/lvolX /dev/dsk/c0t2d0

Then do:

lvreduce -m 0 /dev/vgXX/lvolX /dev/dsk/c0t1d0

I would think that would be all you need to do.

Hope this helps!
-Bryan
G. Vrijhoeven
Honored Contributor

Re: lvreduce and lvextend

Hi,

lvreduce is to reduce lvols and online jfs works with filesystems.

1 add the now disk to the volumegroup
pvcreate /dev/rdsk/c?t?d? && vgextend /dev/vg?? /dev/dsk/c?t?d?
2 add a mirrorcopy to the lvols
lvextend -m1 /dev/vg??/lvol? /dev/dsk/c?t?d?
3. lvreduce the old disk
lvreduce -m0 /dev/vg??/lvol? /dev/dsk/c?t?d?
4. remove the disk out of the volume group
vgreduce /dev/vg?? /dev/dsk/c?t?d?

There is no need voor onlinejfs.

If you do need to use it just fsadm -F vxfs -b /mountpoint is safe if you have enough free space.

Gideon

Gideon




It is safe to use lvreduce
Patrick Wallek
Honored Contributor

Re: lvreduce and lvextend

The way you are diong it will work. But an easier way is to use pvmove. pvmove will do what you are doing automatically.

There isn't any reason to unmount the LV prior to lvreducing.
Todd McDaniel_1
Honored Contributor

Re: lvreduce and lvextend

I am inclined to go with the mirroring solution... more straight forward IMHO.

lvextend -m 1 /dev/vgXX /dev/dsk/cXtXdX for new mirror on new disk


lvreduce -m 0 /dev/vgXX /dev/dsk/cXtXdX for removal of old disk

Then remove the old disk from the VG or reallocate it.
Unix, the other white meat.
john schiwitz
Occasional Contributor

Re: lvreduce and lvextend

oops I meant mirrorux not onlinejfs.

I've lvextended and lvreduced hundreds of times without any problems.

But the HP support team says I quote:
"

It is critical to ensure that all I/O has been flushed to both copies of
the mirrored logical volume(s) before reducing one of the mirror copies;
the only way to guarantee this is to stop the application, unmount the
filesystems or raw volumes, and deactivate the volume groups that are
affected

NOTE: these steps need to be done on all 9 systems, however they can
be performed one system at a time if desired

a) Confirm mirrors are sync'd before proceeding

# vgdisplay -v (ensure all LVs are sync'd)

b) Ensure the I/O is flushed to each logical volume

Stop application
umount filesystems
deactivate VGs

# vgdisplay (only vg00 should be active)

c) Reduce a mirror from each logical volume


# vgchange -a y /dev/vgxx
# vgdisplay -v

# lvreduce -m 0 /dev/VGxx/LVx /dev/dsk/...
# lvdisplay -v /dev/VGxx/LVx

# vgreduce /dev/VGxx /dev/dsk/... (alternate link)
# vgreduce /dev/VGxx /dev/dsk/... (primary link)
# vgdisplay -v /dev/VG
# strings /etc/lvmtab
"

They say if you really want to do this with your filesystems active you need to buy vxvm.

Just wondered if anyone else had heard this feature with lvreduce/lvextend?