Well,  I'm stumped at this point.  Do you think you would be able to do any debugging?  I think the key is a function called 'get_ata_channel_unit' defined in the file os_freebsd.c  At the time I wrote that, it wasn't clear that the disk numbers mapped cleanly to ATA controller unit/device.  In other words, I wasn't positive that AD0 == ata0/master.  I think this is true if there are CDROM drives connected up.  So what I do, is iterate through the possible ATA drives, via the ATA control interface, and try to match the device names.  Maybe something is going wrong because of the missing AD0-AD3. 

At any rate, if you are not adverse to trying to help debug this, I would appreciate it, otherwise I will need to make some guesses, and send you some patches to try out.


On Mon, 2003-12-08 at 07:44, Robert Tran wrote:
Here is my boot up msg

Ad[0-3] is nothing, I have 4 IDE channels and only using channel 3 and 4







Copyright (c) 1992-2003 The FreeBSD Project.

Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994

        The Regents of the University of California. All rights reserved.

FreeBSD 5.1-RELEASE #4: Sun Sep  7 15:49:45 GMT 2003


Preloaded elf kernel "/boot/kernel/kernel" at 0xc0599000.

Timecounter "i8254"  frequency 1193182 Hz

Timecounter "TSC"  frequency 996846157 Hz

CPU: Intel Pentium III (996.85-MHz 686-class CPU)

  Origin = "GenuineIntel"  Id = 0x68a  Stepping = 10



real memory  = 1073741824 (1024 MB)

avail memory = 1037123584 (989 MB)

Programming 16 pins in IOAPIC #0

IOAPIC #0 intpin 2 -> irq 0

Programming 16 pins in IOAPIC #1

FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs

 cpu0 (BSP): apic id:  0, version: 0x00040011, at 0xfee00000

 cpu1 (AP):  apic id:  1, version: 0x00040011, at 0xfee00000

 io0 (APIC): apic id:  8, version: 0x000f0011, at 0xfec00000

 io1 (APIC): apic id:  9, version: 0x000f0011, at 0xfec01000

Pentium Pro MTRR support enabled

VESA: v2.0, 4096k memory, flags:0x0, mode table:0xc04f8202 (1000022)


npx0: <math processor> on motherboard

npx0: INT 16 interface

pcibios: BIOS version 2.10

Using $PIR table, 10 entries at 0xc00f4b70

pcib0: <ServerWorks NB6635 3.0LE host to PCI bridge> at pcibus 0 on motherboard

pci0: <PCI bus> on pcib0

IOAPIC #1 intpin 6 -> irq 2

IOAPIC #1 intpin 4 -> irq 5

IOAPIC #1 intpin 5 -> irq 7

IOAPIC #0 intpin 10 -> irq 9

pci0: <display, VGA> at device 1.0 (no driver attached)

fxp0: <Intel 82557/8/9 EtherExpress Pro/100(B) Ethernet> port 0xd400-0xd43f mem

0xfe900000-0xfe9fffff,0xfeafe000-0xfeafefff irq 5 at device 4.0 on pci0

fxp0: Ethernet address 00:e0:81:20:9f:c8

miibus0: <MII bus> on fxp0

inphy0: <i82555 10/100 media interface> on miibus0

inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto

fxp1: <Intel 82557/8/9 EtherExpress Pro/100(B) Ethernet> port 0xd000-0xd03f mem

0xfe700000-0xfe7fffff,0xfeafd000-0xfeafdfff irq 7 at device 5.0 on pci0

fxp1: Ethernet address 00:e0:81:20:9f:c9

miibus1: <MII bus> on fxp1

inphy1: <i82555 10/100 media interface> on miibus1

inphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto

isab0: <PCI-ISA bridge> port 0x580-0x58f at device 15.0 on pci0

isa0: <ISA bus> on isab0

atapci0: <ServerWorks ROSB4 UDMA33 controller> port 0xffa0-0xffaf at device 15.1

 on pci0

