Subject: SCSI PCI RAID - Disklabel and dmesg conflict
To: None <netbsd-help@NetBSD.org>
From: Selvan Naidoo <selvany@cat.co.za>
List: netbsd-help
Date: 09/09/2003 18:31:34
I have a problem using an Easyraid (16 bays configured for raid 5 - model
INDY 2600) with 1.6.1 (using an adaptec 29160 as the hba).
I am accessing the easyraid from two machines each with 29160s (two raid
sets one for each pc).

Since each raid set is > 1TB I have had to split it into two slices (pity
about ufs2 not being available).
The two slices are each slice 0 (sd0 = capacity 636 000 MBytes)  and slice 1
(sd1 = capacity 600 000 MBytes).

When considering one PC at a time the output from disklabelling /dev/sd0
indicated the total number of sectors to be 2147483647 - this is clearly
wrong. I wrote a code fragment that uses an ioctl (DIOCGDINFO) which not
unexpectedly confirms the same result (attached result below). Doesn't
disklabel use the same ioctl?

The output from the kernel "dmesg" file displays the total sector size of
sd0 as: 1304313856 which is more like what I would expect. See below.

If anyone can let me know why there is this discrepancy I would really
appreciate it.....

Selvan Naidoo

Result from IOCTL:::::
Sectors : 2147483647
Bytes/sector: 512
Size : 1099511627264 bytes, 1073741823 KB, 1048576.00 MB, 1024.00 GB
Partitions (7):
a: sectors: 0 ( 0 bytes), offset: 0 ( 0 bytes)
b: sectors: 0 ( 0 bytes), offset: 0 ( 0 bytes)
c: sectors: 0 ( 0 bytes), offset: 0 ( 0 bytes)
d: sectors: 1304313856 (667808694272 bytes), offset: 0 ( 0 bytes)
e: sectors: 0 ( 0 bytes), offset: 0 ( 0 bytes)
f: sectors: 130431385 (66780869120 bytes), offset: 63 ( 32256 bytes)
g: sectors: 1173882408 (601027792896 bytes), offset: 130431448 (66780901376
bytes)


disklabel slice 1:::::
# /dev/rsd0d:
type: SCSI
disk: X16
label: sd0
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 128
sectors/cylinder: 16384
cylinders: 154609
total sectors: 2147483647
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
7 partitions:
# size offset fstype [fsize bsize cpg/sgs]
d: 1304313856 0 unused 0 0 # (Cyl. 0 - 79608)
f: 130431385 63 4.2BSD 1024 8192 5 # (Cyl. 0*- 7960*)
g: 1173882408 130431448 4.2BSD 1024 8192 5 # (Cyl. 7960*- 79608)

Output from DMESG:
biomask e945 netmask ed45 ttymask ffe7
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 1 lun 0: <easyRAID, X16, 0001> SCSI3 0/direct fixed
sd0: 621 GB, 79609 cyl, 128 head, 128 sec, 512 bytes/sect x 1304313856
sectors
sd1 at scsibus0 target 1 lun 1: <easyRAID, X16, 0001> SCSI3 0/direct fixed
sd1: 585 GB, 75000 cyl, 128 head, 128 sec, 512 bytes/sect x 1228800000
sectors
sd0: sync (50.0ns offset 8), 16-bit (40.000MB/s) transfers
sd1: sync (50.0ns offset 8), 16-bit (40.000MB/s) transfers
Kernelized RAIDframe activated