Re: boot0 and fdisk / disklabel misbehaviour

2003-11-13 Thread Rudolf Cejka
Rudolf Cejka wrote (2003/11/11):
 And almost at the same time, I'm looking at the last change to
 boot0.s 1.26, if there is forgotten TBL1SZ update, or not :o)))

Just for record: I have submitted patch solving problems with
bad information about partitions as kern/59256 right now.

-- 
Rudolf Cejka cejkar at fit.vutbr.cz http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Dag-Erling Smørgrav
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=/dev/zero of=/dev/ad0 count=20
   # 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
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Dag-Erling Smørgrav
[EMAIL PROTECTED] (Dag-Erling Smørgrav) writes:
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.

...and here's the patch.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]

Index: fdisk.c
===
RCS file: /home/ncvs/src/sbin/fdisk/fdisk.c,v
retrieving revision 1.71
diff -u -r1.71 fdisk.c
--- fdisk.c	3 May 2003 18:41:56 -	1.71
+++ fdisk.c	11 Nov 2003 08:38:09 -
@@ -1300,6 +1300,11 @@
 if (start % dos_sectors == 0  (start + size) % dos_sectors == 0)
 	return (1);
 
+if (start == 0) {
+	warnx(WARNING: partition overlaps with partition table);
+	if (ok(Correct this automatically?))
+		start = dos_sectors;
+}
 if (start % dos_sectors != 0)
 	warnx(WARNING: partition does not start on a head boundary);
 if ((start  +size) % dos_sectors != 0)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Alexander Leidinger
On Tue, 11 Nov 2003 09:36:14 +0100
[EMAIL PROTECTED] (Dag-Erling Smørgrav) wrote:

  - boot0 off-by-one error:

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.

Do you have a second disk in the system? Are you able to switch to the
second disk with boot0? I have a current system where I'm not able to
switch to the second disk (master on secondary ata channel).

Bye,
Alexander.

-- 
   If Bill Gates had a dime for every time a Windows box crashed...
...Oh, wait a minute, he already does.

http://www.Leidinger.net   Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Dag-Erling Smørgrav
Alexander Leidinger [EMAIL PROTECTED] writes:
 Do you have a second disk in the system? Are you able to switch to the
 second disk with boot0? I have a current system where I'm not able to
 switch to the second disk (master on secondary ata channel).

Yes, I can switch back and forth between the single disk with Linux on
(master on primary) and the RAID0 array with FreeBSD on (separate
Promise TX2000 controller).  No problems there.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Bruce Evans
On Tue, 11 Nov 2003, Dag-Erling [iso-8859-1] Smørgrav wrote:

 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=/dev/zero of=/dev/ad0 count=20
# fdisk -i ad0
(create a FreeBSD partition)
# disklabel -rw ad0s1 auto
# newfs -U /dev/ad0s1a
# disklabel -B ad0s1a
(this trashes the partition table)

I think you mean bsdlabel.  disklabel is just a link to bsdlabel in
-current.

This was fixed in rev.1.8 of disklabel.c, but the change was lost in
bsdlabel.

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.

Yes.  This is the dangerously undedicated case.  Some consider this to
be an error.  I only ever used it for one drive.

Bruce
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot0 and fdisk / disklabel misbehaviour

2003-11-11 Thread Rudolf Cejka
Dag-ErlingSm?rgrav wrote (2003/11/11):
  - boot0 off-by-one error:
The OS table in boot0.s is as follows:
 .byte os_misc-. # Unknown
 ...
 .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.

And almost at the same time, I'm looking at the last change to
boot0.s 1.26, if there is forgotten TBL1SZ update, or not :o)))

PS: After UNIX removal, it is very hard to find clean place for
0x7 - NTFS with name better than DOS...

--- boot0.s.origTue Nov 11 18:25:12 2003
+++ boot0.s Tue Nov 11 18:25:21 2003
@@ -25,7 +25,7 @@
.set PRT_OFF,0x1be  # Partition table
 
.set TBL0SZ,0x3 # Table 0 size
-   .set TBL1SZ,0xc # Table 1 size
+   .set TBL1SZ,0xb # Table 1 size
 
.set MAGIC,0xaa55   # Magic: bootable
.set B0MAGIC,0xbb66 # Identification

-- 
Rudolf Cejka cejkar at fit.vutbr.cz http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to [EMAIL PROTECTED]