Discussion:
[Bug 202712] [cam] [ata] System doesn't recognize older hdd after boot
(too old to reply)
b***@freebsd.org
2019-04-23 15:49:59 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

Andriy Gapon <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|***@FreeBSD.org |***@FreeBSD.org
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-23 17:37:45 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #22 from Domagoj Hranjec <***@yahoo.com> ---
Created attachment 203938
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=203938&action=edit
dmesg log with 8.4 livefs disk #2

Fixit# dd if=/dev/ad3 of=/dev/zero
830760+0 records in
830760+0 records out
425349120 bytes transferred in 565.629644 secs (751992 bytes/sec)

I've now read the whole ad3 disk. The read was successful and no errors of any
kind were noticed.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-23 22:45:30 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #23 from Steven Hartland <***@FreeBSD.org> ---
As a workaround have you tried setting the tunable:
hw.ata.ata_dma=0

This should force PIO mode, that disk however should support mode Multi DMA
mode 1 according to the specs I found.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-23 23:52:16 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #24 from Steven Hartland <***@FreeBSD.org> ---
Another sysctl you can try to see if you can get any further is:
kern.geom.notaste=1

This should prevent geom from tasting the disk which is more than likely what
is responsible for the read requests your seeing fail.

If that does get further you could try manually reading the first and last
sectors from the disk with dd.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 06:16:09 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #25 from Andriy Gapon <***@FreeBSD.org> ---
(In reply to Domagoj Hranjec from comment #22)
Thank you!
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 06:17:19 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #26 from Andriy Gapon <***@FreeBSD.org> ---
(In reply to Steven Hartland from comment #24)
Yeah, I suggested this in comment #15.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 17:46:20 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #27 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Steven Hartland from comment #23)

Put hw.ata.ata_dma=0 to /etc/sysctl.conf.
Nothing changed.

Also, seems that this parameter does not exist:

***@spitfire:/home/hark # sysctl hw.ata.ada_dma
sysctl: unknown oid 'hw.ata.ada_dma'
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 17:59:23 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #28 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Steven Hartland from comment #24)
Added kern.geom.notaste=1 to /etc/sysctl.conf.

Parameter is changed:
***@spitfire:/home/hark # sysctl kern.geom.notaste
kern.geom.notaste: 1

However, same issues:
...
(ada1:ata1:0:1:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 04 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 04 00
(ada1:ata1:0:1:0): Retrying command
(ada1:ata1:0:1:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 04 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 04 00
(ada1:ata1:0:1:0): Retrying command
...

Disk cannot be accessed.

***@spitfire:/home/hark # dd if=/dev/ada1 of=/dev/zero
dd: /dev/ada1: Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 0.011820 secs (0 bytes/sec)

***@spitfire:/home/hark # fdisk /dev/ada1
fdisk: could not detect sector size
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 22:02:27 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #29 from Andriy Gapon <***@FreeBSD.org> ---
(In reply to Domagoj Hranjec from comment #22)
I think that Bruce Evans is right, the older stack seems to use CHS addressing
in ATA commands that it sends down to the disk. Linux reports the disk as being
"ATA-0" where zero is the major ATA version.
And the new stack is missing this code:
http://fxr.watson.org/fxr/source/dev/ata/ata-disk.c?v=FREEBSD-8-STABLE#L442
and any support for CHS addressing.

I am not sure if it is worth resurrecting that old functionality to support
very old disks.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 22:05:08 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #30 from Andriy Gapon <***@FreeBSD.org> ---
(In reply to Domagoj Hranjec from comment #27)
Actually that parameter should have gone to /boot/loader.conf as it is a pure
tunable, not a sysctl and without an accompanying sysctl.
But I doubt that it would help. Still worth trying.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-24 23:36:29 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #31 from Steven Hartland <***@FreeBSD.org> ---
(In reply to Domagoj Hranjec from comment #28)
The setting would need to be done as a tunable i.e. loader.conf to be active
early enough in the boot process to avoid the geom taste.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-27 16:03:29 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #32 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Andriy Gapon from comment #30)

Put hw.ata.ata_dma=0 to /boot/loader.conf.
Disks are now in PIO mode:

ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <ST340014A 8.01> ATA-6 device
ada0: Serial Number 5JXDHA76
ada0: 16.700MB/s transfers (PIO4, PIO 8192bytes)
ada0: 38166MB (78165360 512 byte sectors)
ada1 at ata1 bus 0 scbus1 target 1 lun 0
ada1: <WDC AC2420F 06.16K25> ATA device
ada1: Serial Number WD-WM2680354231
ada1: 11.100MB/s transfers (PIO3, PIO 8192bytes)
ada1: 405MB (830760 512 byte sectors)

However, same errors appear and ada1 stays non functional:

(ada1:ata1:0:1:0): READ_MUL. ACB: c4 00 00 00 00 40 00 00 00 00 01 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 01 00
(ada1:ata1:0:1:0): Retrying command
(ada1:ata1:0:1:0): READ_MUL. ACB: c4 00 00 00 00 40 00 00 00 00 01 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 01 00
(ada1:ata1:0:1:0): Error 5, Retries exhausted

***@spitfire:/home/hark # fdisk /dev/ada1
fdisk: could not detect sector size
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-27 16:14:08 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #33 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Steven Hartland from comment #31)

Put kern.geom.notaste=1 to /boot/loader.conf.

Same issues, device stays non funtional:
(ada1:ata1:0:1:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 01 00
(ada1:ata1:0:1:0): Retrying command
(ada1:ata1:0:1:0): READ_DMA. ACB: c8 00 00 00 00 40 00 00 00 00 01 00
(ada1:ata1:0:1:0): CAM status: ATA Status Error
(ada1:ata1:0:1:0): ATA status: 59 (DRDY SERV DRQ ERR), error: 10 (IDNF )
(ada1:ata1:0:1:0): RES: 59 10 00 00 00 00 00 00 00 01 00
(ada1:ata1:0:1:0): Error 5, Retries exhausted

***@spitfire:/home/hark # fdisk /dev/ada1
fdisk: could not detect sector size
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-27 16:15:45 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #34 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Andriy Gapon from comment #29)

It seems to me that it is the right way to go. CHS addressing needs to be
re-implemented in the ATA_CAM.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-04-27 20:20:50 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #35 from Steven Hartland <***@FreeBSD.org> ---
Does your BIOS have the option to put the disk into LBA mode, if so that may
help.

If the disk truly does support LBA then the only maybe to stay with an old
version as I don’t think readding CHS support would be worth it.
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2019-04-27 20:42:27 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #36 from Steven Hartland <***@FreeBSD.org> ---
That should have said doesn’t support LBA
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2019-04-28 22:28:25 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #37 from Domagoj Hranjec <***@yahoo.com> ---
(In reply to Steven Hartland from comment #35)

BIOS supports LBA, however, the disk does not. I've tried to force it through
BIOS but it doesn't work.

Regarding CHS, Linux supports it to this day and FreeBSD supported it for 20
years. It doesn't seem unreasonable to support the old disks with the modern
kernel. And judging by the old implementation it doesn't seem like a big
feature in terms of lines of code.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-05-22 21:57:37 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

--- Comment #38 from Domagoj Hranjec <***@yahoo.com> ---
Maybe if someone can clarify.. Is currently the code in sys/dev/ata directory
used for ata access or is it only dead remnants of the old implementation and
all the ata code is in sys/cam/ata directory?
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
b***@freebsd.org
2019-05-23 06:34:23 UTC
Permalink
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712

Scott Long <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@FreeBSD.org

--- Comment #39 from Scott Long <***@FreeBSD.org> ---
The code in sys/cam/ata is generic protocol and transport support for all
devices. The code in sys/dev/ata is controller-specific drivers. In simple
terms, adding CHS support would happen in sys/cam/ata.

I have mixed feelings on adding CHS support. As others have mentioned, it's
ancient, and it's nearly impossible for people to test. It would exist as a
poorly tested codepath that would be prone to accidental breakage. The cost of
keeping it working, in terms of equipment procurement and operation, would
likely outweigh the benefit.

It looks like Amazon has a PCIe add-in card for ATA/IDE, but I haven't owned a
working ATA drive in almost 10 years, and I probably haven't owned a functional
CHS-only drive in at least 20 years. I have no idea where I'd get one, other
than to buy batches of them off of Ebay and hope to find some that work. 20+
years is a long time for a hard drive, even in the best of circumstances.
Moisture will invade the platter cavity through the breather hole. Lubrication
will slowly evaporate off of spindle and armature joints and redeposit itself
onto the platters and heads. Capacitors on the circuit board will slowly leak,
and copper and aluminum connectors and traces will corrode. I'm impressed that
you have a working 400MiB drive, that's a 25 year old drive at this point. I'd
worry that it would stop working in the near future.

If I were to build a rig to operate a CHS-era IDE drive (or any ATA/IDE drive
for that matter), it would be solely to recover and archive the drive data to
modern storage. For that, I'd use software that supported the use-case. If
that means using an older version of FreeBSD, or using Linux, I'd do that.
It's such a niche use case that I'd spend considerably more time resurrecting
and testing CHS code than I'd spend actually recovering the data, and that's
just not an interesting use of my time.

If there's community interest in supporting CHS long-term in FreeBSD, my
recommendation is to create a IDE-CHS specific transport in CAM that lives
alongside the ATA/SATA support, but does not rely on it. This probably means
copying sys/cam/ata/ata_xpt.c to sys/cam/ata/ide_xpt.c, removing the
SATA-specific logic in it, and adding in the IDE and CHS specific logic. Nice,
clean, and isolated so that it's less likely to be accidentally broken, and
people working on SATA aren't likely to trip on it. This would probably be a
week of work at most, assuming that test hardware is available.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-***@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-scsi
To unsubscribe, send any mail to "freebsd-scsi-***@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Patrick Powell
2019-05-23 15:43:47 UTC
Permalink
I appreciate the desire for legacy support,  but re-adding (sp?) CHS
support seems to be a bit silly.  I tossed the last CHS drives in 2018
and they had not been powered up since 1999.

If you are REALLY desperate for data recovery,  then a Data Recovery
outfit can do a sector by sector copy of the old CHS drive to a newer
drive, or even a memory stick.  You do not even need to have a
functioning drive.  Of course it may be a bit expensive...  but if you
need the data, cost may be irrelevant.
Post by b***@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202712
What |Removed |Added
----------------------------------------------------------------------------
The code in sys/cam/ata is generic protocol and transport support for all
devices. The code in sys/dev/ata is controller-specific drivers. In simple
terms, adding CHS support would happen in sys/cam/ata.
I have mixed feelings on adding CHS support. As others have mentioned, it's
ancient, and it's nearly impossible for people to test. It would exist as a
poorly tested codepath that would be prone to accidental breakage. The cost of
keeping it working, in terms of equipment procurement and operation, would
likely outweigh the benefit.
It looks like Amazon has a PCIe add-in card for ATA/IDE, but I haven't owned a
working ATA drive in almost 10 years, and I probably haven't owned a functional
CHS-only drive in at least 20 years. I have no idea where I'd get one, other
than to buy batches of them off of Ebay and hope to find some that work. 20+
years is a long time for a hard drive, even in the best of circumstances.
Moisture will invade the platter cavity through the breather hole. Lubrication
will slowly evaporate off of spindle and armature joints and redeposit itself
onto the platters and heads. Capacitors on the circuit board will slowly leak,
and copper and aluminum connectors and traces will corrode. I'm impressed that
you have a working 400MiB drive, that's a 25 year old drive at this point. I'd
worry that it would stop working in the near future.
If I were to build a rig to operate a CHS-era IDE drive (or any ATA/IDE drive
for that matter), it would be solely to recover and archive the drive data to
modern storage. For that, I'd use software that supported the use-case. If
that means using an older version of FreeBSD, or using Linux, I'd do that.
It's such a niche use case that I'd spend considerably more time resurrecting
and testing CHS code than I'd spend actually recovering the data, and that's
just not an interesting use of my time.
If there's community interest in supporting CHS long-term in FreeBSD, my
recommendation is to create a IDE-CHS specific transport in CAM that lives
alongside the ATA/SATA support, but does not rely on it. This probably means
copying sys/cam/ata/ata_xpt.c to sys/cam/ata/ide_xpt.c, removing the
SATA-specific logic in it, and adding in the IDE and CHS specific logic. Nice,
clean, and isolated so that it's less likely to be accidentally broken, and
people working on SATA aren't likely to trip on it. This would probably be a
week of work at most, assuming that test hardware is available.
--
Patrick Powell Astart Technologies
***@astart.com 1509 Hollow Ct.,
Network and System San Diego, CA 92019
Consulting Cell 858-518-7581 FAX 858-751-2435
Web: papowell at astart dot com
Loading...