Operating System - HP-UX
1836596 Members
3395 Online
110102 Solutions
New Discussion

Copy one Logical Volume to the Another ?

 
SOLVED
Go to solution
John_44
Advisor

Copy one Logical Volume to the Another ?

Hello, I have a logical volume that is almost full. In another volume group I have a larger logical volume that I can copy the data to. My plan is to copy the date from the smaller one to the larger one then unmount the smaller logical volume and mount the larger one on the original mount point. What is the easiest way to do this? I know there are a few copy utilities in HP-UX but I am not sure which one is best for this purpose. Any help would be appreciated and I will assign points as always.

John
7 REPLIES 7
Pete Randall
Outstanding Contributor
Solution

Re: Copy one Logical Volume to the Another ?

John,

I use something like this:

cd /yourlvol
find . -print |cpio -pdumxl /yournewlvol


That should do it.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Copy one Logical Volume to the Another ?

About as easy as it gets is:

1) cd to source dir.
2) find . -print | cpio -pudvm /newdir/

If it ain't broke, I can fix that.
Bill Douglass
Esteemed Contributor

Re: Copy one Logical Volume to the Another ?

I agree that cpio is probably the way to go, but I wanted to add:

cd /old/directory
tar cvf - * | (cd /new/directory; tar xf -)

Would do this as well.
Uday_S_Ankolekar
Honored Contributor

Re: Copy one Logical Volume to the Another ?

You can also use dd command
dd if=/dev/sourceVG/sourceLV of=/dev/TOVG/toLV bs=1024k

and do not forget to modify /etc/fstab file

-USA..
Good Luck..
John_44
Advisor

Re: Copy one Logical Volume to the Another ?

Guys,

Thank you for all your help.

John
A. Clay Stephenson
Acclaimed Contributor

Re: Copy one Logical Volume to the Another ?

Warning: dd is NOT the way to do this!! It will simply copy at the block level so that if you copy into a larger LVOL the underlying filesystem will know nothing about it and you will be no better off until you do an extendfs.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Copy one Logical Volume to the Another ?

Warning: dd is NOT the way to do this!! It will simply copy at the block level so that if you copy into a larger LVOL the underlying filesystem will know nothing about it and you will be no better off. (At least until you do a subsequent extendfs or fsadm).
If it ain't broke, I can fix that.