Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 09:36:14 +0100
From:      des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        current@freebsd.org
Subject:   boot0 and fdisk / disklabel misbehaviour
Message-ID:  <xzp1xsfpaip.fsf@dwp.des.no>

next in thread | raw e-mail | index | archive | help
I've been busy installing various OSes on a spare disk in order to try
to reproduce some of fefe's benchmarks.  In the process, I've noticed
a couple of bogons in boot0 and disklabel:

 - disklabel -B trashes the partition table:

   # dd if=3D/dev/zero of=3D/dev/ad0 count=3D20
   # fdisk -i ad0
   (create a FreeBSD partition)
   # disklabel -rw ad0s1 auto
   # newfs -U /dev/ad0s1a
   # disklabel -B ad0s1a
   (this trashes the partition table)

   This probably happens because fdisk silently allows the user to
   create a partition that overlaps the partition table.  Arguably
   pilot error, but very confusing at the time, and fdisk should warn
   about it.

 - boot0 off-by-one error:

   The OS table in boot0.s is as follows:

                .byte os_misc-.                 # Unknown
                .byte os_dos-.                  # DOS
                .byte os_dos-.                  # DOS
                .byte os_dos-.                  # DOS
                .byte os_dos-.                  # Windows
                .byte os_dos-.                  # Windows
                .byte os_dos-.                  # Windows
                .byte os_linux-.                # Linux
                .byte os_bsd-.                  # BSD/OS
                .byte os_freebsd-.              # FreeBSD
                .byte os_bsd-.                  # OpenBSD
                .byte os_bsd-.                  # NetBSD

   Now, boot0 identifies my FreeBSD partitions as "BSD" instead of
   "FreeBSD".  It also identifies my Debian partition (type 0x83) as
   "BSD" instead of "Linux" and my Debian swap partition (type 0x82)
   as "DOS" instead of "Unknown", and NetBSD gives it the hives.  It
   seems to me that it's consistently off by one.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



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