IDE/ATA Access ModesThe most common type of hard disk for PC hardware is the Integrated Drive Electronics (IDE) interface. The IDE interface is so named because the controller chips that manage the disk are integrated into the drive itself, rather than on a separate host adapter card (as with SCSI). The official name for this type of interface is Advanced Technology Attachment (ATA), and ATA and IDE are often used interchangeably. Note Serial ATA (SATA) hard drives are rapidly taking over from both IDE/ATA and SCSI drives in highperformance server installations. SATA drives are generally handled using the standard ATA kernel interface in FreeBSD, and you should be able to configure and access them using the same methods as described in this chapter for ATA drives. Bear in mind, though, that SATA is still a new and emerging technology, and support for it in FreeBSD remains spotty and poorly documented. If you have a choice, you might want to stay on ATA or SCSI drives until FreeBSD's support for SATA has developed a bit further. This chapter discusses both IDE/ATA and SCSI disk systems. Unless you're running a highperformance server, however, you are most likely to use IDE disks. They're inexpensive and ubiquitous, but they come with their share of annoyances and quirks. SCSI disks tend to be better made and faster, but they're also more expensive and require more expensive hardware. Regardless of whether you use IDE, however, it's worthwhile to cover these issues so you can be prepared if the need arises. IDE provides quite adequate speed, and it's the built-in standard on all x86-based motherboards currently on the market. If you're building a new machine from new hardware, you won't have to worry about any of the trivia in the next few sections. If, however, you're installing FreeBSD on older hardware, you will have to make a couple of purchasing decisions based on the highest access modes supported by the disk, the motherboard, and FreeBSD. An informed decision on this subject requires a bit of access-mode history. PIO ModesProgrammed I/O (PIO) modes were the original standard for data transfer on PC hardware using the ATA interface. To this day, these modes exist as a fallback method because PIO is a built-in part of the BIOS, and it requires no additional support by the operating system. Just about every modern operating system has moved on to DMA and Ultra DMA. Unless you're using very old hardware, you needn't concern yourself with PIO modes. PIO operated in any of five modes, with speeds ranging from 3.3MBps to 16.7MBpsunusably slow by the standards of today's demanding software. Note Most motherboards today use the PCI bus to talk to their hard drive chains. If, however, you've got a really old system with an ISA bus, the best it will be able to support is PIO Mode 2anything faster is beyond the throughput limit of ISA. DMA ModesA fundamental problem with PIO is that it requires significant resources from the CPU to direct its data flow. This problem used to be one of the biggest reasons to use SCSI rather than IDE disks because SCSI disks use an independent controller to take the load off the processor. Direct Memory Access (DMA) modes, introduced in the early 1990s, offer this same benefit to IDE disks by allowing the disk to bypass the CPU and communicate directly with the system RAM. DMA transfer modes require specialized electronics in the drive itself (particularly for first-party or "bus mastering" DMA disks) as well as operating system support, but this method is almost universal nowadays. You may not have heard much about plain DMA during its heyday; one reason is that its transfer speeds were comparable to those of the PIO modes. Although DMA disks did benefit from lower CPU overhead, this advantage was mitigated by poor support for the modes in the operating systems of the day, such as Windows 95. PIO was built in, so there was little pressure on the industry to move away from it. Ultra DMA (UDMA) ModesPIO truly lost prominence with the introduction of Ultra DMA. These enhanced DMA modes are now the ubiquitous industry standard, even giving SCSI a run for its money as far as performance goes, while remaining cheaper and better supported, even on low-end hardware. Ultra DMA gave data transfer speeds a significant and immediate boost over standard DMA by clocking its transfers on twice as many points in the interface strobe, on both the "rising" and "falling" edges of the signal waveform. This technique, known as double transition clocking, allowed the controller to have a "free" doubling of data transfer speed, to 33MBps, without reducing its cycle time. Subsequent incremental improvements to Ultra DMA, each one increasing the transfer speed until the culmination in Mode 6 of 133.3MBps, have raised the bar ever higher, aided by a new IDE cable standard that uses 80 pins rather than the 40 of the previous standard. Any hardware made after about 1998 is designed to work in UDMA mode, and you won't have to worry about a thing if you have these four components:
If you're missing any one of these items, your system will still run but in a reduced-speed mode, generally one of the PIO modes natively supported in the BIOS. Motherboards or controllers that don't support UDMA might prove troublesome. Issues with instability and lockups caused by controller issues can usually be solved either by upgrading the BIOS (to enable the controller to support UDMA) or by disabling UDMA in the disk itself through software utilities available from the manufacturer of the disk. These utilities typically run only under DOS or Windows and are either included with the disk or downloadable from the manufacturer's website. Note Because MS-DOS won't be available to you after installing FreeBSD, you can use FreeDOS (http://www.freedos.org), a free clone of MS-DOS, to run your DOS utilities. FreeBSD fully supports Ultra DMA, making it perhaps the strongest link in this chain; you can see whether all the necessary components are present by watching the device-probing messages during boot (or using dmesg afterwards): ad0: 238475MB <WDC WD2500JB-00KFA0 08.05J08> at ata0-master UDMA66 If the UDMA capability isn't detected and the hard disk is new but the rest of the machine's components aren't, you should find the disk manufacturer's drive management utility, boot the system from an MS-DOS floppy (or a FreeDOS boot disk), and use the utility to disable the disk's UDMA capability. This will keep you running at a lower speed than the disk can go, but it's for the best. The alternative is to run the risk of crashes and lockups. Your system will thank you for not pushing it beyond its means. |