From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j6QGfPV24176 for ; Tue, 26 Jul 2005 12:41:25 -0400 Received: from msr61.hinet.net (msr61.hinet.net [168.95.4.161]) by mx3.redhat.com (8.13.1/8.13.1) with ESMTP id j6QGfIEC005850 for ; Tue, 26 Jul 2005 12:41:19 -0400 Received: from asuspc (61-230-202-133.dynamic.hinet.net [61.230.202.133]) by msr61.hinet.net (8.9.3/8.9.3) with SMTP id AAA01800 for ; Wed, 27 Jul 2005 00:41:14 +0800 (CST) Message-ID: <008001c59203$1553fc70$7e01a8c0@asuspc> From: =?big5?B?sWmnyqZ7?= Date: Wed, 27 Jul 2005 00:57:16 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_007D_01C59246.21F02740" Subject: [linux-lvm] How to recover data corrupted by vgcreate Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: linux-lvm@redhat.com This is a multi-part message in MIME format. ------=_NextPart_000_007D_01C59246.21F02740 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi, I have a Linux PC with Fedora C3 installed. The disk was partitioned automatically when Linux was installed. So, LVM2 partition was created. The CPU is damaged today and I move the disk to another Linux PC and try = to read data out. The disk is connected to device /dev/hdd. /dev/hdd2 is the LVM2 = partition. But, I do a stupid thing. I invoke vgcreate command on /dev/hdd2. vgcreate vg_name /dev/hdd2 The partition seems to be lost. How can I recover the data in /dev/hdd2? It's very important data to me. Thanks for any help. Davis ------=_NextPart_000_007D_01C59246.21F02740 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have a Linux PC with Fedora C3 = installed.
The disk was partitioned automatically when = Linux was=20 installed.
So, LVM2 partition was created.
The CPU is damaged today and I move the disk to = another Linux=20 PC and try to read data out.
The disk is connected to device /dev/hdd. /dev/hdd2 = is the=20 LVM2 partition.
But, I do a stupid thing. I invoke vgcreate command = on=20 /dev/hdd2.
 
    vgcreate vg_name = /dev/hdd2
 
The partition seems to be lost.
How can I recover the data in = /dev/hdd2?
It's very important data to me.
Thanks for any help.
 
Davis
 
