cancel
Showing results for 
Search instead for 
Did you mean: 

Copying of files

greenpiece
Advisor

Copying of files

Hi,
If i have a machine 1, with os and hard disk in the same volume group. If i have another machine 2. Can i install data disk 1 in machine 2 and copy files to another new data disk in machine 1?

Thanks for any replies!
3 REPLIES
Naveej.K.A
Honored Contributor

Re: Copying of files

hi,
Its possible....

The functionality of exporting VGs allows you to remove all data concerning a dedicated VG from the system without touching the data on the disks. The disks of an exported VG can be physically moved to another system and the VG can be imported there. Exporting a VG means the following: remove the VG and corresponding PV entries from /etc/lvmtab and
remove the VG directory with their device files in /dev. Again - the data on the disks is left
unchanged.
Since the structural layout of the LVM information on disk has not changed throughout the
HP-UX releases you can import a VG that has been created on a UX 10.20 system e.g. on a

vgexport has a -m option to create a so called mapfile. This ascii file simply contains the LV names because they are not stored on the disks. You need a mapfile if you do not have the standard names for the LV device files (lvol1, lvol2, ...).

Hereâ s the procedure to export a VG on system A and import it on system B:
on system A:
Umount all LVs that belong to the VG and deactivate it:
# vgchange -a n vg01
Export the VG:
# vgexport -v -m /tmp/vg01.map vg01
Now all information about vg01 has been removed from system A. The disks can now be
moved to system B and the VG can be imported there:

on system B:
Create the directory for the LV device files and the group file. It is important to choose a
minor number that is unique on system B.
# ll /dev/*/group
# mkdir /dev/vg01 (you could also choose another VG name)
# mknod /dev/vg01/group c 64 0x##0000

vgcreate and vgimport will check for the uniqueness of the group file's minor number.
Now copy the mapfile from system A and import the VG:
# vgimport -v vg01 -m /tmp/vg01.map /dev/dsk/c1t0d0 /dev/dsk/c1t1d0

# vgexport -v -s -m /tmp/vg01.map vg01
If you specify -s in conjunction with the -m option vgexport simply adds the VG-ID to the
mapfile:
# cat /tmp/vg01.map
VGID bfb13ce63a7c07c4
1 lvol1
2 lvol2
3 lvsap
4 lvdata
When using the -s option with the vgimport command on system B all disks that are
connected to the system are scanned one after another. If the VG-ID listed in the mapfile is
found on the header of a disk this disk is included automatically into the VG
Hereâ s the appropriate vgimport command:
Chapter 16 LVM
# vgimport -v -s -m /tmp/vg01.map vg01
So you do not have to specify the PVs anymore.

mount the lvols for the data and copy it to the new hard disk

With best wishes
practice makes a man perfect!!!
Naveej.K.A
Honored Contributor

Re: Copying of files

hi,
Its possible....

The functionality of exporting VGs allows you to remove all data concerning a dedicated VG from the system without touching the data on the disks. The disks of an exported VG can be physically moved to another system and the VG can be imported there. Exporting a VG means the following: remove the VG and corresponding PV entries from /etc/lvmtab and
remove the VG directory with their device files in /dev. Again - the data on the disks is left
unchanged.
Since the structural layout of the LVM information on disk has not changed throughout the
HP-UX releases you can import a VG that has been created on a UX 10.20 system e.g. on a

vgexport has a -m option to create a so called mapfile. This ascii file simply contains the LV names because they are not stored on the disks. You need a mapfile if you do not have the standard names for the LV device files (lvol1, lvol2, ...).

Hereâ s the procedure to export a VG on system A and import it on system B:
on system A:
Umount all LVs that belong to the VG and deactivate it:
# vgchange -a n vg01
Export the VG:
# vgexport -v -m /tmp/vg01.map vg01
Now all information about vg01 has been removed from system A. The disks can now be
moved to system B and the VG can be imported there:

on system B:
Create the directory for the LV device files and the group file. It is important to choose a
minor number that is unique on system B.
# ll /dev/*/group
# mkdir /dev/vg01 (you could also choose another VG name)
# mknod /dev/vg01/group c 64 0x##0000

vgcreate and vgimport will check for the uniqueness of the group file's minor number.
Now copy the mapfile from system A and import the VG:
# vgimport -v vg01 -m /tmp/vg01.map /dev/dsk/c1t0d0 /dev/dsk/c1t1d0

# vgexport -v -s -m /tmp/vg01.map vg01
If you specify -s in conjunction with the -m option vgexport simply adds the VG-ID to the
mapfile:
# cat /tmp/vg01.map
VGID bfb13ce63a7c07c4
1 lvol1
2 lvol2
3 lvsap
4 lvdata
When using the -s option with the vgimport command on system B all disks that are
connected to the system are scanned one after another. If the VG-ID listed in the mapfile is
found on the header of a disk this disk is included automatically into the VG
Hereâ s the appropriate vgimport command:

# vgimport -v -s -m /tmp/vg01.map vg01
So you do not have to specify the PVs anymore.

mount the lvols for the data and copy it to the new hard disk

With best wishes
practice makes a man perfect!!!
Rory R Hammond
Trusted Contributor

Re: Copying of files

Yes.
I would install the DATA disk on machine 2
preferably not in VG00.

Create the data file systems.

backup the data to tape and restore to machine2

Or NFS mount machine 1 data disk to machine 2
and copy data.

Rory

There are a 100 ways to do things and 97 of them are right