Subject: Re: disklabel(8) and machdep on-disk structures issues
To: None <tech-kern@NetBSD.org, lukem@NetBSD.org>
From: anand lalgondar <anandlalgondar@hotmail.com>
List: tech-kern
Date: 10/31/2003 10:22:24
>On Thu, Oct 30, 2003 at 07:41:01PM -0500, Thor Lancelot Simon wrote:
>
>Part of the problem is that DIOCWDINFO (update in-core, then update raw)
>_fails_ if there isn't an existing raw label.  So disklabel(8) -r has to
>be used to create the raw label.  Which in itself is fraught with
>difficulties (due to obscure inconsistencies between how disklabel -r -I
>and disklabel -r -R operate).  Thus, if you're doing work with disks
>from C, the best thing to do at this time is to make the label writable
>with DIOCWLABEL, and pread()/pwrite() the labelsector yourself...
>
>That all said, if DIOCWDINFO was change to _not_ fail if there's
>no existing raw label and just write it anyway (my preferred,
>unless there's security/integrity ramifications I am not aware of),
>or we added a new ioctl to create the raw label, then things would
>be much better.  In either case, a chunk of disklabel(8) could
>be simplified and it would makes third party manipulation of disklabels
>from C programs more robust.
>
>Luke.
>(who's spent too much time recently dealing with disklabel issues)

We faced problem in reading the disklabel of a new USB HDD and IEEE1394 HDD 
on MIPS evbmips Target Board. Since there was not initial label we used 
"disklabel -i -I" to install the disklabel. Everything would go fine, but 
when we use "disklabel sd0" we could not fine the partitions created, the 
same case with "mbrlabel sd0" as it is used to update both in-core and 
ondisk disklabels. But the "disklabel -r sd0" command would show the 
partitions created intact.

Yes we too agree that there should be a new option to install the intial 
disklable to avoid this pop up error message "use "disklabel -I" to install 
initial label"

- Anand

_________________________________________________________________
Are you a Citibank RCA member? Want to fly free to India? 
http://server1.msn.co.in/sp03/diwali/rca/memberrca.asp Here is how you can!