------=_NextPart_000_007D_01C59246.21F02740-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [10.15.80.209] (dhcp80-209.msp.redhat.com [10.15.80.209]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j6RGWIaA016323 for ; Wed, 27 Jul 2005 12:32:19 -0400 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <008001c59203$1553fc70$7e01a8c0@asuspc> References: <008001c59203$1553fc70$7e01a8c0@asuspc> Content-Type: multipart/alternative; boundary=Apple-Mail-3-293381347 Message-Id: From: Jonathan E Brassow Subject: Re: [linux-lvm] How to recover data corrupted by vgcreate Date: Wed, 27 Jul 2005 11:33:05 -0500 Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: LVM general discussion and development --Apple-Mail-3-293381347 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-2022-JP; format=flowed I'm not familiar exactly with how the metadata gets laid on disk, but I would think you could just 'vgcreate vg_name /dev/hdd2' (you did this already) then 'lvcreate -n -l vg_name'... This of course assumes that the previous lv resided wholly on /dev/hdd2. Then try mounting the new lv and see what happens. brassow On Jul 26, 2005, at 11:57 AM, 張廷州 wrote: > Hi, > > I have a Linux PC with Fedora C3 installed. > The disk was partitioned automatically when Linux was installed. > So, LVM2 partition was created. > The CPU is damaged today and I move the disk to another Linux PC and > try to read data out. > The disk is connected to device /dev/hdd. /dev/hdd2 is the LVM2 > partition. > But, I do a stupid thing. I invoke vgcreate command on /dev/hdd2. > > vgcreate vg_name /dev/hdd2 > > The partition seems to be lost. > How can I recover the data in /dev/hdd2? > It's very important data to me. > Thanks for any help. > > Davis > _______________________________________________ > 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/ --Apple-Mail-3-293381347 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=ISO-2022-JP I'm not familiar exactly with how the metadata gets laid on disk, but I would think you could just 'vgcreate vg_name /dev/hdd2' (you did this already) then 'lvcreate -n < -l < vg_name'... This of course assumes that the previous lv resided wholly on /dev/hdd2. Then try mounting the new lv and see what happens. brassow On Jul 26, 2005, at 11:57 AM, Hiragino Kaku Gothic Pro張廷州 wrote: Hi, I have a Linux PC with Fedora C3 installed. The disk was partitioned automatically when Linux was installed. So, LVM2 partition was created. The CPU is damaged today and I move the disk to another Linux PC and try to read data out. The disk is connected to device /dev/hdd. /dev/hdd2 is the LVM2 partition. But, I do a stupid thing. I invoke vgcreate command on /dev/hdd2. vgcreate vg_name /dev/hdd2 The partition seems to be lost. How can I recover the data in /dev/hdd2? It's very important data to me. Thanks for any help. Davis _______________________________________________ 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/ --Apple-Mail-3-293381347-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from null.msp.redhat.com (null.msp.redhat.com [10.15.80.136]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j6RHOiaA025330 for ; Wed, 27 Jul 2005 13:24:44 -0400 Received: from null.msp.redhat.com (localhost.localdomain [127.0.0.1]) by null.msp.redhat.com (8.13.4/8.12.11) with ESMTP id j6RHOhfV015949 for ; Wed, 27 Jul 2005 12:24:43 -0500 Received: (from alewis@localhost) by null.msp.redhat.com (8.13.4/8.13.4/Submit) id j6RHOhXb015948 for linux-lvm@redhat.com; Wed, 27 Jul 2005 12:24:43 -0500 Date: Wed, 27 Jul 2005 12:24:43 -0500 From: AJ Lewis Subject: Re: [linux-lvm] How to recover data corrupted by vgcreate Message-ID: <20050727172443.GC4954@null.msp.redhat.com> References: <008001c59203$1553fc70$7e01a8c0@asuspc> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0WzQiIesntPPsVaS" Content-Disposition: inline In-Reply-To: Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: LVM general discussion and development --0WzQiIesntPPsVaS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 27, 2005 at 11:33:05AM -0500, Jonathan E Brassow wrote: > I'm not familiar exactly with how the metadata gets laid on disk, but=20 > I would think you could just 'vgcreate vg_name /dev/hdd2' (you did this= =20 > already) then 'lvcreate -n -l vg_name'... This of=20 > course assumes that the previous lv resided wholly on /dev/hdd2. Then=20 > try mounting the new lv and see what happens.=20 Before you do that, try vgcfgrestore. =20 > On Jul 26, 2005, at 11:57 AM, =E5=BC=B5=E5=BB=B7=E5=B7=9E wrote:=20 >=20 >=20 > > Hi,=20 > > =20 > > I have a Linux PC with Fedora C3 installed.=20 > > The disk was partitioned automatically when Linux was installed.=20 > > So, LVM2 partition was created.=20 > > The CPU is damaged today and I move the disk to another Linux PC=20 > > and try to read data out.=20 > > The disk is connected to device /dev/hdd. /dev/hdd2 is the LVM2=20 > > partition.=20 > > But, I do a stupid thing. I invoke vgcreate command on /dev/hdd2.=20 > > =20 > > vgcreate vg_name /dev/hdd2=20 > > =20 > > The partition seems to be lost.=20 > > How can I recover the data in /dev/hdd2?=20 > > It's very important data to me.=20 > > Thanks for any help.=20 > > =20 > > Davis=20 > > _______________________________________________=20 > > linux-lvm mailing list=20 > > linux-lvm@redhat.com=20 > > https://www.redhat.com/mailman/listinfo/linux-lvm=20 > > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ >=20 >=20 > _______________________________________________ > 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/ --=20 AJ Lewis Voice: 612-638-0500 Red Hat E-Mail: alewis@redhat.com One Main Street SE, Suite 209 Minneapolis, MN 55414 =20 Current GPG fingerprint =3D D9F8 EDCE 4242 855F A03D 9B63 F50C 54A8 578C 8= 715 Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the many keyservers out there... --0WzQiIesntPPsVaS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC58Nb9QxUqFeMhxURAle2AKDDw3B3vQMgt25WPj2rlpJOvmurNwCcDTE0 uuYdlhJpKoZ0rTnf4Esm6WM= =3ZvH -----END PGP SIGNATURE----- --0WzQiIesntPPsVaS-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [10.15.80.209] (dhcp80-209.msp.redhat.com [10.15.80.209]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j6SExDaA030732 for ; Thu, 28 Jul 2005 10:59:14 -0400 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <20050727172443.GC4954@null.msp.redhat.com> References: <008001c59203$1553fc70$7e01a8c0@asuspc> <20050727172443.GC4954@null.msp.redhat.com> Message-Id: Content-Transfer-Encoding: 7bit From: Jonathan E Brassow Subject: Re: [linux-lvm] How to recover data corrupted by vgcreate Date: Thu, 28 Jul 2005 10:00:02 -0500 Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: LVM general discussion and development On Jul 27, 2005, at 12:24 PM, AJ Lewis wrote: > On Wed, Jul 27, 2005 at 11:33:05AM -0500, Jonathan E Brassow wrote: >> I'm not familiar exactly with how the metadata gets laid on disk, but >> I would think you could just 'vgcreate vg_name /dev/hdd2' (you did >> this >> already) then 'lvcreate -n -l vg_name'... This of >> course assumes that the previous lv resided wholly on /dev/hdd2. Then >> try mounting the new lv and see what happens. > > Before you do that, try vgcfgrestore. > AJ, when he did the initial 'vgcreate' was part of the process to create a backup copy of the metadata? If so, vgcfgrestore could work. But otherwise, I'm not sure were the old metadata would be stored, since this disk is from a different machine... Seems odd to me that vgcreate would blow over the old vg if it knew about it. If it did not know (or detect the old vg), how would it know to backup the metadata? brassow From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from null.msp.redhat.com (null.msp.redhat.com [10.15.80.136]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j6SGfXaA018045 for ; Thu, 28 Jul 2005 12:41:33 -0400 Received: from null.msp.redhat.com (localhost.localdomain [127.0.0.1]) by null.msp.redhat.com (8.13.4/8.12.11) with ESMTP id j6SGfXAN002926 for ; Thu, 28 Jul 2005 11:41:33 -0500 Received: (from alewis@localhost) by null.msp.redhat.com (8.13.4/8.13.4/Submit) id j6SGfXZL002925 for linux-lvm@redhat.com; Thu, 28 Jul 2005 11:41:33 -0500 Date: Thu, 28 Jul 2005 11:41:33 -0500 From: AJ Lewis Subject: Re: [linux-lvm] How to recover data corrupted by vgcreate Message-ID: <20050728164133.GE4954@null.msp.redhat.com> References: <008001c59203$1553fc70$7e01a8c0@asuspc> <20050727172443.GC4954@null.msp.redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dx1O6sYEs5STvSrm" Content-Disposition: inline In-Reply-To: Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: LVM general discussion and development --Dx1O6sYEs5STvSrm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 28, 2005 at 10:00:02AM -0500, Jonathan E Brassow wrote: >=20 > On Jul 27, 2005, at 12:24 PM, AJ Lewis wrote: >=20 > >On Wed, Jul 27, 2005 at 11:33:05AM -0500, Jonathan E Brassow wrote: > >>I'm not familiar exactly with how the metadata gets laid on disk, but > >>I would think you could just 'vgcreate vg_name /dev/hdd2' (you did=20 > >>this > >>already) then 'lvcreate -n -l vg_name'... This of > >>course assumes that the previous lv resided wholly on /dev/hdd2. Then > >>try mounting the new lv and see what happens. > > > >Before you do that, try vgcfgrestore. > > >=20 > AJ, when he did the initial 'vgcreate' was part of the process to=20 > create a backup copy of the metadata? If so, vgcfgrestore could work. = =20 > But otherwise, I'm not sure were the old metadata would be stored,=20 > since this disk is from a different machine... Seems odd to me that=20 > vgcreate would blow over the old vg if it knew about it. If it did not= =20 > know (or detect the old vg), how would it know to backup the metadata? Not sure, but if the reason the disk was moved was because a cpu went out, = i'm assuming the old root fs is also on that disk - hoping so anyway ;) If so, the old root fs can be mounted and /etc/lvm/archive can be checked for a va= lid copy of the metadata. (Assuming root wasn't on lvm...) As to why vgcreate didn't recognize the old VG...that's very odd - not sure what went wrong there... --=20 AJ Lewis Voice: 612-638-0500 Red Hat E-Mail: alewis@redhat.com One Main Street SE, Suite 209 Minneapolis, MN 55414 =20 Current GPG fingerprint =3D D9F8 EDCE 4242 855F A03D 9B63 F50C 54A8 578C 8= 715 Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the many keyservers out there... --Dx1O6sYEs5STvSrm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC6Qq99QxUqFeMhxURAu5WAJ9ZDRewNngymO3Lie5L7x20avIsJwCgrXf2 Sa9/SxJVdgw97taOpIVGRNE= =yCi1 -----END PGP SIGNATURE----- --Dx1O6sYEs5STvSrm-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j71DOKV03567 for ; Mon, 1 Aug 2005 09:24:20 -0400 Received: from msr2.hinet.net (msr2.hinet.net [168.95.4.102]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j71DOHrs032758 for ; Mon, 1 Aug 2005 09:24:18 -0400 Received: from Notebook (61-219-65-1.HINET-IP.hinet.net [61.219.65.1]) by msr2.hinet.net (8.9.3/8.9.3) with ESMTP id VAA15670 for ; Mon, 1 Aug 2005 21:24:08 +0800 (CST) Message-ID: <012601c5969c$8f7cc2f0$fa01a8c0@Notebook> From: =?big5?B?sWmnyqZ7?= Subject: Re: [linux-lvm] How to recover data corrupted by vgcreate Date: Mon, 1 Aug 2005 21:25:44 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0119_01C596DF.93A69B10" Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: linux-lvm@redhat.com This is a multi-part message in MIME format. ------=_NextPart_000_0119_01C596DF.93A69B10 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi, There is no backup information available in /etc/lvm/archive to restore = VG to original configuration. Unfortunately the root directory is also in LVM partition. So, "vgcfgrestore" did not solve the problem. I also tried to create new LV by "lvcreate" to match with the existing = LV. The problem is I have no idea about the size of old LV. I just gave a random size in "lvcreate" command. But, I could not mount the file system because of bad superblock. I don't know what I missed. Maybe the size is critical to do the = matching. Is there any reverse procedure I can do to recover VG by the existing LV = information? It may just like to recover partition table by scanning cylinder data in = hard disk. Any idea? Thanks a lot. Davis > >On Wed, Jul 27, 2005 at 11:33:05AM -0500, Jonathan E Brassow wrote: > >>I'm not familiar exactly with how the metadata gets laid on disk, = but > >>I would think you could just 'vgcreate vg_name /dev/hdd2' (you did = > >>this > >>already) then 'lvcreate -n -l vg_name'... = This of > >>course assumes that the previous lv resided wholly on /dev/hdd2. = Then > >>try mounting the new lv and see what happens. > > > >Before you do that, try vgcfgrestore. > > >=20 > AJ, when he did the initial 'vgcreate' was part of the process to=20 > create a backup copy of the metadata? If so, vgcfgrestore could = work. =20 > But otherwise, I'm not sure were the old metadata would be stored,=20 > since this disk is from a different machine... Seems odd to me that = > vgcreate would blow over the old vg if it knew about it. If it did = not=20 > know (or detect the old vg), how would it know to backup the = metadata? Not sure, but if the reason the disk was moved was because a cpu went = out, i'm assuming the old root fs is also on that disk - hoping so anyway ;) = If so, the old root fs can be mounted and /etc/lvm/archive can be checked for = a valid copy of the metadata. (Assuming root wasn't on lvm...) As to why vgcreate didn't recognize the old VG...that's very odd - not = sure what went wrong there... ------=_NextPart_000_0119_01C596DF.93A69B10 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Hi,
 
There is no backup information available in=20 /etc/lvm/archive to restore VG to original=20 configuration.
Unfortunately the root directory is also in LVM=20 partition.
So, "vgcfgrestore" did not solve the = problem.
I also tried to create new LV by "lvcreate" to match = with=20 the existing LV.
The problem is I have no idea about the size of old=20 LV.
I just gave a random size in "lvcreate" = command.
But, I could not mount the file system because of = bad=20 superblock.
I don't know what I missed. Maybe the size is = critical to do=20 the matching.
Is there any reverse procedure I can do to recover = VG by the=20 existing LV information?
It may just like to recover partition table by = scanning=20 cylinder data in hard disk.
Any idea? Thanks a lot.
 
Davis

> >On Wed, Jul 27, 2005 at 11:33:05AM -0500, Jonathan E = Brassow=20 wrote:
> >>I'm not familiar exactly with how the metadata = gets=20 laid on disk, but
> >>I would think you could just = 'vgcreate=20 vg_name /dev/hdd2' (you did
> >>this
> = >>already)=20 then 'lvcreate -n <lvname> -l <max size> vg_name'...  = This=20 of
> >>course assumes that the previous lv resided wholly = on=20 /dev/hdd2.  Then
> >>try mounting the new lv and see = what=20 happens.
> >
> >Before you do that, try=20 vgcfgrestore.
> >
>
> AJ, when he did the = initial=20 'vgcreate' was part of the process to
> create a backup copy of = the=20 metadata?  If so, vgcfgrestore could work. 
> But = otherwise,=20 I'm not sure were the old metadata would be stored,
> since = this disk=20 is from a different machine...  Seems odd to me that
> = vgcreate=20 would blow over the old vg if it knew about it.  If it did not =
>=20 know (or detect the old vg), how would it know to backup the=20 metadata?

Not sure, but if the reason the disk was moved was = because a=20 cpu went out, i'm
assuming the old root fs is also on that disk - = hoping so=20 anyway ;)  If so,
the old root fs can be mounted and = /etc/lvm/archive=20 can be checked for a valid
copy of the metadata.  (Assuming = root=20 wasn't on lvm...)

As to why vgcreate didn't recognize the old=20 VG...that's very odd - not sure
what went wrong=20 there...

------=_NextPart_000_0119_01C596DF.93A69B10--