NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-alpha/48697: Sysinst compute illegal disk geometry and newfs is bound to fail.



>Number:         48697
>Category:       port-alpha
>Synopsis:       Sysinst compute illegal disk geometry and newfs is bound to 
>fail.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-alpha-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 02 14:50:00 +0000 2014
>Originator:     nullnilaki
>Release:        NetBSD/alpha 6.99.38
>Organization:
Japan
>Environment:
NetBSD/alpha 6.99.38
>Description:
I have Tru64 UNIX installed HDD.
After that, I went to install NetBSD/alpha.
Sysinst compute illegal disk geometry and newfs is bound to fail.

--------------------------------------------------
*** keyboard not plugged in...
starting console on CPU 0
initialized idle PCB
initializing semaphores
initializing heap
initial heap 240c0
memory low limit = 1c6000 heap = 240c0, 17fc0
initializing driver structures
initializing idle process PID
initializing file system
initializing timer data structures
lowering IPL
CPU 0 speed is 1000 MHz
create dead_eater
create poll
create timer
create powerup
access NVRAM
512 MB of System Memory
Testing Memory
...
probe I/O subsystem
starting drivers
entering idle loop
initializing GCT/FRU at 1ee000
Initializing pkc ewa dqa dqb eia eib pka pkb
Memory Testing and Configuration Status
Array Size Base Address Intlv Mode
--------- ---------- ---------------- ----------
0 512Mb 0000000000000000 1-Way
 
512 MB of System Memory
Testing the System
Testing the Disks (read only)
Testing the Network
AlphaStation DS15 Console V7.2-2, built on Jun 9 2006 at 15:45:46
>>>boot dqa0
(boot dqa0.0.0.13.0 -flags A)
block 0 of dqa0.0.0.13.0 is a valid boot block
reading 13 blocks from dqa0.0.0.13.0
bootstrap code read in
base = 2be000, image_start = 0, image_bytes = 1a00(6656)
initializing HWRPB at 2000
initializing page table at 1fff0000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code
 
NetBSD/alpha 6.99.38 ISO 9660 Primary Bootstrap
Jumping to entry point...
 
NetBSD/alpha 6.99.38 Secondary Bootstrap, Revision 1.13 (Sat Mar 29 04:53:20 
UTC 2014)
 
VMS PAL rev: 0x1000700010162
OSF PAL rev: 0x100070002015c
Switch to OSF PAL code succeeded.
 
Boot flags: A
10623872+205920=0xa54628
 
Entering netbsd at 0xfffffc0000431220...
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
 
NetBSD 6.99.38 (INSTALL) #0: Sat Mar 29 05:13:07 UTC 2014
naruaki@:/usr/obj.alpha/sys/arch/alpha/compile/INSTALL
AlphaStation DS15, 1000MHz, s/n AY42501857
8192 byte page size, 1 processor.
total memory = 512 MB
(2880 KB reserved for PROM, 509 MB used by NetBSD)
avail memory = 491 MB
mainbus0 (root)
cpu0 at mainbus0: ID 0 (primary), 21264C-6
cpu0: Architecture extensions: 0x1307<PAT,MVI,CIX,FIX,BWX>
tsc0 at mainbus0: 21274 Core Logic Chipset, Cchip rev 0
tsc0: 2 Dchips, 1 memory bus of 16 bytes
tsc0: arrays present: 512MB, 0MB, 0MB, 0MB, Dchip 0 rev 1
tsp0 at tsc0
pci0 at tsp0 bus 0
sio0 at pci0 dev 7 function 0: vendor 0x10b9 product 0x1533 (rev. 0xc3)
ahc0 at pci0 dev 8 function 0: Adaptec aic7899 Ultra160 SCSI adapter
ahc0: interrupting at dec 6600 irq 13
ahc0: aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
ahc1 at pci0 dev 8 function 1: Adaptec aic7899 Ultra160 SCSI adapter
ahc1: interrupting at dec 6600 irq 12
ahc1: aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
scsibus1 at ahc1: 16 targets, 8 luns per target
fxp0 at pci0 dev 9 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp0: interrupting at dec 6600 irq 28
fxp0: Ethernet address 00:0f:20:2b:e1:24
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp1 at pci0 dev 10 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp1: interrupting at dec 6600 irq 4
fxp1: Ethernet address 00:0f:20:2b:e1:23
inphy1 at fxp1 phy 1: i82555 10/100 media interface, rev. 4
inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
aceride0 at pci0 dev 13 function 0: Acer Labs M5229 UDMA IDE Controller (rev. 
0xc1)
aceride0: primary channel interrupting at isa irq 14
atabus0 at aceride0 channel 0
aceride0: secondary channel interrupting at isa irq 15
atabus1 at aceride0 channel 1
isa0 at sio0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
mcclock0 at isa0 port 0x70-0x71: mc146818 compatible time-of-day clock
tsp1 at tsc0
pci1 at tsp1 bus 0
vga0 at pci1 dev 7 function 0: vendor 0x1002 product 0x5157 (rev. 0x00)
wsdisplay0 at vga0 (kbdmux ignored)
drm at vga0 not configured
siop0 at pci1 dev 8 function 0: Symbios Logic 53c895 (ultra2-wide scsi)
siop0: using on-board RAM
siop0: interrupting at dec 6600 irq 36
scsibus2 at siop0: 16 targets, 8 luns per target
tlp0 at pci1 dev 9 function 0: DECchip 21140A Ethernet, pass 2.0
tlp0: interrupting at dec 6600 irq 24
tlp0: DEC DE500-AA, Ethernet address 00:00:f8:03:dd:a1
nsphy0 at tlp0 phy 5: DP83840 10/100 media interface, rev. 0
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vendor 0x1274 product 0x1371 (audio multimedia, revision 0x09) at pci1 dev 10 
function 0 not configured
tsciic at tsc0
not configured
scsibus0: waiting 2 seconds for devices to settle...
scsibus1: waiting 2 seconds for devices to settle...
scsibus2: waiting 2 seconds for devices to settle...
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-ST RW/DVD GCC-4480B, , 2.06> cdrom removable
sd0 at scsibus0 target 1 lun 0: <FUJITSU, MAU3073NC, 2904> disk fixed
sd0: 69809 MB, 49158 cyl, 4 head, 727 sec, 512 bytes/sect x 142969680 sectors
sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
WARNING: can't figure what device matches "IDE 0 13 0 0 0 0 0"
root on md0a dumps on md0b
root file system type: ffs
Terminal type? [vt100]
erase ^?, werase ^W, kill ^U, intr ^C
  
