Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 1997 23:30:01 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: kern/4845: Boot complains about disk slices in FAT partitions - FDIV075
Message-ID:  <199710250630.XAA17012@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/4845; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, uhclem@nemesis.lonestar.org
Cc:  Subject: Re: kern/4845: Boot complains about disk slices in FAT partitions - FDIV075
Date: Sat, 25 Oct 1997 16:18:49 +1000

 >On reboot, the kernel for some reason looked into the type 6 partition,
                                                               ^^^^^^^^^ slice
 >and saw the traces of the old slice data from the previous installation
              ^^^^^^^^^ all of  ^^^^^ partition
 >of FreeBSD which still linger in the partition now reserved for MS-DOS,
                                       ^^^^^^^^^ slice
 
 The reason is that there is nothing special about slice type 6.
 Slices of all types can be labeled.  Only slice type 165 is special.
 Its specialness is limited to 3 things:
 - the boot loader only looks at the first slice of type 165.
 - partitions on the first slice slice of type 165 are aliased to the
   historical BSD partitions.
 - a warning is printed for slices of type 165 that don't have a label.
 
 Versions before 2.2.0-Release did not search for labels until
 necessary, so labels inside an MS-DOS slice would not have been
 noticed until the slice is mounted or otherwise opened.
 
 >and these messages came out:
 >
 >Oct 24 21:30:48 skaro /kernel: changing root device to sd0a
 >Oct 24 21:30:48 skaro /kernel: sd0s1: raw partition size != slice size
 >Oct 24 21:30:48 skaro /kernel: sd0s1: start 32, end 102399, size 102368
 >Oct 24 21:30:48 skaro /kernel: sd0s1c: start 32, end 4237311, size 4237280
 >Oct 24 21:30:48 skaro /kernel: sd0s1: truncating raw partition
 >...
 
 >Despite the alarming look of these messages, the slices that were supposed
                                                   ^^^^^^ partitions
 >to be found on partition 2 were found, and mounted sucessfully.
                 ^^^^^^^^^ slice
 
 There is no problem unless the partitions on slice 1 are used.
 
 >But to get the kernel to stop sticking its nose into the MS-DOS type 6
 >partition and putting these messages out on each boot, I had to install
 >MS-DOS in partition 1 and wipe out the remaining bits of the old FreeBSD
 >install.  I suspect the kernel is still looking in there, but isn't
 >finding anything it recognizes at all.
 
 The label can be removed using dd or a disk editor on the whole
 disk slice (the whole disk slice must be used, since the label is
 excessively write protected for accesses via the slice containing
 the label).  This is fairly easy if the label is near the front of
 the disk.  Otherwise, limitations in utilities get in the way (dd
 doesn't understand that disks are seekable so it seeks by reading,
 and it doesn't support offsets >= 2G).
 
 Another reason to remove the label is to prevent it reappearing if
 you change the slice type back to 165.
 
 It may also important to remove metadata in MS-DOS slices.  Normally Use
 MS-DOS fdisk to give it a chance to clear the old BIOS Parameter Block.
 Don't use FreeBSD fdisk to change the slice type to a non-MSDOS type
 unless you clear the BPB in some way (installing FreeBSD boot blocks
 is sufficient to clear it).
 
 >In my opinion, the slice code should not be investigating non-165-type
 >partitions for slices.   
 
 Sorry, this is a feature (device independence).
 
 >>Fix:
 >	
 >I suggest testing the partition type for known-slicable partition values
 >before hunting for possible slice data in that partition.
 
 The bug is apparently really in sysinstall.  It should optionally clear
 old labels when changing slice tables significantly.
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710250630.XAA17012>