[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: recover partition table


Stephen Powell wrote:
> On Sat, 26 Mar 2011 13:42:15 -0400 (EDT), Geronimo wrote:
> > I don't want to offend you, but all that you wrote I already
> > found from google and friends.
> ... But I can make some educated guesses.  For example, here's an excerpt
> from my /var/log/installer/partman file:
> ...
> The first number after "OUT" is probably the partition number.

As in my partman log there where millions of OUT - lines, I focussed to the 
lines that look quit similar to fdisk output, like:

========== <snip> ===============
Path: /dev/sdd
Sector size: 512
Sectors: 78165360
Sectors/track: 63
Heads: 255
Cylinders: 4865
Partition table: yes
Type: msdos
Partitions: #	id	length	type	fs	path	name
(0,0,0)	(0,0,62)	-1	0-32255	32256	primary	label	/dev/sdd-1	
(0,1,0)	(2611,254,62)	1	32256-21484431359	21484399104	primary	ext4	
(2612,0,0)	(2612,27,38)	-1	21484431360-21485322239	890880	pri/log	
free	/dev/sdd-1	
(2612,27,39)	(2660,173,8)	2	21485322240-21884829695	399507456	primary	
ext3	/dev/sdd2	
(2660,173,9)	(4865,122,56)	3	21884829696-40019951615	18135121920	primary	
ext4	/dev/sdd3	
(4865,122,57)	(4865,144,62)	-1	40019951616-40020664319	712704	pri/log	
free	/dev/sdd-1	
========== <snap> ===============

... and these lines confused me, as wiki said, that biggest value from chs is 
1023 - and for me the values in round brakets looked like chs values.

As I'm no hero in juggling hex numbers by mind, I wrote a little helper, that 
dumped the mbr infos.
Trying then your advice with "parted -I" I got values similar to the output of 
my dumper, but not matching the values from partman, so I came to the same 
conclusion as you - where I had to look at the man pages of parted to find a 
smaller unit than sectors.

So I added little math to my dumping tool and finally the values matched.

From manual I already read about the rescue option and as you recommended the 
same, I gave it a try.
... but I got an error, about missing or wrong label. - Huh?
Did not used any label yet.

So I added writing capabilities to my dumper and created a mbr, where I 
thought, should match. Then I wrote it to the drives mbr using dd and rebooted 

Voila - drive is recognized and all works well.

Thank you very much for your patience and assistance.

kind regards


P.S. on writing my dumper and checking all drives against partman log, may be 
I found a little bug from partman (don't know, whether it has any relevance):
	According to wiki, head and cylinder are 0-based, whereas sector is 1-
based. So I think, a value of (0, 1, 0) as above is invalid and should not 
occure. I happen to notice 0-based sectors on every drive.

Reply to: