Operating System - HP-UX
1783198 Members
1721 Online
109144 Solutions
New Discussion юеВ

Re: retrieve data of old disk vg00

 
Ceesjan van Hattum
Esteemed Contributor

retrieve data of old disk vg00

Hi,
I have a old disk with vg00 of HPUX10.20 which is not bootable.
I have also a running HPUX11 system (containing vg00 and vg01).
Now i need to retrieve some directories of the old disk, so i want to insert the disk and connect it maybe like a vg03, but what to do with double filesystemnames /var, /opt etcetera?
I've understood that vgimport is not the way, or is it?

Regards,
Ceesjan
18 REPLIES 18
John Palmer
Honored Contributor

Re: retrieve data of old disk vg00

Yes, you need to vgimport the disk as vg03 (or vg1020). You can then mount the filesystems as whetever you like, something like /oldvar /oldopt /oldroot etc.

Regards,
John
Xavier Gutierrez_1
Frequent Advisor

Re: retrieve data of old disk vg00

Hi, Ceesjan

It IS the way. You only need to vgimport the old vg00 with a minor number other than the minor of other VGs you already have in your system (if you plan to have it as vg03, choose 0x030000 as minor #).

Then the filesystems can be mounted elsewhere. For example:

mount /dev/vg03/lvol7 /old_var
^^^^^
You'll need to know the
exact structure, for sure.


Best regards.
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

What i did now is the following:

mkdir /dev/vg03
mknod /dev/vg03/group c 64 0x030000
vgcreate /dev/vg03 /dev/dsk/c0t3d0
for i in 1 2 3 4 5 6 7 8 9
do
mknod /dev/vg03/rlvol$i c 64 0x00000$i
mknod /dev/vg03/lvol$i b 64 0x00000$i
done
mknod /dev/vg03/rlvol10 c 64 0x00000a
mknod /dev/vg03/lvol10 b 64 0x00000a
mknod /dev/vg03/rlvol11 c 64 0x00000b
mknod /dev/vg03/lvol11 b 64 0x00000b

The 'ls -l' of the newly created vg03 looks exactly the same as the old system had as vg00.

Now i try to mount:
mkdir /oldcontrib
mount /dev/vg03/lvol11 /oldcontrib
/dev/vg03/lvol11: No such device or address

Where do i have to look for faults??

Joaquin Gil de Vergara
Respected Contributor

Re: retrieve data of old disk vg00

when you make the vgcreate the disk must be EMPTY and pvcreate-d

you need to make an vgimport to import LVM Data in disk to a VG

Probably disk is empty.... if not you can't make the vgcreate

Teach is the best way to learn
John Palmer
Honored Contributor

Re: retrieve data of old disk vg00

You ought to run vgimport, it would be much simpler...

mkdir /dev/vg03
mknod /dev/vg03/group c 64 0x030000
vgimport /dev/vg03 /dev/dsk/c0t3d0

However, if you want to do it your way, your mknod's should have a minor number of:

0x03000x not
0x00000x

Regards,
John
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

You're right.
(points will be rewarded later).
Now i have a /dev/vg03 in my /etc/lvmtab which i want to delete (vgremove).
But.. it needs to have the vg activated. But activation failes:
#vgchange -a y /dev/vg03
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c0t3d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c0t3d0":
The specified path does not correspond to physical volume attached to this volume group vgchange: Warning: couldn't query all of the physical volumes.
vgchange: Couldn't activate volume group "/dev/vg03": Quorum not present, or some physical volume(s) are missing.

How can i delete the faulty vg03 ?
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

reply to my own question:
mv /etc/lvmtab /etc/lvmtab.old
vgscan -a

..still trying to vgimport.
Robert-Jan Goossens
Honored Contributor

Re: retrieve data of old disk vg00

Hi CeesJan,

Wy not remove the lvol's instead of removing the whole volume group.

Robert-Jan.
John Palmer
Honored Contributor

Re: retrieve data of old disk vg00

The quickest (and safest) way to remove the faulty VG is

vgexport vg03

Are you sure that c0t3d0 is the correct disk?

Regards,
John
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

I was able to remove vg03 and now having a new try:
mkdir /dev/vg03
mknod /dev/vg03/group c 64 0x030000
vgimport /dev/vg03 /dev/dsk/c0t3d0

vgimport: Warning: Volume Group contains "0" PVs, "1" specified. Continuing.
vgimport: Quorum not present, or some physical volume(s) are missing.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

..At this point, no /dev/vg03/lvols and rlvols exists...
So the next step would (may)be:

vgchange -a y -q n /dev/vg03
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c0t3d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c0t3d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query all of the physical volumes.
vgchange: Couldn't activate volume group "/dev/vg03":
Quorum not present, or some physical volume(s) are missing.

What is my problem?
..anybody..
Elif Gius
Valued Contributor

Re: retrieve data of old disk vg00

You are getting the message because the /dev/vgxx/group device file maybe has duplicate minor numbers.


Check:
ls -la /dev/vg*/group

Elif Gius
Valued Contributor

Re: retrieve data of old disk vg00

Hi,

another thought...
Maybe the vg information on the disk is lost...

Try following:
+++
vgcfgrestore -n /dev/vg03 /dev/dsk/c0t3d0
+++
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

Okay, so i try:

# ls -la /dev/vg*/group
crw-r----- 1 root sys 64 0x000000 Jun 27 13:54 /dev/vg00/group
crw-r--r-- 1 root sys 64 0x010000 Jul 29 13:55 /dev/vg01/group
crw-r--r-- 1 root sys 64 0x030000 Oct 28 12:51 /dev/vg03/group
# vgcfgrestore -n /dev/vg03 /dev/dsk/c0t3d0
vgcfgrestore: Error opening LVM configuration file : /etc/lvmconf/vg03.conf

It can be that the LVM structure on the old disk is corrupted. It should have been a bootdisk, but during boot it tells me:
No LVM boot on a LVM disk.

Is there maybe a way to read its directory by loading the total disk as a non LVM?
(just a guess...) ?
John Palmer
Honored Contributor

Re: retrieve data of old disk vg00

This disk is empty, it's either been pvcreated or all LV's have been removed and the VG has been vgremoved.

I've recreated your symptoms by as follows:
1. pvcreate
2. vgcreate
3. lvcreate
4. lvremove
5. vgremove
6. vgimport

It's possible that the LV's still exist on the disk but in order to access them you'll either have to find a valid vgcfgbackup (probably from a backup tape) and vgcfgrestore the disk or if you have an LV map of the disk you could try lvcreate of each LV so that it exactly matches the original. The former is recommended because unless the LV's are contiguous, you'll have a lot of work to do to get the correct placement.

To do either, you'll have to do a vgcreate as you did originally because vgimport won't work.

Regards,
John
G. Vrijhoeven
Honored Contributor

Re: retrieve data of old disk vg00

Cees,

You can boot in LVM maintenance mode:

interrupt boot process
interact with ipl

hpux -lm

Gideon
Ceesjan van Hattum
Esteemed Contributor

Re: retrieve data of old disk vg00

Hi,
boot -lm did not work either, unfortunately.

John: I've regained /etc/lvmconf/vg00.conf, this was the original of the old system.
Now i put it as /etc/lvmconf/vg03.conf.
But looking at the contents:
CONFIG01
/dev/vg00
/dev/rdsk/c0t0d0
/dev/rdsk/c1t0d0
LVMREC01
HPLVMBDR=
LVMREC01
HPLVMBDR=
VGDA0001
VGSA0001=
Unfortunately, in the running system, c0t0d0 and c1t0d0 are already in use, as well as vg00.
If i want to do a vgcfgrestore, it will read the data and will attempt to introduce a 'new' vg00 on the specified slots...?
I suppose i cannot edit the file into vg03 with c0t3d0, can i?
James R. Ferguson
Acclaimed Contributor

Re: retrieve data of old disk vg00

Hi Ceesjan:

You can't edit the '/etc/lvmconf' file directly since its binary data. However, might try altering the pv_paths within using the '-o old_pv_path' argument to the 'vgcfgrestore'.

The volume group name will be taken from the conf file's contents so the syntax should look like:

# vgcfgrestore -n vgNN -o /dev/rdsk/cXtYdZ /dev/rdsk/cAtBdC

Afterwards, do your 'vgimport' and 'vgchange'.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: retrieve data of old disk vg00

Hi (again) Ceesjan:

By way of clarification, as I suggested, use the '-o' argument for your 'vgcfgrestore' to change the pv_paths to which you restore. You can specify the 'conf' file with the '-f' option if you like. It's during the subsequent 'vgimport' that you will specify a new volume group name for the process and it is at this point that your 'etc/lvmtab' will be updated.

Regards!

...JRF...