WD(4)
π NAME β WD(4), aka wd π
okay so bestie, wd is the WD100x compatible hard disk driver β that's literally the whole main-character summary. π
π SYNOPSIS π
wd* at atabus? drive ? flags 0x0000
wd* at umass?
options WD_SOFTBADSECT
πΈ DESCRIPTION πΈ
The wd driver supports hard disks that emulate the Western Digital WD100x. That includes standard MFM, RLL, ESDI, IDE, EIDE, and SATA drives β yes, all of those, no cap. π¦
Okay so the flags are used only with controllers that support DMA operations and mode settings (like some pciide controllers). The lowest order nibble (rightmost digit) of the flags defines the PIO mode, the next four bits define the DMA mode and the third nibble defines the UltraDMA mode. For each set of four bits, the 3 lower bits define the mode to use and the last bit must be set to 1 for this setting to be used. For DMA and UDMA, 0xf (1111) means 'disable'. For example, a flags value of 0x0fac (1111 1010 1100) means 'use PIO mode 4, DMA mode 2, disable UltraDMA'. And 0x0000 means "use whatever the drive claims to support." β¨
The kernel configuration option options WD_SOFTBADSECT enables a software managed bad-sector list which will prevent further accesses to sectors where an unrecoverable read error occurred. A user interface is provided by dkctl(8). Unlike the (historical) mechanisms provided by bad144(8) and badsect(8), the software list supports neither sector replacement nor retention across reboots. π
π§ sysctl(8) variables that control behavior π§
The following sysctl(8) variables control behavior of disks attached using this driver:
hw.wdX.use_ncqβ whether to use NCQ ATA commands for the disk. Only effective when the disk hardware actually claims to support NCQ. Default totrue. πhw.wdX.use_ncq_prioβ use optional NCQ priority for high-priority I/O like meta-data. Intended only for experimental use right now, might negatively affect performance. This setting only has effect ifhw.wdX.use_ncqis alsotrue. Default tofalse. π
β NOTES β
Certain Seagate Barracuda drives sold around 2003 have a known firmware bug leading to corrupted write transfers for sector counts n*15 + 1, in combination with certain ATA controllers, most commonly Silicon Image 3xxx. Affected drives include, but are not limited to:
Seagate ST3120023AS
Seagate ST380023AS
Seagate ST360015AS
If you have one of these drives, it's recommended to replace the drive. There used to exist a driver workaround greatly reducing performance, but the code was completely removed in NetBSD 8.0. π
π SEE ALSO π
ata(4), intro(4), pciide(4), scsi(4), umass(4), wdc(4), atactl(8), dkctl(8) β go read those too, bestie, iykyk. π«Ά
π BUGS π
β οΈ heads up bestie: the optional software bad sector list does not interoperate well with sector remapping features of modern disks. To let the disk remap a sector internally, the software bad sector list must be flushed or disabled before.
π this page was served fresh by Debian on January 13, 2020 β periodt, go treat your disks right bestie π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 1994 James A. Jegers
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms