Operating System - HP-UX
1834804 Members
2413 Online
110070 Solutions
New Discussion

Re: recover previous vg's

 
SOLVED
Go to solution
Ferdinand_5
Advisor

recover previous vg's

I had to do an install of a 11i machine which had suffered a find to a wrong rm *.

I have restalled the system. But what is the procedure to recover the vg's on the system?

If the stuff underneath is unreadable see the attach.



Filesystems and Usage
bdf -i
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol3 204800 77384 127400 38% 2276 3964 36% /
/dev/vg00/lvol1 295024 36200 229320 14% 65 32191 0% /stand
/dev/vg00/lvol8 2609152 872064 1731016 34% 16645 54267 23% /var
/dev/vg00/lvol7 2555904 1899768 651080 74% 54816 20480 73% /usr
/dev/stxvg01/u2 8388608 2654398 5556132 32% 135314 716774 16% /u05
/dev/stxvg01/u1 8388608 4565776 3734084 55% 22 477850 0% /u04
/dev/stxvg03/lvol4 27361280 18938680 8291468 70% 304177 526399 37% /u03
/dev/stxvg01/stxlv02
4194304 85353 3935149 2% 4 1027236 0% /u02
/dev/stxvg01/stxlv01
4194304 3339896 831488 80% 154046 213602 42% /u01
/dev/stxvg03/lv04 4096000 2292422 1703855 57% 121568 450892 21% /tport
/dev/vg00/lvol4 1536000 4960 1520472 0% 118 47818 0% /tmp
/dev/stxvg02/test 8499200 6726692 1722308 80% 481513 221559 68% /test
/dev/stxvg03/stxlvol3
4096000 3097358 936620 77% 210524 249660 46% /sx01
/dev/stxvg02/support
9216000 4745260 4344534 52% 259 558837 0% /support
/dev/stxvg02/play 1060864 1366 993287 0% 4 264872 0% /play
/dev/stxvg02/oralv01
8388608 6647645 1643849 80% 88128 435240 17% /oracle
/dev/stxvg02/oraclv02
8388608 6213231 2039544 75% 289 543843 0% /oracle/oradata
/dev/vg00/lvol6 1105920 805696 298512 73% 15697 9359 63% /opt
/dev/vg00/lvol5 1048576 603224 442024 58% 5084 13892 27% /home
ct-data:/sda3/images
6230168 4017936 1895752 68% 27 791813 0% /images
ct-data:/hdc1/db-backups/kenny
118176992 76656080 35517872 68% 2420175 12587569 16% /db-backups
Local Mountpoints
mount -lp
/dev/vg00/lvol3 / vxfs log 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 0
/dev/vg00/lvol8 /var vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol7 /usr vxfs delaylog,nodatainlog 0 0
/dev/stxvg01/u2 /u05 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg01/u1 /u04 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg03/lvol4 /u03 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg01/stxlv02 /u02 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg01/stxlv01 /u01 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg03/lv04 /tport vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/vg00/lvol4 /tmp vxfs delaylog,nodatainlog 0 0
/dev/stxvg02/test /test vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg03/stxlvol3 /sx01 vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg02/support /support vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg02/play /play vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/stxvg02/oralv01 /oracle vxfs delaylog,nodatainlog,largefiles 0 0
/dev/stxvg02/oraclv02 /oracle/oradata vxfs delaylog,nodatainlog,nolargefiles 0 0
/dev/vg00/lvol6 /opt vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol5 /home vxfs delaylog,nodatainlog 0 0
Hint: /sbin/vxtunefs mount_point to get JFS parameters
12 REPLIES 12
Robert-Jan Goossens_1
Honored Contributor

Re: recover previous vg's

Hello Ferdinand,

I'm missing the clue of your question. If I look at your attached doc it seems you recovered at least a part of your volume groups. Could you please explain how we can help you, and what you are missing ?

Do you have some kind of backup (ignite/fbackup etc) ?

Best regards,
Robert-Jan
Ferdinand_5
Advisor

Re: recover previous vg's

Hi there,

This is a cfg2html file I made earlier.

It is not the current situation. This is how I would like it back without reinstalling that as well.

This is the current situation:

# bdf -i
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol3 204800 67760 135976 33% 1822 4258 30% /
/dev/vg00/lvol1 295024 51952 213568 20% 62 32194 0% /stand
/dev/vg00/lvol8 2609152 165504 2425048 6% 7057 76335 8% /var
/dev/vg00/lvol7 1019904 862880 155808 85% 28931 4893 86% /usr
/dev/vg00/lvol4 204800 2432 200856 1% 24 6312 0% /tmp
/dev/vg00/lvol6 897024 782512 113632 87% 15109 3547 81% /opt
/dev/vg00/lvol5 20480 2280 18072 11% 4 540 1% /home
# mount -lp
/dev/vg00/lvol3 / vxfs log 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 0
/dev/vg00/lvol8 /var vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol7 /usr vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol4 /tmp vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol6 /opt vxfs delaylog,nodatainlog 0 0
/dev/vg00/lvol5 /home vxfs delaylog,nodatainlog 0 0
#

c1t15d0 is my root disk.

# ioscan -fnCdisk
Class I H/W Path Driver S/W State H/W Type Description
======================================================================
disk 0 0/0/1/0.1.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c0t1d0 /dev/rdsk/c0t1d0
disk 1 0/0/1/1.15.0 sdisk CLAIMED DEVICE HP 18.2GMAN3184MC
/dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 2 0/2/0/0.8.0 sdisk CLAIMED DEVICE HP 36.4GATLAS10K3_36_SCA
/dev/dsk/c4t8d0 /dev/rdsk/c4t8d0
disk 3 0/2/0/0.10.0 sdisk CLAIMED DEVICE HP 36.4GST336706LC
/dev/dsk/c4t10d0 /dev/rdsk/c4t10d0
disk 4 0/2/0/0.12.0 sdisk CLAIMED DEVICE HP 36.4GST336706LC
/dev/dsk/c4t12d0 /dev/rdsk/c4t12d0
disk 5 0/2/0/0.14.0 sdisk CLAIMED DEVICE HP 36.4GATLAS10K3_36_SCA
/dev/dsk/c4t14d0 /dev/rdsk/c4t14d0
#
Robert-Jan Goossens_1
Honored Contributor

Re: recover previous vg's

I see.

did you try a vgscan of the other disks, to check if there are still vgconf infos on the disks.

# vgscan -a -p -v

Regards,
Robert-Jan
Ferdinand_5
Advisor

Re: recover previous vg's

Hi mr Goosens,

I also saw in SAM that I could import 3 vg's.
But I'd like to make sure what I do in SAM is not destructive when I do the import.


# vgscan -a -p -v
vgscan: The physical volume "/dev/dsk/c1t15d0" is already recorded in the "/etc/lvmtab" file.
Physical Volume "/dev/dsk/c0t1d0" contains no LVM information
Physical Volume "/dev/dsk/c4t14d0" contains no LVM information


/dev/vg00
/dev/dsk/c1t15d0


Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c4t8d0

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c4t10d0

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c4t12d0

#
bhavin asokan
Honored Contributor

Re: recover previous vg's

hi,

do you have a previous copy of lvmtab.
if yes see its contents for which disk belongs to which VG.(strings /etc/lvmtab)

for example :

if you find disks /dev/dsk/c4t8d0 , /dev/dsk/c4t10d0 , /dev/dsk/c4t12d0 was in volume group stxvg01

then

vgimport -v /dev/stxvg01 /dev/dsk/c4t8d0 /dev/dsk/c4t10d0 /dev/dsk/c4t12d0

like this you have to do for all VG



regds,
Ferdinand_5
Advisor

Re: recover previous vg's

LVM Overview
PrintLVM
Primary Alter. Log.Volume Size/PE Free/PE MinorNr Filesys LVSize Mirrors Mount Point Controller/Product/HW Path
c1t15d0 vg00/lvol1 4340 1541 000001 hfs 300 0 /stand SCSI/SCSI (MAN3184MC)-0/0/1/1.15.0
vg00/lvol2 000002 raw 2048 0 ***swap***
vg00/lvol3 000003 vxfs4 200 0 /
vg00/lvol4 000004 vxfs4 1500 0 /tmp
vg00/lvol5 000005 vxfs4 1024 0 /home
vg00/lvol6 000006 vxfs4 1080 0 /opt
vg00/lvol7 000007 vxfs4 2496 0 /usr
vg00/lvol8 000008 vxfs4 2548 0 /var
c4t10d0 stxvg01/stxlv01 8681 2537 010001 vxfs4 4096 0 /u01 SCSI/SCSI (ST336706LC)-0/2/0/0.10.0
stxvg01/stxlv02 010002 vxfs4 4096 0 /u02
stxvg01/u1 010003 vxfs4 8192 0 /u04
stxvg01/u2 010004 vxfs4 8192 0 /u05
c4t12d0 stxvg02/oralv01 8681 1 020001 vxfs4294967295 8192 0 /oracle SCSI/SCSI (ST336706LC)-0/2/0/0.12.0
stxvg02/oraclv02 020002 vxfs4294967295 8192 0 /oracle/oradata
stxvg02/support 020003 vxfs4 9000 0 /support
stxvg02/test 020004 vxfs4 8300 0 /test
stxvg02/play 020005 vxfs4 1036 0 /play
c4t8d0 stxvg03/stxlvol3 8681 1 030001 vxfs4 4000 0 /sx01 SCSI/SCSI (ATLAS10K3_36_SCA)-0/2/0/0.8.0
stxvg03/lv04 030002 vxfs4 4000 0 /tport
stxvg03/lvol4 030003 vxfs4 26720 0 /u03
Hint: mkfs -m /dev/vgXX/rlvolYY - displays the commandline which created the filesystem

