Category Archives: disk

Device enumeration in FreeBSD

One of the FreeBSD boxes I was working with came up with ad8 as its disk device. After reading around a bit and talking to a few FreeBSD devs, here is my findings of where did that number “8″ come from:

On Intel PCH2 6 Port SATA controller, disk was attached to 3rd port i.e. port #2. (That can also be checked from the BIOS settings.)

Now, ATA stack reserves two device numbers (master/slave) per ATA channel. But, first two channels are reserved for legacy (ISA emulation) mode – PATA. That means, ad0 to ad3 are reserved.

So, if a disk is attached to port #0 master, it comes up as ad4. In this particular case, because the disk was attached to port #2 master, it came up as ad8.

vfs.hirunningspace and disk write latency performance

A while ago I increased the default value for the vfs.hirunningspace tunable - which greatly helps with performance when the disk system supports tagged queueing (e.g. NCQ), allowing many more requests to be offloaded into the controller and/or the drive(s). But deep queues bring their own problems, especially in pathological cases.