Operating System - HP-UX
1831213 Members
2700 Online
110021 Solutions
New Discussion

Move physical extents from one disk to another.

 
KapilRaj
Honored Contributor

Move physical extents from one disk to another.

Hi all,

Is there a command in hpux that can move *just one or more* "PEs" from one PV to another ?.

Confused , let me give an example.

I have two disks and two logical volumes in a volume group.
Each disk has 1024 PE's.
On the first disk, 512 Pes are used by the first LV. Rest of the 512 Pe's are used by the second LV.
On the second disk, 512 Pes are used by the first LV and 500 Pes are used by the Second LV.

I want to move 12 Pes from First disk to the second disk.

Which command can do this?. I can easily do this in suze and aix, i am not able to find an equivalent in HPUX. I am familier with pvmove but can not find an argument that can do this.

Regds,

Kaps
Nothing is impossible
9 REPLIES 9
Ravi_8
Honored Contributor

Re: Move physical extents from one disk to another.

Hi,

I haven't heard of any such command.

Even I also working on AIX, which is that command you use to move PE from one lvol to another lvol?
never give up
KapilRaj
Honored Contributor

Re: Move physical extents from one disk to another.

migratelp in aix Version 5.
pvmove in SuSE Linux

Regds,

Kaps
Nothing is impossible
Trond Haugen
Honored Contributor

Re: Move physical extents from one disk to another.

You can't move an arbitrary number of PEs. But in you case you MAY be able to pvmove the extents.
You should also be able to use lvreduce and lvextend to accomplish what you want.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
bhavin asokan
Honored Contributor

Re: Move physical extents from one disk to another.

hi,

as you know,you can use pvmove only for the following purposes.you will not be able to specify howmany PE should be moved.

Moving Data in Logical Volumes From
Disk to Disk
You can use the pvmove(1M) command to move data contained in
logical volumes from one disk to another disk within a volume group.
For example, you can move a logical volume's data from one disk to
another to use the space on the first disk for some other purpose.
Also, you can move all data from one disk to another. You might want
to do this, for example, so you can remove a disk from a volume group.
After removing the logical volume data off a disk, you can then
remove the disk from the volume group.

Moving Logical Volume Data from One Disk
to Another
Suppose you want to move the data in a logical volume, /dev/vg01/
markets, from the disk /dev/dsk/c0t3d0 to the disk /dev/dsk/c0t4d0.
Note that when you issue the command, you must specify a specific
logical volume on the source disk with the -n flag. You must also
specify the source disk first in the command line. For example,

# pvmove -n /dev/vg01/markets /dev/dsk/c0t3d0 /dev/dsk/c0t4d0




Moving All Data on One LVM Disk to
Another
If you want to move all the data on a given disk within a volume group,
you can use the pvmove(1M) command to move the data to other
specific disks or let LVM move the data to available space within the
volume group.
To move data off disk /dev/dsk/c0t4d0 and let LVM transfer the data to
available space in the volume group, you could enter:
# pvmove /dev/dsk/c0t4d0
To move data off disk /dev/dsk/c0t4d0 to the destination disk
/dev/dsk/c0t5d0, enter:
# pvmove /dev/dsk/c0t4d0 /dev/dsk/c0t5d0
If space doesn't exist on the destination disk, the pvmove command
will not succeed.

regds,




KapilRaj
Honored Contributor

Re: Move physical extents from one disk to another.

Thank you all.

lvreduce has a cost, that is my filesystem. So thats not an option what I am looking for.

So here's some work for the HP Developers.

Regds,

Kaps
Nothing is impossible
KapilRaj
Honored Contributor

Re: Move physical extents from one disk to another.

Guys,

One more time .. Is there a command or any plans to build one ?, so i can close this thread

Regds,

Kaps
Nothing is impossible
Pete Randall
Outstanding Contributor

Re: Move physical extents from one disk to another.

Kaps,

What about dd? You know the PE size and the PE number so, if you set dd's block size to be the same as the PE size and then told it how many blocks to skip and the number of blocks to copy. You would have to figure out where to put them and specify oseek to get the correct location.

This is the only method I can think of and it sounds extremely dangerous to me. I would try it on a couple of test LV's before I risked trashing your data!


Pete

Pete
KapilRaj
Honored Contributor

Re: Move physical extents from one disk to another.

Thanks pete, That sounds logical but i will surely need to test it before i actually try on any of the volume that i want to do this.

Thanks

Kaps
Nothing is impossible
KapilRaj
Honored Contributor

Re: Move physical extents from one disk to another.

Guys,

This option is now available. in hpux LVM, we can migrate a specific PE to another PV. I was browsing thtough the man pages for pvmove the other day and found this one.

=========================
Relocate PE number 0 to any free extent with in the same physical volume.

pvmove /dev/dsk/c1t0d0:0 /dev/dsk/c1t0d0

Relocate PE number 0 from /dev/dsk/c1t0d0 to any free extent in the volume group.

pvmove /dev/dsk/c1t0d0:0
=========================

Regards, Kaps.
Nothing is impossible