NetBSD/alpha 6.99.38

This menu-driven tool is designed to help you install NetBSD to a hard disk,
or upgrade an existing NetBSD system, with a minimum of work.
In the following menus type the reference letter (a, b, c, ...) to select an
item, or type CTRL+N/CTRL+P to select the next/previous item.
The arrow keys and Page-up/Page-down may also work.
Activate the current selection from the menu by typing the enter key.

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x>a: Installation messages in English x
x b: Messages d'installation en fran&#36555;is x
x c: Installation auf Deutsch x
x d: Komunikaty instalacyjne w jezyku polskim x
x e: Mensajes de instalacion en castellano x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

I found only one disk, sd0 (68G, FUJITSU MAU3073NC).
Therefore I assume you want to install NetBSD on it.
 
lqqqqqqqqqqqqqqqqqqqqqqqk
x>Hit enter to continue x
mqqqqqqqqqqqqqqqqqqqqqqqj
 
NetBSD uses a BSD disklabel to carve up the NetBSD portion of the disk into
multiple BSD partitions. You must now set up your BSD disklabel.
 
You can use a simple editor to set the sizes of the NetBSD partitions, or
keep the existing partition sizes and contents.
 
You will then be given the opportunity to change any of the disklabel fields.
 
The NetBSD part of your disk is 82858 Megabytes. A full installation
requires at least 384 Megabytes without X and at least 434 Megabytes if the X
sets are included.
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Choose your installation x
x x
x>a: Set sizes of NetBSD partitions x
x b: Use existing partition sizes x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
 
