From: Andreas Dilger <adilger@turbolabs.com>
To: Erick Calder <e@arix.com>
Cc: linux-lvm@sistina.com
Subject: Re: [linux-lvm] restoring a volume group?
Date: Wed Feb 20 17:11:02 2002 [thread overview]
Message-ID: <20020220161136.F1506@lynx.adilger.int> (raw)
In-Reply-To: <002c01c1ba5d$0d813160$0300000a@pacbell.net>; from e@arix.com on Wed, Feb 20, 2002 at 02:22:16PM -0800
On Feb 20, 2002 14:22 -0800, Erick Calder wrote:
> recently I did something horrible to my system (was building an RPM with
> someone else's spec file which performed a "rm -rf /" (as root)) and as I
> have everything (/boot, /root, /usr, /etc, /lib... etc.) on a single
> partition (/dev/hda1) and seemed unable to restore from dumps on the live
> filesystem I was forced to install Linux on a different partition so I could
> mount /dev/hda1 without it being my root... trouble was I didn't have a
> spare partition so I had to take /dev/hda3, one of the physical volumes in
> my volume group.
>
> I thus installed Linux there blowing away what was there, did my restore,
> put the partition type back to LVM and then did a "pvcreate /dev/hda3"...
> however, I found I could not reload the volume... "vgchange -a y" reporting
> there were no volume groups found...
>
> I therefore deleted /dev/LVM (my volume group) and its contents, and tried
> to recreate it:
>
> # vgcreate /dev/LVM /dev/hda3 /dev/hdc
>
> but this complained that /dev/hdc already belonged to the group LVM, so a:
>
> # pvcreate -ff /dev/hdc
>
> and I promptly blew away the data there, allowing me to start from
> scratch...
Ok, basically a series of wrong operations has gotten you into a hole...
The correct order of operations would have been:
- Don't use bad spec file (oops).
- Test your backup (yes, hindsight is golden).
- Use a rescue disk to boot and recover your data.
- As long as you are not reformatting, you could have reinstalled over the
old root partition and it would have kept all of your data.
> now, after my long description (and thank you for taking the interest to
> read this far), my question is: was my data in /dev/hdc in any way
> recoverable? given the circumstances, did I take the only steps I could
> have taken? and what can any of you suggest I could/should have done
> differently?
Now, as to the LVM part:
- You should have used vgcfgrestore to restore the LVM metadata to
/dev/hda3, and all would have been well.
- Your data on /dev/hdc may still be recoverable, depending on what you
have done in the meantime. Try vgcfgrestore for both hda3 and hdc and
you might get it back.
- If you have whole filesystems contained on /dev/hdc you can use something
like gpart (or findsuper in the e2fsprogs source is best for ext2) to find
the filesystem superblock and recover the whole fs.
> p.s. in the time I've been away from the list I've learnt a lot about
> building RPMs... so as I move forward I am still hopeful to make good on a
> promise to build RPMs for LVM... will be back with more on that.
Well, I don't think people will be rushing out to use your .spec files any
time soon ;-).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
prev parent reply other threads:[~2002-02-20 17:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E16deQF-0003Mb-00@hermes.sistina.com>
2002-02-20 16:27 ` [linux-lvm] restoring a volume group? Erick Calder
2002-02-20 17:11 ` Andreas Dilger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020220161136.F1506@lynx.adilger.int \
--to=adilger@turbolabs.com \
--cc=e@arix.com \
--cc=linux-lvm@sistina.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).