[comp.os.minix] mkfs and readall that

nt@otter.hpl.hp.com (Nicolas Tripon) (05/28/91)

  The machine is a 386sx HP Vectra with a type-2 hard disk (20 Mo, 4 heads,
17 sectors/track, 615 cylinders - MS-DOS formats 614, and a few bad sectors). I
wanted to create 2 partitions on the disk : partition 1 for everyday usage, and
partition 3 for the ram disk. fdisk reports the following :

                        ---first----  ----last--- -----sectors----
Num Sorted Active Type  cyl head sec cyl head sec base  last  size
1   1             MINIX 0   0    2   554 3    16  1+    37738 37738
2   3#                  0   0    0   0   0    0   0     0     0    
3   2#            MINIX 555 0    1   613 3    17  37740 41751 4012
4   4                   0   0    0   0   0    0   0     0     0    

When trying to make the file system, I get :
# mkfs /dev/hd3 2000
Unrecoverable write error on device 3/3, block 1999.
Error : file system is too big for minor device.
Line 1 being processed when error detected.

If I continue, I get :
# mkfs /dev/hd1 18000
# /etc/mount /dev/hd1 /user
# readall -b /dev/hd1
Controller not ready in com_out
general protection
process number -6, pc=0x0005:0x00001593
kernel panic exception in kernel, mm or fs
type any key to reboot

If I go back to fdisk and modify as follows :

                        ---first----  ----last--- -----sectors----
Num Sorted Active Type  cyl head sec cyl head sec base  last  size
1   1             MINIX 0   0    2   613 3    16  1+    41750 41750
2   2                   0   0    0   0   0    0   0     0     0    
3   3                   0   0    0   0   0    0   0     0     0    
4   4                   0   0    0   0   0    0   0     0     0    

then, upon exit, fdisk complains :
disk appears to have mis-specified number of heads or sectors ; try 
  fdisk -h4 -s16 /dev/hd0
instead of
  fdisk -h4 -s17 /dev/hd0

  I will appreciate any help to get me started. -Nicolas Tripon

evans@syd.dit.CSIRO.AU (Bruce.Evans) (05/28/91)

In article <78380001@otter.hpl.hp.com> nt@otter.hpl.hp.com (Nicolas Tripon) writes:
>...
>partition 3 for the ram disk. fdisk reports the following :
>
>                        ---first----  ----last--- -----sectors----
>Num Sorted Active Type  cyl head sec cyl head sec base  last  size
>1   1             MINIX 0   0    2   554 3    16  1+    37738 37738
>2   3#                  0   0    0   0   0    0   0     0     0    
>3   2#            MINIX 555 0    1   613 3    17  37740 41751 4012
>4   4                   0   0    0   0   0    0   0     0     0    
>
>When trying to make the file system, I get :
># mkfs /dev/hd3 2000
>Unrecoverable write error on device 3/3, block 1999.
>Error : file system is too big for minor device.

This is because the driver sorts :-( the partitions. hd3 is empty. Be very
careful about this when you have a precious partition in the middle.

>If I continue, I get :
># mkfs /dev/hd1 18000
># /etc/mount /dev/hd1 /user
># readall -b /dev/hd1
>Controller not ready in com_out
>general protection
>process number -6, pc=0x0005:0x00001593
>kernel panic exception in kernel, mm or fs

This looks like a disk controller problem or incompatibility but there must
be a kernel bug to cause the panic.

>If I go back to fdisk and modify as follows :
>
>                        ---first----  ----last--- -----sectors----
>Num Sorted Active Type  cyl head sec cyl head sec base  last  size
>1   1             MINIX 0   0    2   613 3    16  1+    41750 41750
>2   2                   0   0    0   0   0    0   0     0     0    
>3   3                   0   0    0   0   0    0   0     0     0    
>4   4                   0   0    0   0   0    0   0     0     0    
>
>then, upon exit, fdisk complains :
>disk appears to have mis-specified number of heads or sectors ; try 
>  fdisk -h4 -s16 /dev/hd0
>instead of
>  fdisk -h4 -s17 /dev/hd0

This is a minor bug in fdisk. It doesn't see any sector numbers higher
than 16 (it reduced the last sector from 17 to 16 to make the size even)
so it so it wonders if the default of 17 is wrong. However, it could do
better by checking against the sizes instead of the maximum last sector.
-- 
Bruce Evans		evans@syd.dit.csiro.au