From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 3 21:40:04 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BD7F106564A for ; Sat, 3 Jul 2010 21:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 099328FC0A for ; Sat, 3 Jul 2010 21:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o63Le2bo093757 for ; Sat, 3 Jul 2010 21:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o63Le2gE093756; Sat, 3 Jul 2010 21:40:02 GMT (envelope-from gnats) Date: Sat, 3 Jul 2010 21:40:02 GMT Message-Id: <201007032140.o63Le2gE093756@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: =?ISO-8859-1?Q?Jo=EBl_FAEDI?= Cc: Subject: Re: bin/148253: sysinstall(8): sysinstall partition=<SIZE> creates invalid partition type X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?ISO-8859-1?Q?Jo=EBl_FAEDI?= List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jul 2010 21:40:04 -0000 The following reply was made to PR bin/148253; it has been noted by GNATS. From: =?ISO-8859-1?Q?Jo=EBl_FAEDI?= To: bug-followup@FreeBSD.org, bjones@castlejones.net Cc: Subject: Re: bin/148253: sysinstall(8): sysinstall partition=<SIZE> creates invalid partition type Date: Sat, 3 Jul 2010 23:12:37 +0200 --0016e6dab38bbbdba8048a8229bb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello, I notice that other calls to 'Create_Chunk' in disks.c use SUBTYPE_FREEBSD constant for and problematic calls have a "3" hardcoded... So I think the following patch for "/usr/src/usr.sbin/sysinstall/disks.c" will solve this problem. --- disks.c.orig 2010-06-14 04:09:06.000000000 +0200 +++ disks.c 2010-07-03 22:01:14.000000000 +0200 @@ -959,7 +959,7 @@ /* If a chunk is at least 10MB in size, use it. */ if (chunk_info[i]->type =3D=3D unused && chunk_info[i]->siz= e > (10 * ONE_MEG)) { Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, - freebsd, 3, + freebsd, SUBTYPE_FREEBSD, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); variable_set2(DISK_PARTITIONED, "yes", 0); @@ -992,7 +992,7 @@ for (i =3D 0; chunk_info[i]; i++) { /* If a chunk is at least sz MB, use it. */ if (chunk_info[i]->type =3D=3D unused && chunk_info[i]->siz= e >=3D sz) { - Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, + Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, SUBTYPE_FREEBSD, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); variable_set2(DISK_PARTITIONED, "yes", 0); My version of FreeBSD: FreeBSD xxxx 8.1-RC1 FreeBSD 8.1-RC1 #0: Mon Jun 14 14:44:53 UTC 2010 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 My tests: 1 Modify sysinstall and compile it (without installing it for now) 1.1 cd /usr/src/usr.sbin/sysinstall 1.2. apply the patch 1.3. make 2 Make a test on an unused external USB disk with the shipped "sysinstall" 2.1 dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 count=3D64 2.2 /usr/sbin/sysinstall debug=3DYES nonInteractive=3DYES disk=3Dda1 partit= ion=3D10G bootManager=3Dboot diskPartitionEditor diskPartitionWrite 2.3 /usr/sbin/sysinstall debug=3DYES nonInteractive=3DYES disk=3Dda1 partit= ion=3D15G bootManager=3Dboot diskPartitionEditor diskPartitionWrite 2.4 fdisk /dev/da1 ******* Working on device /dev/da1 ******* parameters extracted from in-core disklabel are: cylinders=3D3648 heads=3D255 sectors/track=3D63 (16065 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=3D3648 heads=3D255 sectors/track=3D63 (16065 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 3 (0x03),(XENIX /usr file system) start 63, size 20964762 (10236 Meg), flag 0 beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 63 The data for partition 2 is: sysid 3 (0x03),(XENIX /usr file system) start 20964825, size 31455270 (15359 Meg), flag 0 beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 254/ sector 63 The data for partition 3 is: The data for partition 4 is: 3 Make the same tests with the external USB disk but with the patched "sysinstall" 3.1 dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 count=3D64 3.2 /usr/src/usr.sbin/sysinstall/sysinstall debug=3DYES nonInteractive=3DYE= S disk=3Dda1 partition=3D10G bootManager=3Dboot diskPartitionEditor diskPartitionWrite 3.3 /usr/src/usr.sbin/sysinstall/sysinstall debug=3DYES nonInteractive=3DYE= S disk=3Dda1 partition=3D15G bootManager=3Dboot diskPartitionEditor diskPartitionWrite 3.4 fdisk /dev/da1 ******* Working on device /dev/da1 ******* parameters extracted from in-core disklabel are: cylinders=3D3648 heads=3D255 sectors/track=3D63 (16065 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=3D3648 heads=3D255 sectors/track=3D63 (16065 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 20964762 (10236 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 63 The data for partition 2 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 20964825, size 31455270 (15359 Meg), flag 80 (active) beg: cyl 1023/ head 255/ sector 63; end: cyl 1023/ head 254/ sector 63 The data for partition 3 is: The data for partition 4 is: It work ! Best regards, Jo=EBl FAEDI --0016e6dab38bbbdba8048a8229bb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I notice that other calls to 'Create_Chunk' in disks.= c use=20 SUBTYPE_FREEBSD constant for and problematic calls have a "3" har= dcoded...
So I think the following patch for "/usr/src/usr.sbin/sy= sinstall/disks.c" will solve this problem.

=A0--- disks.c.orig= =A0=A0=A0=A0=A0=A0=A0 2010-06-14 04:09:06.000000000 +0200
+++ disks.c=A0=A0=A0=A0 2010-07-03 22:01:14.000000000 +0200
@@ -959,7 +9= 59,7 @@
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* If a chunk is a= t least 10MB in size, use it. */
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 if (chunk_info[i]->type =3D=3D unused && chunk_info[i]-&g= t;size > (10 * ONE_MEG)) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Create_Chunk(d, c= hunk_info[i]->offset, chunk_info[i]->size,
-=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fr= eebsd, 3,
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 freebsd, SUBTYPE_FREEBSD,
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 (chunk_info[i]->flags & CHUNK_ALIGN),
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 "FreeBSD");
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 variable_set2(DISK_PARTITIONED, "yes&qu= ot;, 0);
@@ -992,7 +992,7 @@
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 for (i= =3D 0; chunk_info[i]; i++) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 /* If a chunk is at least sz MB, use it. */
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (chunk_info[i]->type = =3D=3D unused && chunk_info[i]->size >=3D sz) {
-=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Create_Chunk(d, chunk_info[i]= ->offset, sz, freebsd, 3,
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, SUBTYPE= _FREEBSD,
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 (chunk_info[i]->flags & CHUNK_ALIGN),
=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 "FreeBSD");
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 variable_set2(DISK_PARTITIONED, "yes"= , 0);

My version of FreeBSD:
FreeBSD xxxx 8.1-RC1 FreeBSD 8.1-RC1 #0: Mon Jun 14 14:44:53 UTC 2010=A0=A0= =A0=A0 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC=A0 i386
My tests:
1 Modify sysinstall and compile it (without installing it= for now)
1.1 cd /usr/src/usr.sbin/sysinstall
1.2. apply the patch
1.3. make
2 Make a test on an unused external USB disk with the shipped "sy= sinstall"
2.1 dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 count=3D642.2 /usr/sbin/sysinstall debug=3DYES nonInteractive=3DYES disk=3Dda1 part= ition=3D10G bootManager=3Dboot diskPartitionEditor diskPartitionWrite
2.3 /usr/sbin/sysinstall debug=3DYES nonInteractive=3DYES disk=3Dda1=20 partition=3D15G bootManager=3Dboot diskPartitionEditor diskPartitionWrite2.4 fdisk /dev/da1
******* Working on device /dev/da1 *******
param= eters extracted from in-core disklabel are:
cylinders=3D3648 heads=3D255= sectors/track=3D63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
p= arameters to be used for BIOS calculations are:
cylinders=3D3648 heads= =3D255 sectors/track=3D63 (16065 blks/cyl)

Media sector size is 512<= br>Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid= 3 (0x03),(XENIX /usr file system)
=A0=A0=A0 start 63, size 20964762 (10= 236 Meg), flag 0
=A0=A0=A0=A0=A0=A0=A0 beg: cyl 0/ head 1/ sector 1;
= =A0=A0=A0=A0=A0=A0=A0 end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 3 (0x03),(XENIX /usr file system)
= =A0=A0=A0 start 20964825, size 31455270 (15359 Meg), flag 0
=A0=A0=A0=A0= =A0=A0=A0 beg: cyl 1023/ head 255/ sector 63;
=A0=A0=A0=A0=A0=A0=A0 end:= cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 = is:
<UNUSED>

3 Make the same tests with the external USB di= sk but with the patched=20 "sysinstall"
3.1 dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 coun= t=3D64
3.2 /usr/src/usr.sbin/sysinstall/sysinstall debug=3DYES nonIntera= ctive=3DYES disk=3Dda1 partition=3D10G bootManager=3Dboot diskPartitionEdit= or diskPartitionWrite
3.3 /usr/src/usr.sbin/sysinstall/sysinstall debug=3DYES nonInteractive=3DYE= S=20 disk=3Dda1 partition=3D15G bootManager=3Dboot diskPartitionEditor=20 diskPartitionWrite
3.4 fdisk /dev/da1
******* Working on device /dev/= da1 *******
parameters extracted from in-core disklabel are:
cylinder= s=3D3648 heads=3D255 sectors/track=3D63 (16065 blks/cyl)

Figures bel= ow won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=3D3648 heads= =3D255 sectors/track=3D63 (16065 blks/cyl)

Media sector size is 512<= br>Warning: BIOS sector numbering starts with sector 1
Information from = DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)=A0=A0=A0 start 63, size 20964762 (10236 Meg), flag 80 (active)
=A0=A0= =A0=A0=A0=A0=A0 beg: cyl 0/ head 1/ sector 1;
=A0=A0=A0=A0=A0=A0=A0 end:= cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)=A0=A0=A0 start 20964825, size 31455270 (15359 Meg), flag 80 (active)
= =A0=A0=A0=A0=A0=A0=A0 beg: cyl 1023/ head 255/ sector 63;
=A0=A0=A0=A0= =A0=A0=A0 end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 = is:
<UNUSED>

It work !

Best regards,

Jo=EBl F= AEDI


--0016e6dab38bbbdba8048a8229bb--