* [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
@ 2011-04-27 3:07 Chris Streeter
0 siblings, 0 replies; 7+ messages in thread
From: Chris Streeter @ 2011-04-27 3:07 UTC (permalink / raw)
To: linux-lvm
Ok, so I'm stupid and made a serious and grave mistake. On my linux
box running Ubuntu 10.10, I have a 1.5TB RAID array that I had
originally setup using the instructions located here:
http://www.gagme.com/greg/linux/raid-lvm.php The RAID array is a 4 x
500GB RAID 5 array with an ext3 formatted filesystem and is not my
boot device. The RAID array was just used for storage. The LVM setup
is a single physical volume (the RAID device) and a single logical
volume that makes up the entire physical volume.
So here is the list of steps that I ended up doing, based on the
contents of the files in /etc/lvm/archive (one file was created before
each step, and the file lists what the command was):
lvremove /dev/raid_vg/lv0
lvcreate -l 357702 raid_vg -n lv0
lvremove raid_vg
lvcreate -l 357702 raid_vg -n lv0
lvremove raid_vg
vgexport raid_vg
vgimport raid_vg
vgscan
lvremove raid_vg
vgcreate raid_vg /dev/md1
So, I accidentally called lvremove instead of lvchange -a n Then I
realized my mistake and tried to restore the logical volume. But that
made the disk seem empty.
Now, I'm not sure, but I don't think the data was wiped (at least not
all of it). I've cloned the device with ddrescue just so I don't loose
anything and can experiment on the image.
Now, my question is then, is it possible to restore the LVM
information to the disk and get my filesystem back? I've got the
configuration files in /etc/lvm/archive which give me the start
extents, sizes and extent counts.
Any help that anyone might be able to provide would be extremely
appreciated. I was an idiot and screwed myself. I just hope that it
was temporary and I can get my data back.
- Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
@ 2011-04-27 3:12 Chris Streeter
2011-04-27 3:41 ` Stuart D. Gathman
0 siblings, 1 reply; 7+ messages in thread
From: Chris Streeter @ 2011-04-27 3:12 UTC (permalink / raw)
To: linux-lvm
Ok, so I'm stupid and made a serious and grave mistake. On my linux
box running Ubuntu 10.10, I have a 1.5TB RAID array that I had
originally setup using the instructions located here:
http://www.gagme.com/greg/linux/raid-lvm.php The RAID array is a 4 x
500GB RAID 5 array with an ext3 formatted filesystem and is not my
boot device. The RAID array was just used for storage. The LVM setup
is a single physical volume (the RAID device) and a single logical
volume that makes up the entire physical volume.
So here is the list of steps that I ended up doing, based on the
contents of the files in /etc/lvm/archive (one file was created before
each step, and the file lists what the command was):
lvremove /dev/raid_vg/lv0
lvcreate -l 357702 raid_vg -n lv0
lvremove raid_vg
lvcreate -l 357702 raid_vg -n lv0
lvremove raid_vg
vgexport raid_vg
vgimport raid_vg
vgscan
lvremove raid_vg
vgcreate raid_vg /dev/md1
So, I accidentally called lvremove instead of lvchange -a n Then I
realized my mistake and tried to restore the logical volume. But that
made the disk seem empty.
Now, I'm not sure, but I don't think the data was wiped (at least not
all of it). I've cloned the device with ddrescue just so I don't loose
anything and can experiment on the image.
Now, my question is then, is it possible to restore the LVM
information to the disk and get my filesystem back? I've got the
configuration files in /etc/lvm/archive which give me the start
extents, sizes and extent counts.
Any help that anyone might be able to provide would be extremely
appreciated. I was an idiot and screwed myself. I just hope that it
was temporary and I can get my data back.
- Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
2011-04-27 3:12 [linux-lvm] Recovering Accidentally Destroyed LVM2 Information Chris Streeter
@ 2011-04-27 3:41 ` Stuart D. Gathman
2011-04-27 3:58 ` Chris Streeter
0 siblings, 1 reply; 7+ messages in thread
From: Stuart D. Gathman @ 2011-04-27 3:41 UTC (permalink / raw)
To: LVM general discussion and development
On Tue, 26 Apr 2011, Chris Streeter wrote:
> So, I accidentally called lvremove instead of lvchange -a n Then I
> realized my mistake and tried to restore the logical volume. But that
> made the disk seem empty.
You didn't restore the LV, you created a new one. That clears the first
block, so you likely will need recovery efforts on your erstwhile
filesystem.
What you *should* have done is restore the metadata to the point before
your errant command. You can still do that (if it is still in the archive),
but the several K of zeros written to the start of the LV you created will
require recovery.
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
2011-04-27 3:41 ` Stuart D. Gathman
@ 2011-04-27 3:58 ` Chris Streeter
2011-04-27 13:03 ` Stuart D. Gathman
2011-04-27 14:57 ` Ray Morris
0 siblings, 2 replies; 7+ messages in thread
From: Chris Streeter @ 2011-04-27 3:58 UTC (permalink / raw)
To: LVM general discussion and development
> What you *should* have done is restore the metadata to the point before
> your errant command. �You can still do that (if it is still in the archive),
> but the several K of zeros written to the start of the LV you created will
> require recovery.
So I still have all the files in the archive of the form raid_vg_0000*.vg
If have those files, how would I go about restoring the metadata to
the device? If I were to loose several K of data, I'm totally fine
with that.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
2011-04-27 3:58 ` Chris Streeter
@ 2011-04-27 13:03 ` Stuart D. Gathman
2011-04-27 14:57 ` Ray Morris
1 sibling, 0 replies; 7+ messages in thread
From: Stuart D. Gathman @ 2011-04-27 13:03 UTC (permalink / raw)
To: LVM general discussion and development
On Tue, 26 Apr 2011, Chris Streeter wrote:
>> What you *should* have done is restore the metadata to the point before
>> your errant command. You can still do that (if it is still in the archive),
>> but the several K of zeros written to the start of the LV you created will
>> require recovery.
>
> So I still have all the files in the archive of the form raid_vg_0000*.vg
>
> If have those files, how would I go about restoring the metadata to
> the device? If I were to loose several K of data, I'm totally fine
> with that.
man vgcfgrestore
I believe you want
# vgcfgrestore -f /path/to/archived/metadata raid_vg
The '-l' option should list available archives if vg is still live.
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
2011-04-27 3:58 ` Chris Streeter
2011-04-27 13:03 ` Stuart D. Gathman
@ 2011-04-27 14:57 ` Ray Morris
2011-04-27 22:02 ` Chris Streeter
1 sibling, 1 reply; 7+ messages in thread
From: Ray Morris @ 2011-04-27 14:57 UTC (permalink / raw)
To: linux-lvm
vgcfgrestore -f /etc/lvm/archive/FILENAME VGNAME
But see "man vgcfgrestore"
--
Ray Morris
support@bettercgi.com
Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/
Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/
Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php
On Tue, 26 Apr 2011 20:58:25 -0700
Chris Streeter <chris@chrisstreeter.com> wrote:
> > What you *should* have done is restore the metadata to the point
> > before your errant command. Â You can still do that (if it is still
> > in the archive), but the several K of zeros written to the start of
> > the LV you created will require recovery.
>
> So I still have all the files in the archive of the form
> raid_vg_0000*.vg
>
> If have those files, how would I go about restoring the metadata to
> the device? If I were to loose several K of data, I'm totally fine
> with that.
>
> Thanks!
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Recovering Accidentally Destroyed LVM2 Information
2011-04-27 14:57 ` Ray Morris
@ 2011-04-27 22:02 ` Chris Streeter
0 siblings, 0 replies; 7+ messages in thread
From: Chris Streeter @ 2011-04-27 22:02 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]
Wow, thanks so much guys. I restored the config and then was able to run
fsck.ext3 on the device. It took a while to run and had to fix a bunch of
stuff, but it looks like my data is back. Very, very grateful.
Cheers!
- Chris
On Wed, Apr 27, 2011 at 07:57, Ray Morris <support@bettercgi.com> wrote:
> vgcfgrestore -f /etc/lvm/archive/FILENAME VGNAME
>
> But see "man vgcfgrestore"
> --
> Ray Morris
> support@bettercgi.com
>
> Strongbox - The next generation in site security:
> http://www.bettercgi.com/strongbox/
>
> Throttlebox - Intelligent Bandwidth Control
> http://www.bettercgi.com/throttlebox/
>
> Strongbox / Throttlebox affiliate program:
> http://www.bettercgi.com/affiliates/user/register.php
>
>
>
>
> On Tue, 26 Apr 2011 20:58:25 -0700
> Chris Streeter <chris@chrisstreeter.com> wrote:
>
> > > What you *should* have done is restore the metadata to the point
> > > before your errant command. You can still do that (if it is still
> > > in the archive), but the several K of zeros written to the start of
> > > the LV you created will require recovery.
> >
> > So I still have all the files in the archive of the form
> > raid_vg_0000*.vg
> >
> > If have those files, how would I go about restoring the metadata to
> > the device? If I were to loose several K of data, I'm totally fine
> > with that.
> >
> > Thanks!
> >
> > _______________________________________________
> > linux-lvm mailing list
> > linux-lvm@redhat.com
> > https://www.redhat.com/mailman/listinfo/linux-lvm
> > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> >
>
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
[-- Attachment #2: Type: text/html, Size: 3072 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-04-27 22:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 3:12 [linux-lvm] Recovering Accidentally Destroyed LVM2 Information Chris Streeter
2011-04-27 3:41 ` Stuart D. Gathman
2011-04-27 3:58 ` Chris Streeter
2011-04-27 13:03 ` Stuart D. Gathman
2011-04-27 14:57 ` Ray Morris
2011-04-27 22:02 ` Chris Streeter
-- strict thread matches above, loose matches on Subject: below --
2011-04-27 3:07 Chris Streeter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).