ata0: at 0x1f0 irq 14 on atapci0

ata1: at 0x170 irq 15 on atapci0

ohci0: <OHCI (generic) USB controller> mem 0xfeafc000-0xfeafcfff irq 9 at device

 15.2 on pci0

usb0: OHCI version 1.0, legacy support

usb0: <OHCI (generic) USB controller> on ohci0

usb0: USB revision 1.0

uhub0: (0x1166) OHCI root hub, class 9/0, rev 1.00/1.00, addr 1

uhub0: 2 ports with 2 removable, self powered

pcib1: <ServerWorks NB6635 3.0LE host to PCI bridge> at pcibus 1 on motherboard

pci1: <PCI bus> on pcib1

IOAPIC #1 intpin 11 -> irq 10

IOAPIC #1 intpin 9 -> irq 11

IOAPIC #1 intpin 10 -> irq 16

atapci1: <Promise PDC20268 UDMA100 controller> port 0xef90-0xef9f,0xefa8-0xefab,

0xefa0-0xefa7,0xefac-0xefaf,0xefe0-0xefe7 mem 0xfebfc000-0xfebfffff irq 10 at de

vice 2.0 on pci1

ata2: at 0xefe0 on atapci1

ata3: at 0xefa0 on atapci1

ahc0: <Adaptec aic7899 Ultra160 SCSI adapter> port 0xe400-0xe4ff mem 0xfebf6000-

0xfebf6fff irq 11 at device 6.0 on pci1

aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs

ahc1: <Adaptec aic7899 Ultra160 SCSI adapter> port 0xe800-0xe8ff mem 0xfebf7000-

0xfebf7fff irq 16 at device 6.1 on pci1

aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs

orm0: <Option ROMs> at iomem 0xcb800-0xcc7ff,0xca800-0xcb7ff,0xc8000-0xca7ff,0xc

0000-0xc7fff on isa0

atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0

atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0

kbd0 at atkbd0

psm0: <PS/2 Mouse> irq 12 on atkbdc0

psm0: model IntelliMouse, device ID 3

fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f

0-0x3f5 irq 6 drq 2 on isa0

fdc0: FIFO enabled, 8 bytes threshold

fd0: <1440-KB 3.5" drive> on fdc0 drive 0

ppc0: parallel port not found.

sc0: <System console> at flags 0x100 on isa0

sc0: VGA <16 virtual consoles, flags=0x300>

sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0

sio0: type 16550A

sio1 at port 0x2f8-0x2ff irq 3 on isa0

sio1: type 16550A

vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0

unknown: <PNP0303> can't assign resources (port)

unknown: <PNP0f13> can't assign resources (irq)

unknown: <PNP0501> can't assign resources (port)

unknown: <PNP0501> can't assign resources (port)

unknown: <PNP0700> can't assign resources (port)

APIC_IO: Testing 8254 interrupt delivery

APIC_IO: Broken MP table detected: 8254 is not connected to IOAPIC #0 intpin 2

APIC_IO: routing 8254 via 8259 and IOAPIC #0 intpin 0

Timecounters tick every 10.000 msec

ipfw2 initialized, divert enabled, rule-based forwarding enabled, default to acc

ept, logging disabled

IPsec: Initialized Security Association Processing.

ad4: 117800MB <IC35L120AVVA07-0> [239340/16/63] at ata2-master UDMA100

ad5: 117800MB <IC35L120AVVA07-0> [239340/16/63] at ata2-slave UDMA100

ad6: 117800MB <IC35L120AVVA07-0> [239340/16/63] at ata3-master UDMA100

ad7: 117800MB <IC35L120AVVA07-0> [239340/16/63] at ata3-slave UDMA100

acd0: CDROM <ATAPI-CD ROM-DRIVE-52MAX> at ata0-master PIO4

da0 at ahc0 bus 0 target 0 lun 0

