Jan Stary wrote:
> This is 4.5 trying to create a FAT partition
> on an external (USB) 80G disk.

condensing... (Those who scream about the horror of top posting
obviously don't have a netbook.  Having to flip down twenty
screens worth just to see something one hasn't seen five times
already is annoying and a good way to get ignored by me.)
...
> # fdisk -i sd0

...openbsd partition created...

> *3: A6      0   1   1 -   9728 254  63 [          63:   156296322 ] OpenBSD   
>   
> 
> # disklabel -E sd0
> # Inside MBR partition 3: type A6 start 63 size 156296322
> Treating sectors 63-156296385 as the OpenBSD portion of the disk.
> You can use the 'b' command to change this.
> 
> Initial label editor (enter '?' for help at any prompt)
>> z
>> a
> partition: [a] 
> offset: [63] 
> size: [156296322] 30g
> Rounding to cylinder: 62926542
> FS type: [4.2BSD] msdos

whoa.
You just made your OpenBSD partition into an OpenBSD partition
with an msdos identifier string.  You don't want to do that.

>From this point onwards, things are broke.  It just takes you
a while to realize it. :)
...

> The 'a' partiton is there, but once I try to create a filesystem on it,
> it disappears from the disklabel. Am I missing something?

yes. :)

Don't think of "I must do this, then that, then bla and then
all is well".  Think about the data...what is where and what it
all means.

On i386 and similar systems, the fdisk partition table determines
what OS goes where.  It is in the first sector on the disk, all
co-existing i386 OSs know that and expect it there, as does the
boot ROM in the machine.  Problem number 1 is you carved out an
OpenBSD partition and tried to call it MSDOS within OpenBSD.

Problem #2 is you created a disklabel on a drive that you had no
intention on using for OpenBSD.  Disklabels are an OpenBSD way to
slice up the OpenBSD partition of the disk.  Only OpenBSD uses
OpenBSD disklabels.  Ask yourself this question: where do you
does the OpenBSD disklabel go on the disk?  In the OpenBSD
partition, of course, no where else is "safe" for it to be.
OpenBSD knows to work around and use the disklabel.

Now, you make an MSDOS FAT file system on the OpenBSD partition.
What happens to the disklabel?  Yes, you just clobbered it.
MSDOS never had reason to think about working around an OpenBSD
disklabel.  It doesn't.  By this point in time, even if MS
decided it wanted to offer full support for OpenBSD, it can't.

When you PROPERLY create an MSDOS partition on your disk (and
not an OpenBSD partition), OpenBSD will see it and create a
"pretend" disklabel for you that will be and do everything you
need a disklabel to do.  Do not try to change it, you won't
do better than what is there, and more importantly, where do you
think the disklabel would end up?

See most of FAQ14 for a lot more details on this.

You need to create an MSDOS partition, let the system create its
own disklabel for you, and then newfs that.  Or better: just use
a native MSDOS or Windows machine create the partition for you.
OpenBSD has the ability to create valid drive layouts that
Windows is confused by (it can also create some really wacked
invalid layouts, too), and philosophically, I tend to prefer
to use native tools when possible.

> Also, why does disklabel say '16 partitions'?

That is how many disklabel partitions OpenBSD supports on all
platforms.  You may think this uninteresting, but that means you
haven't played with SPARC systems which usually only support
eight partitions...but with OpenBSD, magic happens and you end
up with 16 partitions in such a way that the SPARC boot ROMs
(and even Solaris to some degree) still work (for the first eight).
Even if you don't use them, all 16 partition table entries exist
and could be used later, if needed.

Nick.

Reply via email to