Unix Technical Forum

LVM Recovery Help Needed

This is a discussion on LVM Recovery Help Needed within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> My hard disk for /dev/vg01/lv01 had been completely dead, and I reconfigured /dev/vg01/lv01 with a brand new disk. Afterwards ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 08:59 PM
yssong66@gmail.com
 
Posts: n/a
Default LVM Recovery Help Needed


My hard disk for /dev/vg01/lv01 had been completely dead, and I
reconfigured /dev/vg01/lv01 with a brand new disk. Afterwards I found
out that my tape backup wasn't good and thus tried hooking up the
original (bad) disk, hoping to be able to get the data as the last
resort, and turned out that the original disk can barely stay up with a
lot of noise for now. It has a power problem (not replaceable since
it's too old) but the disk itself seems to be OK.

My tape backup contains /etc/lvmtab, /etc/lvmconf, etc. (OS stuff)
everything but the data that I need most from this bad disk.

Since I already reconfigured LVM for /dev/vg01/lv01, though, I'd like
to check if it's possible to undo my config. such that this old disk
data can be accessed as before by restoring some metadata stuff (maybe
/etc/lvmconf files?) from my tape backup.

Thank you for your help in advance!!!


- Young

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 08:59 PM
M
 
Posts: n/a
Default Re: LVM Recovery Help Needed

<yssong66@gmail.com> wrote in message
news:1145913061.612700.175000@e56g2000cwe.googlegr oups.com...
>
> My hard disk for /dev/vg01/lv01 had been completely dead, and I
> reconfigured /dev/vg01/lv01 with a brand new disk. Afterwards I found
> out that my tape backup wasn't good and thus tried hooking up the
> original (bad) disk, hoping to be able to get the data as the last
> resort, and turned out that the original disk can barely stay up with a
> lot of noise for now. It has a power problem (not replaceable since
> it's too old) but the disk itself seems to be OK.
>
> My tape backup contains /etc/lvmtab, /etc/lvmconf, etc. (OS stuff)
> everything but the data that I need most from this bad disk.
>
> Since I already reconfigured LVM for /dev/vg01/lv01, though, I'd like
> to check if it's possible to undo my config. such that this old disk
> data can be accessed as before by restoring some metadata stuff (maybe
> /etc/lvmconf files?) from my tape backup.
>
> Thank you for your help in advance!!!
>
>
> - Young
>


To undo your work (remove a vg from a system) use vgexport.
To have the system (try to) import the disk, use vgimport. You have to
mkdir, mknod, & chmod the vg files first.
Google "lvm reccovery"or "lvm cookbook". Although many of the hits were
Linux related, many of the techniques work in HPUX.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 08:59 PM
Robert Klute
 
Posts: n/a
Default Re: LVM Recovery Help Needed

On 24 Apr 2006 14:11:01 -0700, yssong66@gmail.com wrote:

>
>My hard disk for /dev/vg01/lv01 had been completely dead, and I
>reconfigured /dev/vg01/lv01 with a brand new disk. Afterwards I found
>out that my tape backup wasn't good and thus tried hooking up the
>original (bad) disk, hoping to be able to get the data as the last
>resort, and turned out that the original disk can barely stay up with a
>lot of noise for now. It has a power problem (not replaceable since
>it's too old) but the disk itself seems to be OK.
>
>My tape backup contains /etc/lvmtab, /etc/lvmconf, etc. (OS stuff)
>everything but the data that I need most from this bad disk.
>
>Since I already reconfigured LVM for /dev/vg01/lv01, though, I'd like
>to check if it's possible to undo my config. such that this old disk
>data can be accessed as before by restoring some metadata stuff (maybe
>/etc/lvmconf files?) from my tape backup.
>
>Thank you for your help in advance!!!


What is your exact configuration?
How did you remove the old disk and install the new one?
Is there only one disk in vg01?
Is there only one lv in vg01?

You probley DON'T need to vgexport the new volume group. What you do
need to will depend on what you did and what your hardware configuration
is.

It may be as simple as reconnecting the old drive, then
mkdir /dev/vg02
mknod /dev/vg02/group -c 64 0x020000
vgscan -v
vgimport vg02 /dev/dsk/c...
vgchange -a y vg02
mount /dev/vg02/lvol1 /...

You may need to do a vgchid, but that is doubtful.

Robert Klute
The opinions are those of the poster, not the company.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 09:01 PM
yssong66@gmail.com
 
Posts: n/a
Default Re: LVM Recovery Help Needed



Hi, thanks for your suggestion!

I restored my original /etc/lvmtab file & /etc/lvmconf directory and
then got the following:
(I'm trying to get back /dev/vg01 with /dev/dsk/c0t1d0)

# vgimport vg01 /dev/dsk/c0t1d0
vgimport: Volume group "/dev/vg01" already exists in the "/etc/lvmtab"
file.
# vgscan -v
vgscan: Warning: couldn't query physical volume "/dev/dsk/c0t1d0":
The specified path does not correspond to physical volume attached to
this volume group
vgscan: Warning: couldn't query physical volume "/dev/dsk/c0t3d0":
The specified path does not correspond to physical volume attached to
this volume group
vgscan: Warning: couldn't query all of the physical volumes.
vgscan: Couldn't access the list of physical volumes for volume group
"/dev/vg03".
vgscan: The physical volume "/dev/dsk/c0t1d0" is already recorded in
the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c0t3d0" is already recorded in
the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c0t4d0" is already recorded in
the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c0t5d0" is already recorded in
the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c0t6d0" is already recorded in
the "/etc/lvmtab" file.
Couldn't stat physical volume "/dev/dsk/c0t2d0":
Invalid argument
Couldn't stat physical volume "/dev/dsk/c0t3d0":
Invalid argument


/dev/vg01
/dev/dsk/c0t1d0




/dev/vg02
/dev/dsk/c0t4d0



/dev/vg00
/dev/dsk/c0t5d0
/dev/dsk/c0t6d0


The Volume Group /dev/vg03/group was not matched with any Physical
Volumes.
Scan of Physical Volumes Complete.
# vgdisplay /dev/vg01
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg01".


Any advice?

Thank you in advance!


- Young

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 09:01 PM
Robert Klute
 
Posts: n/a
Default Re: LVM Recovery Help Needed

On 3 May 2006 08:51:10 -0700, "yssong66@gmail.com" <yssong66@gmail.com>
wrote:

>
>
>Hi, thanks for your suggestion!
>
>I restored my original /etc/lvmtab file & /etc/lvmconf directory and
>then got the following:
>(I'm trying to get back /dev/vg01 with /dev/dsk/c0t1d0)
>
># vgimport vg01 /dev/dsk/c0t1d0
>vgimport: Volume group "/dev/vg01" already exists in the "/etc/lvmtab"
>file.
># vgscan -v
>vgscan: Warning: couldn't query physical volume "/dev/dsk/c0t1d0":
>The specified path does not correspond to physical volume attached to
>this volume group
>vgscan: Warning: couldn't query physical volume "/dev/dsk/c0t3d0":
>The specified path does not correspond to physical volume attached to
>this volume group
>vgscan: Warning: couldn't query all of the physical volumes.
>vgscan: Couldn't access the list of physical volumes for volume group
>"/dev/vg03".
>vgscan: The physical volume "/dev/dsk/c0t1d0" is already recorded in
>the "/etc/lvmtab" file.
>vgscan: The physical volume "/dev/dsk/c0t3d0" is already recorded in
>the "/etc/lvmtab" file.
>vgscan: The physical volume "/dev/dsk/c0t4d0" is already recorded in
>the "/etc/lvmtab" file.
>vgscan: The physical volume "/dev/dsk/c0t5d0" is already recorded in
>the "/etc/lvmtab" file.
>vgscan: The physical volume "/dev/dsk/c0t6d0" is already recorded in
>the "/etc/lvmtab" file.
>Couldn't stat physical volume "/dev/dsk/c0t2d0":
>Invalid argument
>Couldn't stat physical volume "/dev/dsk/c0t3d0":
>Invalid argument
>
>
>/dev/vg01
>/dev/dsk/c0t1d0
>
>
>
>
>/dev/vg02
>/dev/dsk/c0t4d0
>
>
>
>/dev/vg00
>/dev/dsk/c0t5d0
>/dev/dsk/c0t6d0
>
>
>The Volume Group /dev/vg03/group was not matched with any Physical
>Volumes.
>Scan of Physical Volumes Complete.
># vgdisplay /dev/vg01
>vgdisplay: Volume group not activated.
>vgdisplay: Cannot display volume group "/dev/vg01".
>
>
>Any advice?
>
>Thank you in advance!
>
>
>- Young


OK, since you restored you original lvmtab and lvmconf, you basically
restored the old vg01 back as vg01. The error message is saying that
vg01 is not activated.

So, at this point you would do the vgchange -a y vg01 (to activate it),
mount your vg01 lvol, and copy the data you want from that drive to a
safe place. Then unmount vg01, de-activate it, export it, attach the
new drive, make the /dev/vg01 directory, mknod group, import the new
drive as vg01, activate it, mount it, and copy the files you saved off
over to the new vg01.

My instructions for making a different volume assumed you would be able
to attach the old vg01 drive without having to remove the new vg01.
That being physically possible, you would have been able to have both
mounted at the same time and been able to selectively copy files
directly from the old disk to the new one.

Robert


The opinions expressed are those of this poster and in no way reflect
the opinions, advise, or recommendations of the company he works for.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com