We tested out the below steps and they appeared to work. <br>
<br>
First you need to remove the partition table on /dev/sd01. So issue the
"fdisk /dev/sdo1" then delete the partition table and write out the
changes.<br>
<br>
A reboot is required since most of the lvm command fail due to the VDGA
being inconsistent with what is in the kernel. All of the filesystems,
that are in datavg, need to be commented out of /etc/fstab to avoid
having the OS try and mount them on reboot. When the system comes back
up all the volume groups, logical volumes and filesystem should be up
except for datavg, and its logical volumes and file-systems. The LVM
commands no longer will error out.<br>
<br>
Once the system is back up a VGDA needs to be created on /dev/sdo1. "pvcreate -v /dev/sdo1"<br>
Recover the old VGDA data, for /dev/sdo1. "vgcfgrestore -v -n datavg /dev/sdo1"<br>
<br>
Scan for volume groups, "vgscan"<br>
Activate the "newly" found datavg volume group, "vgchange -a y datavg"<br>
<br>
At this point we were able to see datavg, all of the logical volumes,
under datavg, and mount the filesystems. We un-commented the
filesystems entries, in /etc/fstab, rebooted a few times and verified
that the filesystem<br>
were available on the reboot.<br>
<br>
Len Smith<br>
<br><br><div><span class="gmail_quote">On 9/23/05, <b class="gmail_sendername"><a href="mailto:paul.stein@thomson.com">paul.stein@thomson.com</a></b> <<a href="mailto:paul.stein@thomson.com">paul.stein@thomson.com</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div align="left" dir="ltr"><span><font color="#0000ff" face="Arial" size="2">Additional information explaining what caused the below
errors:</font></span></div>
<div align="left" dir="ltr"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div align="left" dir="ltr"><span><font color="#0000ff" face="Arial" size="2">+++++++++++++++ start
+++++++++++++++++++++++++++++++++++++++++++++</font></span></div>
<div align="left" dir="ltr"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div align="left" dir="ltr"><span><font color="#0000ff" face="Arial" size="2"><<a href="mailto:root@paxton" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">root@paxton</a>:~>#
fdisk /dev/sdo1<br>Device contains neither a valid DOS partition table, nor Sun,
SGI or OSF disklabel<br>Building a new DOS disklabel. Changes will remain in
memory only,<br>until you decide to write them. After that, of course, the
previous<br>content won't be recoverable.</font></span></div>
<div> </div><span>
<div align="left" dir="ltr"><br><font color="#0000ff" face="Arial" size="2">The number of
cylinders for this disk is set to 3541.<br>There is nothing wrong with that, but
this is larger than 1024,<br>and could in certain setups cause problems
with:<br>1) software that runs at boot time (e.g., old versions of LILO)<br>2)
booting and partitioning software from other OSs<br> (e.g., DOS
FDISK, OS/2 FDISK)<br>Warning: invalid flag 0x0000 of partition table 4 will be
corrected by w(rite)</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): o<br>Building a new DOS disklabel. Changes will remain in memory
only,<br>until you decide to write them. After that, of course, the
previous<br>content won't be recoverable.</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><br><font color="#0000ff" face="Arial" size="2">The number of
cylinders for this disk is set to 3541.<br>There is nothing wrong with that, but
this is larger than 1024,<br>and could in certain setups cause problems
with:<br>1) software that runs at boot time (e.g., old versions of LILO)<br>2)
booting and partitioning software from other OSs<br> (e.g., DOS
FDISK, OS/2 FDISK)<br>Warning: invalid flag 0x0000 of partition table 4 will be
corrected by w(rite)</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): m<br>Command action<br> a toggle a bootable
flag<br> b edit bsd disklabel<br>
c toggle the dos compatibility flag<br> d
delete a partition<br> l list known partition
types<br> m print this menu<br>
n add a new partition<br> o create a new
empty DOS partition table<br> p print the partition
table<br> q quit without saving changes<br>
s create a new empty Sun disklabel<br> t
change a partition's system id<br> u change
display/entry units<br> v verify the partition
table<br> w write table to disk and exit<br>
x extra functionality (experts only)</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): n<br>Command action<br> e
extended<br> p primary partition (1-4)<br>p<br>Partition
number (1-4): 1<br>First cylinder (1-3541, default 1):<br>Using default value
1<br>Last cylinder or +size or +sizeM or +sizeK (1-3541, default 3541):<br>Using
default value 3541</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): t<br>Selected partition 1<br>Hex code (type L to list codes):
8e<br>Changed system type of partition 1 to 8e (Linux LVM)</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): m<br>Command action<br> a toggle a bootable
flag<br> b edit bsd disklabel<br>
c toggle the dos compatibility flag<br> d
delete a partition<br> l list known partition
types<br> m print this menu<br>
n add a new partition<br> o create a new
empty DOS partition table<br> p print the partition
table<br> q quit without saving changes<br>
s create a new empty Sun disklabel<br> t
change a partition's system id<br> u change
display/entry units<br> v verify the partition
table<br> w write table to disk and exit<br>
x extra functionality (experts only)</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): p</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Disk /dev/sdo1:
29.1 GB, 29133909504 bytes<br>255 heads, 63 sectors/track, 3541
cylinders<br>Units = cylinders of 16065 * 512 = 8225280 bytes</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2"> Device Boot
Start End
Blocks Id
System<br>/dev/sdo1p1
1 3541 28443051 8e Linux
LVM</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): v<br>62 unallocated sectors</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): v<br>62 unallocated sectors</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Command (m for
help): w<br>The partition table has been altered!</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">Calling ioctl() to
re-read partition table.</font></div>
<div><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2">WARNING:
Re-reading the partition table failed with error 16: Device or resource
busy.<br>The kernel still uses the old table.<br>The new table will be used at
the next reboot.<br>Syncing disks.</font></div>
<div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2"></font> </div>
<div align="left" dir="ltr"></div></span><span><font color="#0000ff" face="Arial" size="2">+++++++++++++++++++++++++++++ end
++++++++++++++++++++++++++++++++++++++</font></span><br>
<div align="left" dir="ltr" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:linux-lvm-bounces@redhat.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">linux-lvm-bounces@redhat.com</a>
[mailto:<a href="mailto:linux-lvm-bounces@redhat.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">linux-lvm-bounces@redhat.com</a>] <b>On Behalf Of </b>Stein, Paul (TLR
Corp)<br><b>Sent:</b> Friday, September 23, 2005 11:20 AM<br><b>To:</b>
<a href="mailto:linux-lvm@redhat.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">linux-lvm@redhat.com</a><br><b>Subject:</b> [linux-lvm] Recover Partition Table -
vgdisplay/vgscan fails<br></font><br></div><div><span class="e" id="q_106845cd9241fa54_1">
<div></div>
<div><font face="Arial" size="2"><span>I inadvertantly blew
away the partition table on /dev/sdo that was in use. While the system is still
running and no errors have occured...yet, I need</span></font></div>
<div><font face="Arial" size="2"><span>to get the partition
table restored and be able to vgdisplay the datavg. Below is the sampling
of error messages.</span></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><<a href="mailto:root@paxton:/proc/lvm" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">root@paxton:/proc/lvm</a>># vgdisplay
datavg<br>vgdisplay -- ERROR: VGDA in kernel and lvmtab are NOT consistent;
please run vgscan<br></font></div>
<div><font face="Arial" size="2"><<a href="mailto:root@paxton:/proc/lvm" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">root@paxton:/proc/lvm</a>>#
vgscan<br>vgscan -- reading all physical volumes (this may take a
while...)<br>vgscan -- found active volume group "rootvg"<br>vgscan -- found
active volume group "localvg"<br>vgscan -- found active volume group
"datavg"<br>vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get
data of volume group "datavg" from physical volume(s)<br>vgscan -- "/etc/lvmtab"
and "/etc/lvmtab.d" successfully created<br>vgscan -- WARNING: This program does
not do a VGDA backup of your volume groups</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><span><font face="Arial" size="2">Is it safe to clear
VGDA using the "dd if=/dev/zero of=PhysicalVolume bs=512 count=1" shown in
the pvcreate man pages and the come back and</font></span></div>
<div><span><font face="Arial" size="2">recreate the
VGDA using pvcreate, or use pvcreate outright not using the dd method? Or,
is there a better method to get /dev/sdo back into the
datavg</font></span></div>
<div><span><font face="Arial" size="2">group while
recreating the partition table?</font></span></div>
<div> </div>
<div align="left">
<div align="left"><font face="Comic Sans MS" size="4">Paul Stein</font></div></div>
<div> </div>
</span></div><br>_______________________________________________<br>linux-lvm mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:linux-lvm@redhat.com">linux-lvm@redhat.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.redhat.com/mailman/listinfo/linux-lvm" target="_blank">
https://www.redhat.com/mailman/listinfo/linux-lvm</a><br>read the LVM HOW-TO at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://tldp.org/HOWTO/LVM-HOWTO/" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/
</a><br><br></blockquote></div><br>