You can now change the sizes for the system partitions. The default is to
allocate all the space to the root file system, however you may wish to have
separate /usr (additional system files), /var (log files etc) or /home
(users' home directories).
 
Free space will be added to the partition marked with a '+'.
 
MB Cylinders Sectors Filesystem
> 82858 49158 169693416 /
0 0 0 swap
0 0 0 /tmp (mfs)
0 0 0 /usr
0 0 0 /var
0 0 0 /home
Add a user defined partition
Change input units (sectors/cylinders/MB)
Accept partition sizes. Free space 0 MB, 6 free partitions.
 
We now have your BSD-disklabel partitions as:
This is your last chance to change them.
 
Start MB End MB Size MB FS type Newfs Mount Mount point
a: 0 82857 82858 FFSv1 Yes Yes /
b: 0 0 0 unused
c: 0 82857 82858 Whole disk
d: 0 0 0 unused
e: Show all unused partitions
f: Change input units (sectors/cylinders/MB)
>x: Partition sizes ok
 
We now have your BSD-disklabel partitions as:
This is your last chance to change them.
 
Start sec End sec Size sec FS type Newfs Mount Mount point
a: 0 169693415 169693416 FFSv1 Yes Yes /
b: 0 0 0 unused
c: 0 169693415 169693416 Whole disk
d: 0 0 0 unused
e: Show all unused partitions
f: Change input units (sectors/cylinders/MB)
>x: Partition sizes ok
 
Status: Command failed
Command: /sbin/newfs -V2 -O 1 -b 16384 -f 2048 /dev/rsd0a
Hit enter to continue
--------------------------------------------------------------------------------
/dev/rsd0a: 82858.1MB (169693416 sectors) block size 16384, fragment size 2048
using 450 cylinder groups of 184.14MB, 11785 blks, 23296 inodes.
sd0(ahc0:0:1:0): illegal request, data = 00 00 00 00 21 00 00 00 00 00 01 2a 00
wtfs: write error for sector 169693415: Invalid argument
--------------------------------------------------

This HDD specification is:
sd0 at scsibus0 target 1 lun 0: <FUJITSU, MAU3073NC, 2904> disk fixed
sd0: 69809 MB, 49158 cyl, 4 head, 727 sec, 512 bytes/sect x 142969680 sectors
sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing

But Sysinst prints follow message.
The NetBSD part of your disk is 82858 Megabytes.  A full installation
requires at least 384 Megabytes without X and at least 434 Megabytes if the X
sets are included.

        MB         Cylinders   Sectors   Filesystem
   > 82858             49158 169693416   /

I guess this problem caused by Tru64 UNIX's disklabel is the same format as BSD 
disklabel.
(If you have a Tru64 UNIX license, please check 
/usr/sys/include/sys/disklabel.h)

This is Tru64 UNIX's disklabel
--------------------------------------------------
# disklabel dsk0
# /dev/rdisk/dsk0c:
type: SCSI
disk: MAU3073NC
label:
flags: dynamic_geometry
bytes/sector: 512
sectors/track: 863
tracks/cylinder: 4
sectors/cylinder: 3452
cylinders: 49158
sectors/unit: 142969680
rpm: 15000
interleave: 1
trackskew: 216
cylinderskew: 111
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0

8 partitions:
# size offset fstype fsize bsize cpg # ~Cyl values
a: 786432 0 AdvFS # 0 - 227*
b: 786432 786432 LSMnoprv # 227*- 455*
c: 142969680 0 unused 0 0 # 0 - 41416*
d: 4096 1572864 LSMsimp # 455*- 456*
e: 70696360 1576960 unused 0 0 # 456*- 20936*
f: 70696360 72273320 unused 0 0 # 20936*- 41416*
g: 4300800 1576960 LSMnoprv # 456*- 1702*
h: 137091920 5877760 unused 0 0 # 1702*- 41416*
--------------------------------------------------

Sysinst compute MD disk geometry in md_get_info function.
(src/distrib/utils/sysinst/arch/alpha/md.c)
http://nxr.netbsd.org/source/xref/src/distrib/utils/sysinst/arch/alpha/md.c#64

If Tru64 UNIX's disklabel is stored, internal processing is:

        dlcyl = disklabel.d_ncylinders;
          -> 49158 ("cylinders")
        dlhead = disklabel.d_ntracks;
          -> 4 ("tracks/cylinder")
        dlsec = disklabel.d_nsectors;
          -> 863 ("sectors/track")
        sectorsize = disklabel.d_secsize;
          -> 512 ("bytes/sector")
        dlcylsize = disklabel.d_secpercyl;
          -> 3452 ("sectors/cylinder")

        /*
         * Compute whole disk size. Take max of (dlcyl*dlhead*dlsec)
         * and secperunit,  just in case the disk is already labelled.
         * (If our new label's RAW_PART size ends up smaller than the
         * in-core RAW_PART size  value, updating the label will fail.)
         */
        dlsize = dlcyl*dlhead*dlsec;
          -> 169693416
        if (disklabel.d_secperunit > dlsize)
              -> 142969680 ("sectors/unit") > 169693416
              dlsize = disklabel.d_secperunit;
                -> false

and Sysinst prints:

        MB         Cylinders   Sectors   Filesystem
   > 82858             49158 169693416   /


This is Tru64 UNIX's disklabel dump.
--------------------------------------------------
# hexdump -C Tru64.dump | more
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000040 57 45 56 82 04 00 00 00 4d 41 55 33 30 37 33 4e |WEV.....MAU3073N|
00000050 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |C...............|
00000060 00 00 00 00 00 00 00 00 00 02 00 00 5f 03 00 00 |............_...|
00000070 04 00 00 00 06 c0 00 00 7c 0d 00 00 50 8b 85 08 |........|...P...|
00000080 00 00 00 00 00 00 00 00 98 3a 01 00 d8 00 6f 00 |.........:....o.|
00000090 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
--------------------------------------------------

This is NetBSD's disklabel dump.(same HDD and correct value is stored)
--------------------------------------------------
# hexdump -C NetBSD.dump | more
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000040 57 45 56 82 00 00 00 00 4d 41 55 33 30 37 33 4e |WEV.....MAU3073N|
00000050 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |C...............|
00000060 00 00 00 00 00 00 00 00 00 02 00 00 d7 02 00 00 |................|
00000070 04 00 00 00 06 c0 00 00 5c 0b 00 00 50 8b 85 08 |........\...P...|
00000080 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
--------------------------------------------------

Tru64 UNIX's sectors/track: 863 value is:
863 = 0x35F is stored line 60.(5f 03)
and
Tru64 UNIX's sectors/cylinder: 3452 value is:
3452 = 0xD7C is stored line 70.(7c 0d)

NetBSD's sectors/track: 727 value is:
727 = 0x2D7 is stored line 60 and same offset as Tru64 UNIX.(d7 02)
and
NetBSD's sectors/cylinder: 2908 value is:
2908 = 0xB5C is stored  line 70 and same offset as Tru64 UNIX.(5c 0b)

Other Entry("sectors/unit","tracks/cylinder","tracks/cylinder") the same.

It is a curious thing, this problem is not occurring my other size HDD.

This HDD specification is:
sd0 at scsibus0 target 0 lun 0: <COMPAQ, BD03688272, HPB4> disk fixed
sd0: 34732 MB, 43962 cyl, 2 head, 809 sec, 512 bytes/sect x 71132000 sectors
sd0: sync (12.50ns offset 63), 16-bit (160.000MB/s) transfers, tagged queueing

This is Tru64 UNIX's disklabel
--------------------------------------------------
# disklabel dsk0
# /dev/rdisk/dsk0c:
type: SCSI
disk: BD03688272
label:
flags: dynamic_geometry
bytes/sector: 512
sectors/track: 809
tracks/cylinder: 2
sectors/cylinder: 1618
cylinders: 43962
sectors/unit: 71132000
rpm: 10033
interleave: 1
trackskew: 372
cylinderskew: 120
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
 
8 partitions:
# size offset fstype fsize bsize cpg # ~Cyl values
a: 786432 0 AdvFS # 0 - 486*
b: 786432 786432 LSMnoprv # 486*- 972*
c: 71132000 0 unused 0 0 # 0 - 43962*
d: 4096 1572864 LSMsimp # 972*- 974*
e: 34777520 1576960 unused 0 0 # 974*- 22468*
f: 34777520 36354480 unused 0 0 # 22468*- 43962*
g: 4300800 1576960 LSMnoprv # 974*- 3632*
h: 65254240 5877760 unused 0 0 # 3632*- 43962*
--------------------------------------------------

>How-To-Repeat:

>Fix:
--------------------------------------------------
diff -Narbu src.orig/distrib/utils/sysinst/arch/alpha/md.c 
src/distrib/utils/sysinst/arch/alpha/md.c
--- src.orig/distrib/utils/sysinst/arch/alpha/md.c      2014-03-29 
08:10:33.000000000 +0000
+++ src/distrib/utils/sysinst/arch/alpha/md.c   2014-03-31 16:45:50.000000000 
+0000
@@ -85,19 +85,19 @@
 
        dlcyl = disklabel.d_ncylinders;
        dlhead = disklabel.d_ntracks;
-       dlsec = disklabel.d_nsectors;
        sectorsize = disklabel.d_secsize;
-       dlcylsize = disklabel.d_secpercyl;
+       dlsize = disklabel.d_secperunit;
 
        /*
-        * Compute whole disk size. Take max of (dlcyl*dlhead*dlsec)
-        * and secperunit,  just in case the disk is already labelled.
-        * (If our new label's RAW_PART size ends up smaller than the
-        * in-core RAW_PART size  value, updating the label will fail.)
+        * Tru64 UNIX's disklabel is the same format as BSD disklabel,
+        * and we can not tell these disklabel apart.
+        * However, awful "d_nsectors" size value and awful "d_secpercyl" size 
value is stored.
+        * If possible, execute "disklabel dsk0" on Tru64 UNIX,
+        * and please check "sectors/track" value and "sectors/cylinder" value.
        */
-       dlsize = dlcyl*dlhead*dlsec;
-       if (disklabel.d_secperunit > dlsize)
-               dlsize = disklabel.d_secperunit;
+
+       dlsec = disklabel.d_nsectors = dlsize / (dlhead * dlcyl);
+       dlcylsize = disklabel.d_secpercyl = dlsec * dlhead;
 
        return 1;
 }
--------------------------------------------------

There are many kinds of storage devices around the world.(SCSI,IDE,SSD,etc...)
What is the best way to fix this problem?


--
That's very nice of you!
nullnilaki%gmail.com@localhost



Home | Main Index | Thread Index | Old Index