Operating System - HP-UX
1835996 Members
2428 Online
110088 Solutions
New Discussion

Re: vgimport without vgexport

 
Narasimha
Occasional Advisor

vgimport without vgexport

Hi ,

Recently I upgraded my system from hpux 11i 32 bit to 64bit with cold installation. After cold installation I tried to import the Volume groups of my disk arry . I can't import it .

Please suggest
18 REPLIES 18
curt larson_1
Honored Contributor

Re: vgimport without vgexport

did you create the volume group device directory and the group special file
these need to be created before the command is executed
Bill Hassell
Honored Contributor

Re: vgimport without vgexport

Your new installation knows nothing about the attached disks. The simplest method is to run SAM, select Disks and File Systems, then Volume Groups (there will be a pause while SAM searches for all attached disks). Now select Actions -> Import. SAM will look at all the unassigned disks, find your old volume group and from there you can choose to import the volume group. If you old VG used standard names for lvols (ie,lvol1, lvol2, etc) then the import will be complete and you can create moutpoints and mount the disks.


Bill Hassell, sysadmin
Narasimha
Occasional Advisor

Re: vgimport without vgexport

Hi
I re-created /dev/vg03 and group file , when i tried to import or vgcfgrestore it gives the error /etc/lvmconf/vg03.conf not found

From SAM its not recognising the volume group.

Please suggest
Sanjiv Sharma_1
Honored Contributor

Re: vgimport without vgexport

Hi Narasimha,

Have you created the map file and kept a backup of the same.

With previous OS
# vgexport -m /tmp/vg03.txt /dev/vg03

If yes then you can use this map file "vg03.txt" for the vgimport.

Else, you need to create the vg03/group with the same minor number as earlier one then run the vgimport.

Thanks,
Everything is possible
Narasimha
Occasional Advisor

Re: vgimport without vgexport

Sajiv,

I didn't created any map file . I don't have the backup of /dev/vg03/group file . Is there a way to solve this ??
Radhakrishnan Venkatara
Trusted Contributor

Re: vgimport without vgexport

Hi,

I did the following steps to restore my old VG's.

Create a directory /dev/vgxx and a group file.

then did vgimport -v /dev/vgxx /dev/dsk/cxtxdx /dev/dsk/cytydy

it worked fine.
Then i did a vgcfgbackup for this vg.
If u hv changed the LV names then u will not get that.

regards
Radhakrishnan
Negative thinking is a highest form of Intelligence
Narasimha
Occasional Advisor

Re: vgimport without vgexport


Hi Radha Krishnan

I am getting the following out put


# vgimport -v /dev/vg03 /dev/dsk/c1t0d1 /dev/dsk/c4t1d1
Beginning the import process on Volume Group "/dev/vg03".
Volume group "/dev/vg03" is still active.
# vgcfgbackup /dev/vg03
vgcfgbackup: Couldn't access the list of physical volumes for volume group "/dev
/vg03".
Thayanidhi
Honored Contributor

Re: vgimport without vgexport

Hi,

Try this.

First create group file with unique vg-id.

Then run
vgimport -v /dev/vgxx /dev/dsk/cxtydz /dev/dsk/cxtydz

From your last post: If you get VG is still
active run.

vgchange -a n /dev/vgxx
vgimport -v /dev/vgxx /dev/dsk... ......
vgchnage -a y /dev/vgyy

You can also run vgscan to find out unconfigured
LVM disks in the system. Move the /etc/lvmtab to /etc/lvmtab.old then run
vgscan.

If you don't have map file you loose only
custom lv names (If it was there already).

TT


Attitude (not aptitude) determines altitude.
Narasimha
Occasional Advisor

Re: vgimport without vgexport

Hi ,

I am getting following information for vgscan

# vgscan -v
vgscan: The physical volume "/dev/dsk/c0t5d0" is already recorded in the "/etc/l
vmtab" file.
vgscan: The physical volume "/dev/dsk/c0t9d0" is already recorded in the "/etc/l
vmtab" file.
vgscan: The physical volume "/dev/dsk/c1t0d0" is already recorded in the "/etc/l
vmtab" file.
vgscan: The physical volume "/dev/dsk/c4t1d0" is already recorded in the "/etc/l
vmtab" file.
Current path "/dev/dsk/c4t1d0" is an alternate link, skip.
Physical Volume "/dev/dsk/c1t0d1" contains no LVM information
Physical Volume "/dev/dsk/c2t2d0" contains no LVM information
Physical Volume "/dev/dsk/c4t1d1" contains no LVM information


/dev/vg00
/dev/dsk/c0t5d0
/dev/dsk/c0t9d0



/dev/vgoracle
/dev/dsk/c1t0d0
/dev/dsk/c4t1d0


