1836460 Members
2278 Online
110101 Solutions
New Discussion

Re: Broken LV

 
SOLVED
Go to solution
Tom Jackson
Valued Contributor

Broken LV

Hi:

This morning, I'm hosed.

I've been trying to add a tape drive to my J6000, now my external disks have changed their scsi id's and I can't get them back online.

The device files exist (/dev/vg02/group).
pvcreate was successful.
vgcreate gives me the following error:

vgcreate: Volume group "/dev/vg02" already exists in the "/etc/lvmtab" file.

I try activating the volume and I get the following:

vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c2t12d0":
The path of the physical volume refers to a device that does not exist, or is not configured into the kernel". bla, bla, bla.

Please help me before I cause further distruction!

Tom :-(
15 REPLIES 15
Eugeny Brychkov
Honored Contributor

Re: Broken LV

Tom,
why SCSI Ids got changed? Did you do it manually?
Before doing it you could do vgexport for vg02, and after changing Ids do vgimport. As soon as you've already killed one of physical volumes within vg, I think you will need to restore from the backup. Now you can go vgcfgrestore for this disk you killed, and then restore data. But before doing it return old SCSI Ids back...
Eugeny
Armin Feller
Honored Contributor

Re: Broken LV

Hi Tom,

you have to vgexport/import the volume group to fix this problem:

# vgexport -m /tmp/vg02.map vg02

# mkdir /dev/vg02/
# mknod /dev/vg02/group c 64 0x020000
# vgimport -m /tmp/vg02.map /dev/dsk/c2t12d0
# vgchange -a y vg02
# vgdisplay vg02

Regards ...
Armin
Uday_S_Ankolekar
Honored Contributor

Re: Broken LV

Check with command vgdisplay -v /dev/vg02 and see if it gives list of disk(s) in vg02 at the end of vgdisplay output.

Also check what pvdisplay /dev/dsk/c2t12d0 and see if this is a part of any VG's

Output of these commands will be helpful for further investigation.

-USA..
Good Luck..
MANOJ SRIVASTAVA
Honored Contributor

Re: Broken LV

Hi Tom


The best thing would be to revert back to the orginal mode , ie remove the tape drive and then reboot the system . THis would let the system come up properly if u ahvenet changed the disk id's. Incase you still ahve problems you can check for the device files /etc/lvmconf/vg02.conf doing a stirngs to know waht was the priginal device file and then either do a vcfgrestore or export and then import the volume group.


Manoj Srivastava
Tom Jackson
Valued Contributor

Re: Broken LV

Hi:

The scsi id's changed when I connected the tape drive to the same scsi bus. The addresses for the disks were 10/0/15/0.12.0 and 10/0/15/0.14.0. The current addresses are 10/0/15/0.13.0 and 10/0/15/0.15.0. Pretty weird.

There are no jumpers connected to the scsi id jumper block on either disk. They should both be set to id zero.

I did a vgexport before adding the tape drive, so I have a map file for vg02. I don't have a map file for vg03, however, vg02 mirrors (via script) the system disk vg00 and vg03 mirrors (also via script) vg01. So can I create a map file, if needed, from vg01 for vg03?

I don't know how to reset the ids back to their original settings. I removed the tape drive, did a SEA from IPL and the ids stayed the same.

Tom
Armin Feller
Honored Contributor

Re: Broken LV

Hi Tom,

yes you can create a mapfile for importing vg03.

# vgexport -p -m /tmp/vg00.map vg00
# vi /tmp/vg00.map (and edit the ascii file if necessary)
# mv /tmp/vg00.map /tmp/vg03.map

# mkdir /dev/vg03/
# mknod /dev/vg03/group c 64 0x030000
# vgimport -m /tmp/vg03.map /dev/dsk/cYtXdZ
# vgchange -a y vg03
# vgdisplay vg03


Regards ...
Armin
Tom Jackson
Valued Contributor

Re: Broken LV

Here's the output from vgdisplay -v /dev/vg02:

vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg02".

Here's the output from pvdisplay /dev/dsk/c2t12d0:

pvdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t12d0":
The specified path does not correspond to physical volume attached to
this volume group
pvdisplay: Warning: couldn't query all of the physical volumes.
pvdisplay: Couldn't retrieve the names of the physical volumes
belonging to volume group "/dev/vg02".
pvdisplay: Cannot display physical volume "/dev/dsk/c2t12d0".

Here's strings vg02.conf:

CONFIG01
/dev/vg02
/dev/rdsk/c2t12d0
LVMREC01w
HPLVMBDR;r
vCVGDA0001
VGSA0001;r

Somehow, I need the lv config to show device /dev/rdsk/c2t13d0 instead of /dev/rdsk/c2t12d0.

Tom
hpuxhelp
Regular Advisor

Re: Broken LV

hello tom,
Before you do anything, there is a way to recovery this so don't vgexport the vg group yet. Try this

mv /etc/lvmtab /etc/lvmtab.old
vgscan -v ( to rebuild your lvmtab)...if the h/w path has been changes but the configuration of the vg has not been modified , they know and they can rebuild it for you....
and by changing the /etc/lvmtab.old so you can have the copy in case you mess up something.....
try this
Tom Jackson
Valued Contributor

Re: Broken LV

Hi:

I removed /etc/lvmtab. I created an entry for vg03, but nothing for vg02. I got a message:

Physical volume /dev/dsk/c2t13d0 is not part of a Volume Group.

I tried to run my mirror script for vg03, but I got several of these errors:

/dev/vg03/rlvol1: No such device or address
dd: cannot create /dev/vg03/rlvol1

Tom

Uday_S_Ankolekar
Honored Contributor

Re: Broken LV

Copy /etc/lvmtab as somefile.
run vgscan -p -v ( This will scan all physical valoume but will not create/update /etc/lvmtab.
If it looks OK for you then run vgscan -v. This will create a new lvmtab. Then contincue with your other vgcreation stuff.
Good Luck..
Tom Jackson
Valued Contributor

Re: Broken LV

Hi:

vgscan seemed to work ok. I attached the script I originally used to create vg02. I made changes for the new scsi id. Here's the output when I run the script:

mkdir: cannot create /dev/vg02: File exists
mknod: File exists
pvcreate: The physical volume "/dev/dsk/c2t13d0" is already recorded in the "/etc/lvmtab" file.
hpux -lq
vgcreate: Volume group "/dev/vg02" already exists in the "/etc/lvmtab" file.
lvcreate: Logical volume "/dev/vg02/lvol1" already exists.
lvcreate: Logical volume "/dev/vg02/lvol2" already exists.
lvcreate: Logical volume "/dev/vg02/lvol3" already exists.
lvcreate: Logical volume "/dev/vg02/lvol4" already exists.
lvcreate: Logical volume "/dev/vg02/lvol5" already exists.
lvcreate: Logical volume "/dev/vg02/lvol6" already exists.
lvcreate: Logical volume "/dev/vg02/lvol7" already exists.
lvcreate: Logical volume "/dev/vg02/lvol8" already exists.
lvlnboot: Logical Volume "/dev/vg02/lvol1" must be contiguous.
lvlnboot: Logical Volume "/dev/vg02/lvol3" must be contiguous.
lvlnboot: Logical Volume "/dev/vg02/lvol2" must be contiguous.
lvlnboot: Logical Volume "/dev/vg02/lvol2" must be contiguous.


Tom
Tom Jackson
Valued Contributor

Re: Broken LV

Oops:

Here's the script I forgot to attach in my last message.

Tom
Uday_S_Ankolekar
Honored Contributor

Re: Broken LV

Before run your script, and after running vgscan ...
1. did you find anything related to vg02 in lvmtab file? ( strings /etc/lvmtab would show you this)
2. See if dir vg02 there in in /dev

If both are true then check minor number of vg02

3. Do you have any data in /dev/vg02/lvol1 ? ( lvdisplay /dev/vg02/lvol1)

4. Try activating VG by vgchange -a y /dev/vg02.

5. Finally Check what exactly your script does.

-USA..
Good Luck..
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Broken LV

Your script is failing because I think you have dir called vg02 in /dev

If there is no data on vg02 , Remove /dev/vg02 directory and rerun your script.
Good Luck..
Tom Jackson
Valued Contributor

Re: Broken LV

Uday:

THANK YOU, THANK YOU, THANK YOU!!!

And thanks to everyone else that help me get through this snafu. :-)))))

I think the two tricks were the vgchange and deleting the /dev/vg02 directory.

I ran my vg_create script with no errors! Then I ran the script that mirrors the disks and it worked!

I still don't know why the scsi id changed. Oh well, at least I can go home today.

Thanks again,

Tom