1833582 Members
3622 Online
110061 Solutions
New Discussion

Re: Copy lv

 
Marcelo De Florio
Frequent Advisor

Copy lv

How I can copy one logical volume ?

Thanks.
5 REPLIES 5
Dan Hetzel
Honored Contributor

Re: Copy lv

Hi Marcelo,

Not sure to fully understand your question, but if you want an exact copy of a logical volume, you could turn mirroring on with:
'lvextend -m1 lv_path', providing you have enough unassigned disk space in the same volume group. If not, you may add a physical volume to your volume group with SAM or 'vgextend'.

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Marcelo De Florio_1
Frequent Advisor

Re: Copy lv

Ok, but I need a copy in another volume group.
Marcelo De Florio
Bill Hassell
Honored Contributor

Re: Copy lv

Copying using mirroring works very well with live data as the copy is constantly synchronized with the source.

If you just want to copy all the files, ownerships and permissions to another volume, use this:

cd /source_location
find . -xdev | cpio -pudlmv /new_location

The -v option in cpio will show all the files/directories as they are copied but on a slow terminal, this can slow the process down.


Bill Hassell, sysadmin
Dan Hetzel
Honored Contributor

Re: Copy lv

Hi,

Bill is right, like usual ;-)
I wouldn't use the 'l' flag for cpio as this one would link files rather than copying.

Should read '...cpio -pdvum ...' instead.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Henry Weldon
Advisor

Re: Copy lv

In addition, if you have a large LV to copy try one of the following. If you are migrating several hundreds of GB's or TB's of data. An extended outage using a native backup/restore may be much more efficinet.

Transfer speed was 84 GB/Hour using TAR
cd /home/npd
time tar cf - . | (cd /home/npd.new; tar xf - )

Transfer speed was 21GB/Hour using FBACKUP & FRECOVER
cd /home/npd
time fbackup -f - -i . | (cd /home/npd.new; frecover -Xrf -)

The dash after the f flag specifies standard input and output.

Be Prepared