da0: <MAXTOR ATLASU320_18_SCA B430> Fixed Direct Access SCSI-3 device

da0: 160.000MB/s transfers (80.000MHz, offset 127, 16bit), Tagged Queueing Enabl


da0: 17537MB (35916548 512 byte sectors: 255H 63S/T 2235C)

SMP: AP CPU #1 Launched!

Mounting root from ufs:/dev/da0s1a


From: Eduard Martinescu [mailto:martines@rochester.rr.com]
Sent: Sunday, December 07, 2003 9:55 PM
To: Robert Tran; smartmontools-support@lists.sourceforge.net
Subject: Re: [smartmontools-support]unable to check ATA devices




Can you send me a copy of your boot up messages? (via dmesg)?  I don't even think I need to see a verbose version.


I think I know what the problem might be, and I was afraid of running into this issue.  There is no easy way to map any given 'adx' device to

correct device/unit numbers. Actually, what happened to ad[0-3]?  Your first ATA hard drive is @ ad4?  Hopefully I will be able to work out

what is going on from the log.....




----- Original Message -----

From: Robert Tran

To: smartmontools-support@lists.sourceforge.net

Sent: Sunday, December 07, 2003 4:45 PM

Subject:[smartmontools-support]unable to check ATA devices


I am having trouble getting smartd and smartctl to see my ATA drives.

Here is the print out and my smartd.conf

All of the ATA drives are: 117800MB <IC35L120AVVA07-0> [239340/16/63] at atax-x UDMA100


RobBSDServer# df

Filesystem  1K-blocks      Used    Avail Capacity  Mounted on

/dev/da0s1a    253678     72744   160640    31%    /

devfs               1         1        0   100%    /dev

/dev/da0s1e    253678       108   233276     0%    /tmp

/dev/da0s1f  14610492   2508334 10933320    19%    /usr

/dev/da0s1d    253678     45416   187968    19%    /var

/dev/ad4s1c 118738616 100136224  9103304    92%    /drive1

/dev/ad5s1c 118738616  68841490 40398038    63%    /drive2

/dev/ad6s1c 118738616  95509832 13729696    87%    /drive3

/dev/ad7s1c 118738616  13966110 95273418    13%    /drive4

RobBSDServer# smartd -q onecheck

smartd version 5.22 Copyright (C) 2002-3 Bruce Allen

Home page is http://smartmontools.sourceforge.net/


Opened configuration file /usr/local/etc/smartd.conf

Drive: DEVICESCAN, implied '-a' Directive on line 1 of file /usr/local/etc/smartd.conf

Configuration file /usr/local/etc/smartd.conf was parsed, found DEVICESCAN, scanning devices

Device: ad4, Inappropriate ioctl for device, open() failed

Unable to register ATA device ad4 at line 1 of file /usr/local/etc/smartd.conf

Device: ad5, Inappropriate ioctl for device, open() failed

Unable to register ATA device ad5 at line 1 of file /usr/local/etc/smartd.conf

Device: ad6, Inappropriate ioctl for device, open() failed

Unable to register ATA device ad6 at line 1 of file /usr/local/etc/smartd.conf

Device: ad7, Inappropriate ioctl for device, open() failed

Unable to register ATA device ad7 at line 1 of file /usr/local/etc/smartd.conf

Device: da0, opened

Device: da0, is SMART capable. Adding to "monitor" list.

Monitoring 0 ATA and 1 SCSI devices

Device: da0, Acceptable asc,ascq: 0,0

Device: da0, initial Temperature is 43 degrees

Started with '-q onecheck' option. All devices sucessfully checked once.

smartd is exiting (exit status 0)







/dev/da0 -a

/dev/ad4 -a -d ata

/dev/ad5 -a -d ata

/dev/ad6 -a -d ata

/dev/ad7 -a -d ata
Eduard Martinescu <martines@rochester.rr.com>