LVM-Tab
strings /etc/lvmtab | grep dev
/dev/vg00
/dev/dsk/c1t15d0
/dev/stxvg01
/dev/dsk/c4t10d0
/dev/stxvg02
/dev/dsk/c4t12d0
/dev/stxvg03
/dev/dsk/c4t8d0
bhavin asokan
Honored Contributor

Re: recover previous vg's

hi,

from your posts i assume that 3 disks belongs to three different VGs.
you should create the directory for that VG in /dev and group file before vgimport.

you can view the preview of vgimport with -p option
vgimport -p -v /dev/stxvg01 /dev/dsk/c4t8d0


after the vg is created change do a vgchange -a -y

regds,
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: recover previous vg's

Following Physical Volumes belong to one Volume Group. Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c4t8d0
/dev/dsk/c4t10d0
/dev/dsk/c4t12d0

ok, you are missing 3 volume groups
/dev/stxvg01 c4t10d0
/dev/stxvg02 c4t12d0
/dev/stxvg03 c4t8d0

# mkdir /dev/stxvg01
# mkdir /dev/stxvg02
# mkdir /dev/stxvg03
# mknod /dev/stxvg01/group c 64 0x010000
# mknod /dev/stxvg02/group c 64 0x020000
# mknod /dev/stxvg03/group c 64 0x030000
# vgimport stxvg01 /dev/dsk/c4t10d0
# vgchange -a y stxvg01
# vgcfgbackup stxvg01
# vgimport stxvg02 /dev/dsk/c4t12d0
# vgchange -a y stxvg02
# vgcfgbackup stxvg02
# vgimport stxvg03 /dev/dsk/c4t8d0
# vgchange -a y stxvg03
# vgcfgbackup stxvg03

Regards,
Robert-Jan
Ferdinand_5
Advisor

Re: recover previous vg's

I tried:

# vgimport -v /dev/stxvg01 /dev/dsk/c4t10d0
Beginning the import process on Volume Group "/dev/stxvg01".
vgimport: "/dev/stxvg01/group": not a character device.
# vgimport -v /dev/stxvg02 /dev/dsk/c4t12d0
Beginning the import process on Volume Group "/dev/stxvg02".
vgimport: "/dev/stxvg02/group": not a character device.
# vgimport -v /dev/stxvg03 /dev/dsk/c4t8d0
Beginning the import process on Volume Group "/dev/stxvg03".
vgimport: "/dev/stxvg03/group": not a character device.
# vgdisplay -v /dev/vgstx03
vgdisplay: Volume group "/dev/vgstx03" does not exist in the "/etc/lvmtab" file.
vgdisplay: Cannot display volume group "/dev/vgstx03".


Am I doing something wrong?

F
bhavin asokan
Honored Contributor

Re: recover previous vg's

hi,
when you vgimport you will not get the exact name of lvols as you have given earlier (because you don't have a map file for that VG.if you have a latest map file for that vg thenonly you will get the exact lvolnames.if you have vgimport with -m option.otherwise you should mount it to a temporary directory find the exact type then mount it to its original directory.

see man page of vgimport
-m mapfile Specify the name of the file from which logical
volume names and numbers are to be read. This
option is optional when used as in the first
command line format of the SYNOPSIS. If this
option is not specified, logical volume names are
created using the default naming convention lvolnn
where nn is the logical volume minor number. When
used with the -s option, the volume group
specified in the mapfile can be shared among the
exporting system and the importing systems.
dev/vg00
/dev/dsk/c1t15d0
/dev/stxvg01
/dev/dsk/c4t10d0
/dev/stxvg02
/dev/dsk/c4t12d0
/dev/stxvg03
/dev/dsk/c4t8d0

regds,




bhavin asokan
Honored Contributor

Re: recover previous vg's

hi,
you have created the group files properly as per robert

# mknod /dev/stxvg01/group c 64 0x010000
# mknod /dev/stxvg02/group c 64 0x020000
# mknod /dev/stxvg03/group c 64 0x030000

see it looks like this
#ll /dev/*/group

crw-r----- 1 root sys 64 0x000000 Sep 20 2002 /dev/vg00/group
crw-rw-rw- 1 root sys 64 0x010000 Apr 23 2004 /dev/vg01/group
crw-rw-rw- 1 root sys 64 0x070000 Sep 20 2002 /dev/vg07/group
crw-rw-rw- 1 root sys 64 0x080000 Mar 24 2004 /dev/vg08/group


regds,
Ferdinand_5
Advisor

Re: recover previous vg's

I wish there was a donate "Large Beer" button on this site somewhere.

Your help was fantastic!

Idiot proof!

Regards,

Ferdinand