1753716 Members
4951 Online
108799 Solutions
New Discussion юеВ

LVM

 
SOLVED
Go to solution
Amitav
Frequent Advisor

LVM

I'm new to HP unix, how can i move data's across VG's. Though i know it can be done thru the cmd's like dd, mv, cp, tar, cpio....but i know have the knowledge how to use them(esp. dd, tar & cpio)...?? Can somebody help me out.....
5 REPLIES 5
Amit Parui
Valued Contributor
Solution

Re: LVM

Hi Amitav,

Firstly dd can only be used to dump data from one disk to another, mainly used in case of whole disk backups.

#dd if=/dev/rdsk/c?t?d? of=/dev/rdsk/c?t?d? bs=1024 (in multiples of 2)

In,the above command first you've to get two disks from two different vg's, but the only problem would be to find out any paricular filesets in this case. Else you can dump the whole disk to other disk, which should supposedly have enough space, and you are done.

Secondly using tar would be much feasible in case of selected filesets -

#tar -cvf myarchive `cat /tmp/aa`
or
#cat /tmp/aa | xargs tar -cvf aa.tar

Also,if there are many files to be archived, you can use 'pax', which can write tar-format but can read the files to be archived from stdin as well:

#pax -w -f myarchive.tar After this move the tar file to the desired location.

Try this syntax
# find . -print | cpio -pdmuv > /tmp/myarchive.cpio

Test it out, but this syntax should keep the ownerships and permissions intact.



If Life gives u a ROCK, its upto u to build a BRIDGE or a WALL !!!
Steven E. Protter
Exalted Contributor

Re: LVM

Shalom,

When you say across volume groups, you mean from one volume group to another?

You actually list many of my preferred choices.

I also for not totally huge moves use scp, to move across a network between machines.

If you want to migrate a whole volume group you can use vgexport followed by vgimport.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Prasanth V Aravind
Trusted Contributor

Re: LVM

get system administartion tasks.pdf from docs.hp.cpm
Prasanth V Aravind
Trusted Contributor

Re: LVM

Wim Rombauts
Honored Contributor

Re: LVM

What data do you want to move ?
If you want to create a new VG with the same configuration as the old VG, or modify a VG to give it the same configuration as the old VG, vgexport (with -p option !) and vgimport is your way to go.
If you want to copy the contents of a RAW LV to another RAW LV in another VG, then dd is the way to go, but then you are copying LV-contents, not VG's. (VG's in fact only contain configuration information, so that is all you can copy if you talk about VG's)
If you want to copy filesystems between LV's (and it doesn't matter if it is a different VG or not), use filesystem tools like cp -pr (if you can directly access both filesystems), or tar or cpio.

To give more detailed command explanations, a good starting point is to look at the man pages, or to specify here what type of data you want to copy.