Operating System - HP-UX
1752786 Members
5792 Online
108789 Solutions
New Discussion юеВ

Using lvsplit/lvmerge for online backup on two HP servers

 
Rainer Wolafka
Occasional Contributor

Using lvsplit/lvmerge for online backup on two HP servers

Hello everyone, I want to do an online backup using the lvsplit/lvmerge commands on mirrored logical volumes.
The setup is as follows: I have a volume group that consists of three physical disks (each belonging to a separate physical volume group). Within this VG there are several mirrored logical volumes each with three copies. Each copy is allocated on one of the three disk drives.One of these disks drives is shared between two HP systems. When doing the lvsplit/lvmerge command I am able to do online backup from the splitted copys without any problems on ONE HP-UX server (while the logical volume with the remaining two copies are active and mirror protected).
But my aim is to make the splitted copy accessable on another HP-UX server. From the physical connectivity I am able to see the shared disk drive but I have problems getting the data active on the second HP using LVM.
After splitting the logical volume I perform the following steps on the second HP:
1) mkdir /dev/vg mknod .....
2) vgimport ....
3) vgchange -a y -q n ...
4) fsck -y ....
5) mount ....

Following the procedure above I got sevaral errors (I/O errors because of stale partitions during vgchange, fsck errors). Beside these errors the names of all logical volumes are changing to lvolx. I have no idea how to procede.
1) Could you give an assesment if this is possible in general, avoiding the errors I see above ?
2) Do you have any ideas of how to make the splitted copies available to the second HP server without errors ?
Many thanks for your help and ideas.
3 REPLIES 3
Shyam Kishore
Frequent Advisor

Re: Using lvsplit/lvmerge for online backup on two HP servers

Hi,

I presume you can access the entire VG from both the Systems.

I could not get why you are using vgimport for backup. This encreases the process time.

When you done lvsplit each logical volume is splited in to two seperate log. vols. like "lvolx" and "lvolxb", you can simply run fsck on lvolxb and mount it seperately for your backup operation.(lvolx is for your ON Line applications). You may check MAN pages for lvsplit/lvmerge for more details.

-Shyam
Kids learn from masters, masters from mistakes.
John Palmer
Honored Contributor

Re: Using lvsplit/lvmerge for online backup on two HP servers

I've done this sort of thing in the past and it works ok. What I suggest is as follows:-
Import the volume group onto the backup machine and leave it there - you need to be able to see all the disks otherwise it won't work. When you have split off the mirror, get it's minor number from
/dev/vg??/ and pass that to the backup script. This can then mknod the two device files in /dev/vg??, activate the volume group read only (vgchange -a r vg??) if necessary then fsck, mount etc the volume.
Don't forget to remove the two device files when you've finished the backup.
Rainer Wolafka
Occasional Contributor

Re: Using lvsplit/lvmerge for online backup on two HP servers

Hello all,
many thanks for your feedback. I found a way to get the correct LV information (exact LV names) to the secondary server. On the primary system you create a mapfile with the LV information"vgexport -p -m mapfile vg_name", which does nothing else than produce the mapfile.
When doing the vgimport on the secondary you specify this mapfile (-m option) and all logical volumes are displayed correctly. It is important to create the mapfile on the primary system after splitting the LV (lvsplit).
Again, many thanks to all of you.