View previous topic :: View next topic |
Author |
Message |
amiga23 n00b
Joined: 01 Sep 2006 Posts: 5
|
Posted: Fri Sep 01, 2006 11:28 am Post subject: 2006.1 live cd installer kills partitiontable on all hardriv |
|
|
Hi,
I have 2 harddrives.
/dev/hda 40GB which I want to use as my gentoo installation drive
and
/dev/hdb which contains a logical volumegroup with 2 logical volumes.
In the installer I did only select /dev/hda and did delete all partitions and let the installer create recomended partitions.
After pressing the "install" button, /dev/hda was reconfigured as wanted, but it did also delete the partitiontable on /dev/hdb
How can I get the data back on /dev/hdb?????
Please help me and add a BIG WARNING to your homepage to prevent all the other users out there from destroying their data.
Thanks
AMIGA23 |
|
Back to top |
|
|
SinoTech Advocate
Joined: 20 Mar 2004 Posts: 2579 Location: Neunkirchen / Saarland / Germany
|
Posted: Fri Sep 01, 2006 4:08 pm Post subject: |
|
|
Maybe testdisk can help.
Cheers,
Sino _________________ Help to answer the unanswered |
|
Back to top |
|
|
amiga23 n00b
Joined: 01 Sep 2006 Posts: 5
|
Posted: Tue Sep 05, 2006 12:34 pm Post subject: |
|
|
Hi SinoTech,
thank you for the hint with testdisk. It is a great program, but it can only recover phisical volumes in partitions. On my HDD it does not find anything. I have talked to one the developers of testdisk and he said, that it is not able to detect VGs and LVs, but only PVs.
Does someone know, which blocks the installer does overwrite? Are that only the first few? It is possible to just run
pvcreate /dev/hdb
again and the VG and LV information is kept?
How does LVM detect that hdb is a physical volume? maybe only some few bits at teh beginning of the HDD are overwriten?
As it was SuSE 8 with kernel 2.4 it was LVM1.
Best regrads
Thomas |
|
Back to top |
|
|
syg00 l33t
Joined: 23 Aug 2004 Posts: 907 Location: Brisbane, AUS
|
Posted: Tue Sep 05, 2006 1:12 pm Post subject: |
|
|
amiga23 wrote: | Does someone know, which blocks the installer does overwrite? Are that only the first few? It is possible to just run
pvcreate /dev/hdb again and the VG and LV information is kept? | I would think only the partition tale itself (i.e. no data) got mangled.
If testdisk found nothing, that would probably indicate the whole volume was a single PV.
Have a look at this thread on something similar. Seems there might be hope for you, although it wasn't specifically the new Gentoo installer (which I refuse to use BTW). _________________ Got a good backup ??? - any advice offered presumes you have. |
|
Back to top |
|
|
amiga23 n00b
Joined: 01 Sep 2006 Posts: 5
|
Posted: Thu Sep 07, 2006 7:21 pm Post subject: |
|
|
It works again
*PARTY*
LVM2 does store the metadata after the partition table, starting from 200h if the whole HDD is used as PV. So it should be enough to set all blocks from 4h - 1FFh to zero. 0h - 3h must be "48 4D 01".
Code: |
000001b0 48 4D 01 00 00 00 00 00 00 00 00 00 00 00 00 00
|
LVM1 does use the partition table to store it's metadata if the whole HDD is used as PV.
On my system the installer did destroy the following bytes:
Code: |
000001b0 01 00 00 00 01 00 00 00 02 00 00 00 70 59 00 00
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
1BCh - 1BFh should be the size of the PV (in sectors), but it is not really important.
1C0h - 1CFh descibes the amount of PEs used for the first volume group and should look like the following:
Code: |
000001c0 02 00 00 00 00 20 00 00 E1 E8 00 00 E1 E8 00 00
|
The amount of PEs used does the command "pvdata" deliver:
Code: |
--- NEW Physical volume ---
PV Name /dev/hdb
VG Name vg_250GB
PV Size 11.18 MB [22896 secs]
PV# 1
PV Status available
Allocatable NO
Cur LV 0
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID UGtx1T-zuMy-Ubw5-50ao-Dr3x-7RTV-jfayFB
--- Volume group ---
VG Name
VG Access read/write
VG Status NOT available/resizable
VG # 1
MAX LV 256
Cur LV 2
Open LV 0
MAX LV Size 255.99 GB
Max PV 256
Cur PV 1
Act PV 1
VG Size 232.88 GB
PE Size 4 MB
Total PE 59617
Alloc PE / Size 59617 / 232.88 GB
Free PE / Size 0 / 0
VG UUID iSo4NJ-En7j-eTvq-UTD9-Wvtr-RsQj-xtxhfu
|
"Alloc PE" is the number we need. But we need to convert it to hexadecimal so 59617d = E8E1h, but as high and low byte are swaped E1E8 is the data to enter.
The partition table ends at 1FFh. 55 AA marks the end of the partition table. For lvm 1FEh and 1FFh must be zero.
That was all I had to change and now pvdata does still show a wrong "PV Size" (11.18 MB [22896 secs]), but I can access my logical volumes anyway.
I hope this helps anybody else having a similar problem.
Thanks to everybody who gave me hints. |
|
Back to top |
|
|
syg00 l33t
Joined: 23 Aug 2004 Posts: 907 Location: Brisbane, AUS
|
Posted: Thu Sep 07, 2006 10:26 pm Post subject: |
|
|
Well done ...
Where did you get all this info ??? - I only ask out of curiousity. I am "interested" (to put it mildly) how things might be arranged where a valid boot loader and partition table are needed. Say a PV on a boot disk containing a small boot partition.
Loaders (especially lilo) use more than the first sector on a boot disk.
Better go find some spare disks and a test system I can play on - I like the concept of LVM but don't understand it enough to have used it yet. _________________ Got a good backup ??? - any advice offered presumes you have. |
|
Back to top |
|
|
loki99 Advocate
Joined: 10 Oct 2003 Posts: 2056 Location: Vienna, €urope
|
Posted: Thu Sep 07, 2006 10:48 pm Post subject: Re: 2006.1 live cd installer kills partitiontable on all har |
|
|
amiga23 wrote: | Please help me and add a BIG WARNING to your homepage to prevent all the other users out there from destroying their data. |
Hi amiga23!
I'm sorry to hear that you had so much troubles and I'm glad to hear that you got your data back.
But could you please file a bug about this on https://bugs.gentoo.org/ so the developers are aware of this problem?
TIA,
loki99 |
|
Back to top |
|
|
Sgeorg Apprentice
Joined: 01 Apr 2003 Posts: 152
|
|
Back to top |
|
|
syg00 l33t
Joined: 23 Aug 2004 Posts: 907 Location: Brisbane, AUS
|
Posted: Sun Oct 29, 2006 9:33 pm Post subject: |
|
|
Testdisk as mentioned above should do the job. _________________ Got a good backup ??? - any advice offered presumes you have. |
|
Back to top |
|
|
|