Subject: Re: hosed partition table
To: None <netbsd-users@netbsd.org>
From: George Georgalis <george@galis.org>
List: netbsd-users
Date: 10/25/2006 00:17:38
On Tue, Oct 24, 2006 at 08:48:36PM +0000, Christos Zoulas wrote:
>In article <20061023215119.GE16473@run.galis.org>,
>George Georgalis <george@galis.org> wrote:
>>On Mon, Oct 23, 2006 at 09:42:55PM +0000, Christos Zoulas wrote:
>>>In article <20061023201529.GB16473@run.galis.org>,
>>>George Georgalis <george@galis.org> wrote:
>>>>On Mon, Oct 23, 2006 at 06:11:06PM +0000, Christos Zoulas wrote:
>>>>>In article <20061023143323.GA19828@run.galis.org>,
>>>>>George Georgalis <george@galis.org> wrote:
>>>>>>On Sun, Oct 22, 2006 at 08:57:18PM -0400, George Georgalis wrote:
>>>>>>>While I was unloading a disk with errors, I noticed the partition
>>>>>>>table was odd, I tried to fix it and now, basically the situation
>>>>>>>can be reduced to the c and d partitions have been deleted.
>>>>>>
>>>>>>BTW - I DID get all the needed data off the drive before I started
>>>>>>mucking with the partition table and this is the output of fdisk
>>>>>>and disklabel
>>>>>>
>>>>>> $ fdisk wd1 
>>>>>>fdisk: DIOCGDEFLABEL: Inappropriate ioctl for device
>>>>>>fdisk: DIOCGDINFO: Inappropriate ioctl for device
>>>>>> $ disklabel wd1                                                        
>>>>>>
>>>>>>disklabel: Invalid signature in mbr record 0
>>>>>>disklabel: ioctl DIOCGDINFO: Inappropriate ioctl for device
>>>>>>
>>>>>>I'm pretty sure this has nothing to do with the disk errors that
>>>>>>started this journey.  The system happens to be 3.1_RC2, but
>>>>>>if needed, I could change this box easily enough.  What other
>>>>>>commands are available to doctor the disk?
>>>>>
>>>>>what does ls -l /dev/rwd1* say?
>>>>
>>>> $ ls -l /dev/rwd1* 
>>>>-rw-r--r--  1 root  wheel        267324504 Oct 21 18:31 /dev/rwd1
>>>
>>>I think you should remove that :-)
>>
>>gone.
>>
>>I can use to "disklabel -i -I wd1" to add or remove partitions c
>>or d; but there is a special property of d being 63 sectors larger
>>then the largest c ("entire disk") which I cannot reproduce...
>>that's where I'm stuck.
>
>Well if you have an mbr you can define c to start at 63 by using:
>
>disklabel -i -I wd1
>R s
>c
>unused
>63s
>$
>d
>unused
>0
>$
>

That's exactly what I tried. :) but with c having an offset of
63 (to end of disk) and d no offset (to end of disk) any new
partitions end up being up to the size of d, not c like normal
disks.

I think the solution is in Thierry's comments. But I've not yet
had a chance to fully wrap my head around them and installboot(8),
mbr(8) and mbrlabel(8)

I presume when I run installboot then mbrlabel, I'll have a
disk which I can make a partition up the size of c and have a d
partition 63s larger.

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><