Subject: bin/26708: disklabel -wr deletes the bootcode from the netbsd partition
To: None <email@example.com>
From: None <firstname.lastname@example.org>
Date: 08/18/2004 22:07:34
>Synopsis: disklabel -wr deletes the bootcode from the netbsd partition
>Arrival-Date: Wed Aug 18 21:07:00 UTC 2004
>Originator: David Laight
>Release: NetBSD 2.0
Current as of 18 Aug 2004
disklabel is compiled with SAVEBOOTAREA, the intention of this code
is to preserve the disk's boot code.
However the effect is entirely different!
The SAVEBOOTAREA code reads 8k from the sector 0, and zeros out
the part that (is expected to) contain the label.
The new label is then written into the space, and the entire 8k
written to the beginning of partition 2.
The effect is to replace the partition boot code of whichever
partition the user said was the mbr (type 169) partition with the
mbr boot code.
When you try to boot that partition, the bootselect code just
re-reads another copy of the mbr code - and redisplays the menu.
Run sysinst and install multiple copies of netbsd.
Simplify disklabel, and rework its logic so that the write is
done as a 'read modify write'.
The disklabel should also be written to all of the NetBSD mbr
partition that exist onthe disk.
Maybe just fix it to find the old sectors using the same rules
as are used to write the label.