[SUMMARY] undo vgremove

From: Ben K. <ben9coder_at_gmail.com>
Date: Thu Sep 21 2006 - 09:35:35 EDT
I really had only one response implying the disk is now unusable. Others
pointed out this question did not relate to Solaris. Thanks for all who
replied. I'm just posting the summary in case someone looks up this thread.

I had hoped, since pvcreate does not touch the data area, the data would be
intact. And indeed it was.

I couldn't do vgcfgrestore since there was nothing under /etc/lvm/backup
directory, and that was why I felt at a loss , but fortunately I had several
in the /etc/lvm/archive directory. (Looks like lvm creates this each time vg
is changed, automatically.)
I did the following and the disk is now ok.

pvcreate -t -u wlYlE8-MUsB-x1Mw-g8by-RsyV-5F8i-57dee3 -v /dev/sdb
    (I kept the old id before, and used this, but I'm not sure whether it
helped or not.)
vgcreate -f /etc/lvm/archive/VolGroup01_00007.vg VolGroup01
lvcreate -v -L 372.59G VolGroup01 (-n LogVol10)

Then just did e2fsck -y VolGroup01/LogVol10. E2fsck reported some errors
(Almost all was about block id being off by 8). But when it was done, the
disk was clean.


My original requests follow.
====================================
1)
This is about lvm.

I had a disk, say /dev/sdb on lvm. Did pvcreate, vgcreate and lvcreate to
get something like /dev/VolGroup01/LogVol10.
lvdisplay had:
  LV Name                /dev/VolGroup01/LogVol10
  VG Name                VolGroup01

Later unmounted it, and removed the lv using
    lvremove VolGroup01/LogVol10
Then I did vgremove, which removed the volgroup and physical volume.

Now, somehow it became important to get the data back, so I did pvcreate on
the disk again thinking it might reconnect the disk to the old lv. But
apparently this was very stupid. I'm afraid I just emptied the partition
table.

I'm not familiar with this lvm, so wanted to get help. Is it possible to get
the data back? The disk was not used since it was removed, except that
pvcreate was run on it.

When I looked at it using fdisk,  expert mode, the partition table seemed
all 0. Probably the partition table is completely gone, but I'm hoping the
data is there.

2) The platform is Fedora Core 4. But I thought some people probably have
couple linux boxes lying around, and thought this would be the best forum to
ask. Please accept my apology if I have stepped on the line but I'd
appreciate any pointer.

I have previous information from pvdisplay, lvdisplay etc. if it's useful.

Linux  2.6.17-1.2139_FC4smp #1 SMP

Here's fdisk information: I didn't do write.

#fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF
disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 48641.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by
w(rite)

Command (m for help): p

Disk /dev/sdb: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
(This line is empty...)
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Sep 21 09:36:10 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:01 EST