Operating System - HP-UX
1830147 Members
21915 Online
109999 Solutions
New Discussion

Re: LVM - mounting a disk with data on it...

 
SOLVED
Go to solution
Peetu
Advisor

LVM - mounting a disk with data on it...

OK, the answer to this question might be really simple. I'm having trouble understanding simply how to take a hard

disk which has data on it and mount it.

I have a HP visualize C3000, and there used to be two SCSI towers connected to it, one containing a tape drive, and

one containing a single hard disk. The tower that housed the hard disk had a power supply failure, and I then moved

the hard disk into the tower with the tape drive in it.

Before the failure, (I think) the hard disk housed single partitions, each for for /opt, /opt2, /oldhome. Here's

the /etc/fstab contents:
--------------------------
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand nfs defaults 0 1
/dev/vg02/lvol1 /oldhome vxfs delaylog 0 2
/dev/vg02/lvol2 /opt vxfs delaylog 0 2
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /usr vxfs delaylog 0 2
/dev/vg00/lvol6 /var vxfs delaylog 0 2
/dev/vg02/lvol7 /opt2 vxfs rw,suid,nolargefiles,delaylog,datainlog 0 2

I've omitted nfs drives.

The vg00 volumes seem to work, and the vg02 don't.

With the command 'ioscan -funC disk' I can see the disk drive, so it seems to work. It is the SEAGATE ST336607LW.
Also the C3000's inner hard drive, the CD-ROM drive, and the tape drive are visible.

Here's the output of 'ioscan -funC disk' (written by hand...)

Class I HWPath Driver S/W st. H/W type Desc.
---------------------------------------------------------------------------------
disk 0 10/0/14/0.0.0 sdisk CLAIMED DEVICE TEAC CD-532E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0

disk 7 10/0/15/0.4.0 sdisk CLAIMED DEVICE SEAGATE ST336607LW
/dev/dsk/c2t4d0 /dev/rdsk/c2t4d0

disk 6 10/0/15/0.5.0 sdisk CLAIMED DEVICE IBM IC35L036UCD210-0
/dev/dsk/c3t5d0 /dev/rdsk/c3t5d0

disk 3 10/0/15/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST39102LC
/dev/dsk/c3t6d0 /dev/rdsk/c3t6d0


So, how should I proceed. I quess I should create vg02 again and add this disk to it, but I'm afraid I will wipe

out the data on the disk in the process. Every howto I've found seems to describe only adding NEW disks to the

volume groups.

My HP-UX version is B.11.00 (gotten with 'uname -a' command).

More to follow...
14 REPLIES 14

Re: LVM - mounting a disk with data on it...

Your data is still there, you just need to tell HP-UX where to find the disk(s) in vg02.

I'd expect the following would work:

cp /etc/lvmtab /etc/lvmtab.old
vgscan -a -v
vgchange -a y vg02
mount -a

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

Thanks for the quick reply!

The vgchange command couldn't activate colume group vg02...

Output was something like this:
--------------------------------
vgchange: Warning: Couldn't attach to the volume group physical colume "/dev/dsk/c3t4d0"
...
blabla, same thing repeated practically
...
vgchange: Couldn't activate vlume group "vg02":
Quorum not present of some physical volumes are missing.

This /dev/dsk/c3t4d0 is the old address for the disk, _I think_. The address changed (I QUESS) when I had to change the SCSI tower and consequently the SCSI port it attaches to...
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

So what I'd need is to tell HP-UX that that old disk of vg02 is now /dev/dsk/c2t4d0...

Should vgscan have done that?
Jeeshan
Honored Contributor

Re: LVM - mounting a disk with data on it...

you can do it if you have map files in /etc/lvmconf directory.
a warrior never quits
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

i have the files:
lvm_lock
vg00.conf to vg03.conf
and also a couple of ".old" files of those...

but I don't get what exactly should I do?

Re: LVM - mounting a disk with data on it...

Yes vgscan should have sorted it out.

What's the output of:

strings /etc/lvmtab


HTH

Duncan

I am an HPE Employee
Accept or Kudo
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

strings /etc/lvmtab output:

/dev/vg00
/dev/dsk/c3t6d0
/dev/vg01
/dev/dsk/c2t1d0
/dev/dsk/c2t0d0
/dev/vg02
/dev/dsk/c3t5d0
/dev/dsk/c3t4d0
/dev/vg03
/dev/dsk/c2t4d0

Re: LVM - mounting a disk with data on it...

So the lvmtab thinks that the disk you mention is actually part of vg03... did you even know you had a vg03?

Just for completeness can you post the output of:

strings /etc/lvmtab.old

HTH

Duncan


I am an HPE Employee
Accept or Kudo
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

Nope... :o

Anyway, nothing from that vg03 wasn't mounted anywhere. I'm happy if I can just restore the vg02 to use.

The lvmtab.old is exactly similar to the lvmtab file. I now tried the vgscan again, and the lvmtab file stayed the same still.

Output of vgscan -a -v is something like:
--------------------------
vgscan: The physical volume "/dev/dsk/c2t4d0" is already recorded in the "/etc/lvmtab" file
vgscan: The physical volume "/dev/dsk/c3t5d0" is already recorded in the "/etc/lvmtab" file
vgscan: The physical volume "/dev/dsk/c2t6d0" is already recorded in the "/etc/lvmtab" file
Physical Volume "/dev/dsk/c0t0d0" contains no LVM information

/dev/vg02
/dev/dsk/c2t4d0
/dev/dsk/c3t5d0


/dev/vg00
/dev/dsk/c3t5d0

The Volume Group /dev/vg01 was not matched with any Physical Volumes.
The Volume Group /dev/vg03 was not matched with any Physical Volumes.
Scan of Physical Volumes Complete.


-------------------------
the output of vgscan looks ok to me, and it seems to recognize the disk as part of vg02 but doesn't seem to do anything for /etc/lvmtab...

Re: LVM - mounting a disk with data on it...

hmmm,

try (re)moving the current lvmtab file and trying again:

mv /etc/lvmtab /etc/lvmtab.old.2
vgscan -a -v


HTH

Duncan

I am an HPE Employee
Accept or Kudo
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

OK! Now I got the vgscan to change the lmtab file, and now there's only the two vgs 00 and 02.

Looks good. Ran the 'vgchange -a v vg02' command, it said that vg02 was successfully changed.

Now stuck at the mount command. It suggests the three vg02 partitions (or logical volumes or whatever) are corrupted and need to be checked, which is quite understandable since the power supply for the drive failed while they were mounted.

So, how do I run a check on those?

I'm really a newbie when it comes to HP-UX & hard disks...

Thanks for all your help so far!
Solution

Re: LVM - mounting a disk with data on it...

Just use fsck to fix up the raw logical volumes...

1. Identify all the raw logical volumes using:

ls /dev/vg02/r*

2. For each raw logical volume issue:

fsck -F vxfs -y

e.g.

fsck -F vxfs -y /dev/vg02/rlvol1

3. Try the mount again:

mount -a

HTH

Duncan

I am an HPE Employee
Accept or Kudo

Re: LVM - mounting a disk with data on it...

I'm assuming that the filesystems are vxfs, but given the OS is pretty old, they might I guess be hfs. You can check before running the fsck using fstyp:

fstyp /dev/vg02/rlvol1

If they're hfs then the fsck changes as you would expect:

fsck -F hfs -y /dev/vg02/rlvol1

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Peetu
Advisor

Re: LVM - mounting a disk with data on it...

It's now working. :)

Thanks a lot!