Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

2006.1 live cd installer kills partitiontable on all hardriv

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
amiga23
n00b
n00b
Posts: 5
Joined: Fri Sep 01, 2006 11:22 am

2006.1 live cd installer kills partitiontable on all hardriv

  • Quote

Post by amiga23 » Fri Sep 01, 2006 11:28 am

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 :-( :evil:

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
Top
SinoTech
Advocate
Advocate
Posts: 2579
Joined: Sat Mar 20, 2004 3:52 pm
Location: Neunkirchen / Saarland / Germany
Contact:
Contact SinoTech
Website

  • Quote

Post by SinoTech » Fri Sep 01, 2006 4:08 pm

Maybe testdisk can help.

Cheers,

Sino
Help to answer the unanswered
Top
amiga23
n00b
n00b
Posts: 5
Joined: Fri Sep 01, 2006 11:22 am

  • Quote

Post by amiga23 » Tue Sep 05, 2006 12:34 pm

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
Top
syg00
l33t
l33t
Posts: 907
Joined: Mon Aug 23, 2004 5:30 am
Location: Brisbane, AUS

  • Quote

Post by syg00 » Tue Sep 05, 2006 1:12 pm

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.
Top
amiga23
n00b
n00b
Posts: 5
Joined: Fri Sep 01, 2006 11:22 am

  • Quote

Post by amiga23 » Thu Sep 07, 2006 7:21 pm

:D
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: Select all

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: Select all

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: Select all

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: Select all

--- 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.
Top
syg00
l33t
l33t
Posts: 907
Joined: Mon Aug 23, 2004 5:30 am
Location: Brisbane, AUS

  • Quote

Post by syg00 » Thu Sep 07, 2006 10:26 pm

Well done ... 8) 8)
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.
Top
loki99
Advocate
Advocate
User avatar
Posts: 2056
Joined: Fri Oct 10, 2003 11:01 am
Location: Vienna, €urope
Contact:
Contact loki99
Website

Re: 2006.1 live cd installer kills partitiontable on all har

  • Quote

Post by loki99 » Thu Sep 07, 2006 10:48 pm

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. :wink:
But could you please file a bug about this on http://bugs.gentoo.org/ so the developers are aware of this problem?

TIA,
loki99
Top
Sgeorg
Apprentice
Apprentice
User avatar
Posts: 152
Joined: Tue Apr 01, 2003 12:58 pm

  • Quote

Post by Sgeorg » Sun Oct 29, 2006 2:19 pm

Hi!

How do you solve this problem if the lvm2 PV is on the 4th partition?

https://www.redhat.com/archives/linux-l ... 00121.html

Georg
Top
syg00
l33t
l33t
Posts: 907
Joined: Mon Aug 23, 2004 5:30 am
Location: Brisbane, AUS

  • Quote

Post by syg00 » Sun Oct 29, 2006 9:33 pm

Testdisk as mentioned above should do the job.
Got a good backup ??? - any advice offered presumes you have.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy