Port-amd64 archive

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

Re: bootxx needs to fit within 0th track of MBR partition?



Mouse <mouse%Rodents-Montreal.ORG@localhost> writes:

>> I would expect the real issue is that we have a layout
>
>>   mbr
>>   disklabel
>>   bootxx start
>>   ...
>>   bootxx end
>>   [maybe some unused]
>>   beginning of UFS
>
>> and I dimly remember 16 sectors,
>
> I'm fairly sure that, yes, the distance from "beginning of drive" to
> "beginning of UFS" is 8K for UFS1, assuming of course that there is a
> filesystem partition starting at start-of-disk.  With one sector
> occupied by MBR and label, that left 7.5K for the bootblocks.

one each, so 14s = 7K?

> And, indeed, 5.2's sys/ufs/ffs/fs.h has a comment saying, in part,
>
>  * Depending on the architecture and the media, the superblock may
>  * reside in any one of four places. For tiny media where every block
>  * counts, it is placed at the very front of the partition.  Historically,
>  * UFS1 placed it 8K from the front to leave room for the disk label and
>  * a small bootstrap. For UFS2 it got moved to 64K from the front to leave
>  * room for the disk label and a bigger bootstrap, and for really piggy
>  * systems we check at 256K from the front if the first three fail.

Thanks; it's great to hear I was not confused.  But I had no idea there
was a search for superblock in multiple places!

So for UFS1 in the traditional location, there are 16 sectors, and given
that bootxx starts in sector 2, it can be 14 sectors long before there
is trouble.

For 64k, there are 128 sectors, and I really hope our boot blocks never
get that big.

I would therefore lean to change the rule to 14 (16 in the define) with
an explanation that it guarantees that it will fit with UFS1 in the
traditional location.

To go beyond that, I think we need to be sure that installboot will
locate the filesystem and be sure that bootxx will not overwrite the
superblock.


Home | Main Index | Thread Index | Old Index