Subject: port-i386/4520: i386 sysinst is too greedy on disk space
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Havard.Eidnes@runit.sintef.no>
List: netbsd-bugs
Date: 11/17/1997 18:52:23
>Number: 4520
>Category: port-i386
>Synopsis: i386 sysinst is too greedy on disk space
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin (GNATS administrator)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Nov 17 10:05:02 1997
>Last-Modified:
>Originator: Havard Eidnes
>Organization:
SINTEF RUNIT
>Release: NetBSD 1.3_ALPHA Nov 15 1997
>Environment:
System: NetBSD vader.runit.sintef.no 1.3_ALPHA NetBSD 1.3_ALPHA (VADER) #11: Sat Nov 8 20:20:41 MET 1997 he@vader.runit.sintef.no:/usr/src/sys/arch/i386/compile/VADER i386
>Description:
If you choose to install NetBSD on only a part of your hard
disk, it looks like sysinst will (by default) use all the disk
space in the NetBSD MBR partition *and* the disk space in the
MBR partitions *following* the NetBSD MBR partition for NetBSD.
For example, on my laptop, I have the following MBR partition
table:
******* Working on device /dev/rwd0d *******
Warning: BIOS sector numbering starts with sector 1
parameters extracted from in-core disklabel are:
cylinders=525 heads=128 sectors/track=63 (8064 sectors/cylinder)
parameters to be used for BIOS calculations are:
cylinders=525 heads=128 sectors/track=63 (8064 sectors/cylinder)
Information from DOS bootblock is:
0: sysid 6 (Primary 'big' DOS, 16-bit FAT (> 32MB))
start 63, size 1612737 (787 MB), flag 0x0
beg: cylinder 0, head 1, sector 1
end: cylinder 199, head 127, sector 63
1: sysid 165 (NetBSD or FreeBSD or 386BSD)
start 1612800, size 2419200 (1181 MB), flag 0x0
beg: cylinder 200, head 0, sector 1
end: cylinder 499, head 127, sector 63
2: sysid 132 (OS/2 hidden C: drive)
start 4032000, size 193536 (94 MB), flag 0x80
beg: cylinder 500, head 0, sector 1
end: cylinder 523, head 127, sector 63
3: <UNUSED>
where partition 2 is a (somewhat too large) suspend-to-disk
partition. Sysinst said that the NetBSD portion was 1181MB
large (correct), but when it started asking me for partition
sizes (I chose "custom" installation), it claimed (incorrectly)
that the number of sectors remaining was 2620800 instead of
the correct 2419200.
>How-To-Repeat:
Try to install NetBSD on a shared disk where the NetBSD partition
is not the last MBR partition on the drive. Watch sysinst propose to
eat up the space occupied by the following partitions on the drive.
>Fix:
This fix to /usr/src/distrib/utils/sysinst/arch/i386/md.c seems
to produce a more sensible disk label.
*** md.c.old Tue Nov 11 13:58:44 1997
--- md.c Mon Nov 17 18:44:18 1997
***************
*** 290,294 ****
/* /usr */
! partsize = fsdsize - partstart;
bsdlabel[E][D_OFFSET] = partstart;
bsdlabel[E][D_SIZE] = partsize;
--- 290,294 ----
/* /usr */
! partsize = fsptsize - partstart + ptstart;
bsdlabel[E][D_OFFSET] = partstart;
bsdlabel[E][D_SIZE] = partsize;
***************
*** 306,310 ****
/* root */
partstart = ptstart;
! remain = fsdsize - partstart;
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
--- 306,310 ----
/* root */
partstart = ptstart;
! remain = fsptsize;
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
***************
*** 322,326 ****
/* swap */
! remain = fsdsize - partstart;
i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb),
MEG/sectorsize, dlcylsize) + partstart;
--- 322,326 ----
/* swap */
! remain = fsptsize - partstart + ptstart;
i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb),
MEG/sectorsize, dlcylsize) + partstart;
***************
*** 336,341 ****
/* /usr */
! remain = fsdsize - partstart;
! partsize = fsdsize - partstart;
snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfsusr, isize, isize, 20,
--- 336,341 ----
/* /usr */
! remain = fsptsize - partstart + ptstart;
! partsize = fsptsize - partstart + ptstart;
snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfsusr, isize, isize, 20,
***************
*** 352,361 ****
/* Others ... */
! remain = fsdsize - partstart;
part = F;
if (remain > 0)
msg_display (MSG_otherparts);
while (remain > 0 && part <= H) {
! partsize = fsdsize - partstart;
snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfspart, isize, isize, 20,
--- 352,361 ----
/* Others ... */
! remain = fsptsize - partstart + ptstart;
part = F;
if (remain > 0)
msg_display (MSG_otherparts);
while (remain > 0 && part <= H) {
! partsize = fsptsize - partstart + ptstart;
snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfspart, isize, isize, 20,
***************
*** 373,377 ****
fsmount[part], 20);
partstart += partsize;
! remain = fsdsize - partstart;
part++;
}
--- 373,377 ----
fsmount[part], 20);
partstart += partsize;
! remain = fsptsize - partstart + ptstart;
part++;
}
>Audit-Trail:
>Unformatted: