Operating System - HP-UX
1834132 Members
2091 Online
110064 Solutions
New Discussion

Re: move a volume on the same disk

 
SOLVED
Go to solution
Jig  Patel
Occasional Contributor

move a volume on the same disk

Hi Friends

Is there any way to move a volume on the same disk.


Thank you
Jignesh Patel
11 REPLIES 11
Scott Van Kalken
Esteemed Contributor

Re: move a volume on the same disk

what exactly do you mean by volume?
filesystem / directory / logical volume / volume group?

James R. Ferguson
Acclaimed Contributor

Re: move a volume on the same disk

Hi:

If you mean move the phusical extents of a logical volume from one physical volume of a volume group to another physical volume of the same volume group, then "yes". See the man (1M) pages for 'pvmove'.

Regards!

...JRF...
Scott Van Kalken
Esteemed Contributor

Re: move a volume on the same disk

Does pvmove do a physical to logical extent mapping?

In other words - I'm REALLY asking: do the sizes of the disks matter?

for example:
disk c0t1d0 = 18GB
disk c1t1d0 = 36GB (i.e. new disk)

pvmove /dev/dsk/c0t1d0 /dev/dsk/c1t1d0

(I've not played with pvmove before)
Roger Baptiste
Honored Contributor

Re: move a volume on the same disk


If you mean renaming Logical
volume, yes you can do it.
Make sure the filesystem
containing the LV is unmounted
and then just do a ""mv"' .
If it is raw volume, make
sure it is not being used
by running fuser command and
rename it.

If you mean, moving data
from one disk to another
in the Same volumegroup,
use pvmove command.

-raj
Take it easy.
Sridhar Bhaskarla
Honored Contributor
Solution

Re: move a volume on the same disk

Scott,

It doesn't. This is because the new disk will be in the same volume group and hence it possesses the same characterstics as of the old disk except for the number of extents.
However, unless you specificied MaxPhysicalExtents value (-e) while creating the volume group, it will not allot the extents more than what could be configured on the first disk in the volume group.

Jig,

You can use pvmove command to move the logical volumes across disks in a volume group. But if you want to move a logical volume from one place to other place on the same disk in a volume group, it is not possible. But you can create another logical volume , copy the data and then remove the old logical volume.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: move a volume on the same disk

Hi,

Not sure why you would want to move a volume
to the same disk. I would assume you meant the
same volume group. Anyway the answer is 'pvmove'
Have a good read of the man page before using it.
There is some valuable hints there in regards
to having mirrored disks and the use of disks
in shared mode.
This is an extract from the man page
/Quote
source_pv_path must not appear as a dest_pv_path.
If source_pv_path is a member of a dest_pv_path, it is automatically excluded from being a destination physical volume.
\Unquote

HTH
Anyone for a Mutiny ?
Darrell Allen
Honored Contributor

Re: move a volume on the same disk

You're probably stuck with creating another logical volume, copying the original lv's data to the new, then deleting the original and renaming the new.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Jig  Patel
Occasional Contributor

Re: move a volume on the same disk


I mean moving the logical extends of
a logical volume from one portion of the disk (Physical volume) to another portion of the disk .The logical volume is contained on only one disk.

The portion of the disk where the logical volume is to be moved is free as appears in the following command.

pvdisplay -v /dev/dsk/c0t5d0
Joseph C. Denman
Honored Contributor

Re: move a volume on the same disk

Why would you want to do that????

Just wondering.

Jig, if you would explain exactly what you are attempting to accomplish, I'm sure we could assist.

Are you wanting to rename a lvol?
Are bad sectors the reason for the move?

...jcd...
If I had only read the instructions first??
Joseph C. Denman
Honored Contributor

Re: move a volume on the same disk

PS....

Jig,

As James as told me before, easy on the points. Don't give away the rabbit before your problem is solved.

...jcd...
If I had only read the instructions first??
James R. Ferguson
Acclaimed Contributor

Re: move a volume on the same disk

Hi Jig:

OK, I presume that you want to lvextend a logical volume what requires contiguous extents and another is in the way. As already indicated, since you want to move extents where the source and destination are the same physical disk, 'pvmove' can't be used.

Therefore, do this:

1) Make a new, temporary logical volume and declare a mountpoint for it called "/newdata".

2) Copy your current data from its current logical volume (let's call that "/olddata" for our example):

# cd /olddata
# find . | cpio -pudlmv /newdata

Obviously, make sure that the filesystem are "quiet" (not being used by applications) while you do this.

3) 'lvremove' the logical volume represented by the "olddata". This will free the extents you wish.

4. Edit /etc/fstab to delete the old reference to "olddata" and change the "newdata" mountpoint to be "olddata" on the *new* logical volume.

Regards!

...JRF...