Date: Tue, 10 Mar 1998 14:42:34 +1100 From: Bruce Evans <bde@zeta.org.au> To: bde@zeta.org.au, mike@smith.net.au Cc: current@FreeBSD.ORG, stable@FreeBSD.ORG Subject: Re: *HEADS UP* Correction to previous postings. Message-ID: <199803100342.OAA30899@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> No. This breaks in my configuration with a historical invalid partition >> table (see biosboot/boot2.S). The boot blocks search this table and >> find slice 4 in it. They don't notice that it is invalid, so they pass >> slice 4 to the kernel. The kernel notices that it is invalid and gives >> only the compatibility slice, so the boot fails. Slice 4 must be mapped >> to slice COMPATIBILITY_SLICE (= 0) in this case. > >This is the case where the disk has been initialised with 'disklabel >auto', it seems. It depends whether the disk has a suitable existing DOS partition table (and perhaps a suitable BSD label). `disklabel' preserves the table if and only if the table (4 partition entries, not the signature) is not all-zero. `disklabel auto' only works if disk size (as guessed for the auto label) is the same as (or perhaps larger than) the size of the slice being labeled. The sizes will usually be the same if either a) the disk doesn't have any DOS partitions or labels - then `disklabel auto' will initialize the partition table. b) the disk has a DOS partition table with one partition covering the whole disk - then `disklabel auto' won't change the partition table. >> Partition table config Slice# passed by bootblocks Slice# to use for "/" >> ---------------------- --------------------------- ------------------------- >> Signature != 0xAA55 WHOLE_DISK_SLICE (= 1) COMPATIBILITY_SLICE (= 0) >> Historical invalid BASE_SLICE + 3 (= 5) COMPATIBILITY_SLICE (= 0) >> "Valid" (1 big part.) BASE_SLICE + N (0 <= N < 4) BASE_SLICE + N > >There appears to be no means for differentiating the "historical >invalid" case from the "valid" case where the first FreeBSD slice has >N == 3, given the constraints under which setroot() is operating. setroot() doesn't have many constraints. I think it can just attempt to open the device passed by the boot blocks, except in case 1. If this succeeds, then the disk must have real slices. If not, the error is probably caused by the boot blocks passing us the wrong device or unit, and we have worse problems than mistranslating the slice. >(Note that "valid" above is a subset of any FreeBSD slice being anywhere > on the disk. It is this subset that the sysinstall "all disk/no" > option generates.) Except "(1 big part.)" is supposed to restrict to the case where the partition covers the whole disk. It can still be an primary partition (slice 1-4). I don't know exactly what sysinstall does. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803100342.OAA30899>