Scan of Physical Volumes Complete.
# vgchange -a n /dev/vg03
vgchange: Volume group "/dev/vg03" does not exist in the "/etc/lvmtab" file.
Marvin Strong
Honored Contributor

Re: vgimport without vgexport


if /dev/vg03/group exists

otherwise create it with mkdir and mknod

then you can try

vgimport -p -v /dev/vg03 /dev/dsk/c1t0d1 /dev/dsk/c4t1d1
Marvin Strong
Honored Contributor

Re: vgimport without vgexport

oh you will have to do it without the -p also for it to actually work.

vgimport -v /dev/vg03 {dsk} {dsk}
Chris Watkins_1
Respected Contributor

Re: vgimport without vgexport

Hope you have good backups there.
I may be entirely off the mark... but this doesn't look good:
###############################################################
Physical Volume "/dev/dsk/c1t0d1" contains no LVM information
Physical Volume "/dev/dsk/c2t2d0" contains no LVM information
Physical Volume "/dev/dsk/c4t1d1" contains no LVM information
###############################################################

Typically you'd see something similar to:
"these disks are part of some volume group" (paraphrased)


Without an old config file to restore the lvm info from...
I'd guess you're out of luck on getting this VG back.
You may have to do it the long way now:
pvcreate the disks, vgcreate, lvcreate, mount, restore

Is it possible you have an old vg03.conf file on a backup?
If so, I'd restore it ASAP, and try the vgcfgrestore.
If that works, you'll likely be able to import vg03 afterwards.


Not without 2 backups and an Ignite image!
Albert Smith_1
Regular Advisor

Re: vgimport without vgexport

If you did a clean a.k.a cold install of the system you will need to restore the volume group info before you import it. But this assumes you did a vgcfgbackup first and copied out and backed up the map file.

If you do not do a vgcfgrestore there will be a good chance that volumes will not import.

Here would be the steps:

vgcfgbackup
backup map file
clean install the system
restore the map file
create /dev/vgxx (voulme group to be restored)
mknod the group file
vgcfgrestore the volume group
activate the volume group.

In most case's a vgimport will not work alone as it assumes you did a vgexport first.

Sounds like the only way to get around this problem would be to completly export the voulme group. Pvcreate the volumes and create the VG and the LV's and restore your data.


Again steps:

vgexport your vg
pvcreate -f your volumes
recreate your VG using what ever method you are comftorable with SAM or Command line
restore your data.

Isralyn Manalac_1
Regular Advisor

Re: vgimport without vgexport

Hi,

If you didn't do a vgexport, hope you run an Ignite. When running Ignite, it will create mapfiles of all VGs and put it in /etc/lvmconf. You can then do the vgimport from there.
Shaikh Imran
Honored Contributor

Re: vgimport without vgexport

Hi,
Prior to above all Please Do Not forget
to look for the patches and the compatibility of your Disk Array with the O.S.

Regards,
I'll sleep when i am dead.
Shaikh Imran
Honored Contributor

Re: vgimport without vgexport

Hi,
Assuming that everything is compatible to your new O.S. and also patches are applied.
Try the following :
cp /etc/lvmtab /etc/lvmtab.old
#vgscan -v
This will create a new lvmtab file and also tell you which of the disks are ready to import
Don't Panic if it takes time.
Tested One.

Regards,
I'll sleep when i am dead.
Scott McCort
Advisor

Re: vgimport without vgexport

I recently did a cold install of 11.0 and was able to import my VGs with no problems.
Because the VGs don't exist on your system you have to create the appropriate structure.

# mkdir /dev/vgxx
# mknod /dev/vgxx/group c 64 0x010000
(use a new node for each VG, i.e. 0x020000)

Now import the information into the VG
# vgimport /dev/vgxx /dev/dsk/cxtxdx
# vgchange -a y /dev/vgxx
Any logical volumes will be imported as lvol1, lvol2...
# mount /dev/vgxx/lvol1 /dir_name

Manually edit your /etc/fstab file to reflect the mount.
Marvin Strong
Honored Contributor

Re: vgimport without vgexport

If you have a backup of the old systems /etc
(via ignite or whatever)
This would be easier with vgcfgrestore

however you should be able to get the volume group back without it. Provided you have not pvcreated your disks. Using the steps provided numerous times above.

1) cp /etc/lvmtab /etc/lvmtab.old
2) vgscan -v
3) mkdir /dev/vg03
4) mknod /dev/vg03/group c 64 0x30000 (or any minor number not in use by other vgs)
5) vgimport -v /dev/vg03 {dsk} {dsk

If you pvcreate or have pvcreated your disks you will have to restore the data from backup.