Disk drives are complicated devices which can be used in a wide variety of applications. Since the perfect disk drive solution for one use may be totally different than it would be for another use it is important that the drive be configurable in as many ways as possible.
For example a disk drive used to store music being created live in a recording studio must be as physically quite as possible. On another hand a disk drive storing medical records must be as reliable as possible no matter how much noise it may make. The list goes on and on.
Needless to say, for every use a disk drive may be used in you can be sure that having as many ways of configuring that drives behavior is a good thing.
As a person working with disk drives we assume that the final responsibility for correctly determining which disk drive options are the best for every given situation may indeed rest upon your shoulders. It is the goal of this chapter to enable you to:
know what drive options are available and understand what they do
know how the disk drive is set up currently
know how to change the set up of the drive
As usual we will be using the STB Suite to teach this lesson and will be making many references to the ATA-8 documentation. If you have not yet downloaded the ATA-8 documentation please do so now – instructions as to how to do this are in part 1 of this tutorial.
Also we recommend that you use a “disposable” disk drive for doing the exercises in the tutorial – a disk drive which won’t be missed to sorely if it becomes damaged or unusable.
What can be changed? Introduction to the SATA Feature Sets
Part of your job working with disk drives is to be the expert in your company that knows everything about disk drives. To become that disk expert you must first learn what configurations or settings are available on a disk drive, whether they can be changed or not, and finally how to change them as needed.
A good place to start to learn about SATA drive configuration is the area known as “feature sets”. The specification for SATA feature sets is described in the ATA-8 document, all of section 4. There are currently 25 separate feature sets defined, some of which are applicable to disk drive work and others that don’t directly apply to disk drives. We will dig in and detail a few of these feature sets, with the hope that through a few digs you will become comfortable with the way features and feature sets are described and will then be able to do your own digging to find the details that perfectly suit your needs.
Feature Sets and Features
Feature sets are made up of one or more features. Some features are things that are changeable while others are not. For instance in the General Feature Set you will find the feature IDENTIFY device. This simply tells us that a drive that supports the general feature set will be able to complete an IDENTIFY command. Nothing about the IDENTIFY can be changed, it is just telling you that the IDENTIFY command is a feature of the general feature set.
On the other hand, the Advanced Acoustic Management Feature set does have features which can be changed.
As you read through the specification section on feature sets and then later on specific commands you will come to learn what features can be changed and what can’t.
Here is a list of the available Feature Sets –
How is my disk configured right now?
We used the SATA IDENTIFY command as our main example command in the first lesson and we will be using it again now. That is because the IDENTIFY command is the way that 99% of the drive’s configuration will be reported.
If you have worked with SCSI/SAS/Fibre Channel drives in the past you can think of the IDENTIFY command as having the same functionality as the SCSI MODE SENSE command. That is, the IDENTIFY command will report settings, but not change settings.
However, unlike the nice organization of SCSI MODE Pages, the SATA IDENTIFY information is basically free-form. As the specification evolves new items are simply tacked on to the end of the older info.
Here is one example, the fairly common question of “is write cache turned on on this drive?”.
Look at the specification describing word 85 of the IDENTIFY data
Information about Write cache is there, but so is information about a lot of other items.
All of this is to say that you may need to change your searching methods to take into account that the information you are looking for may be spread throughout the document and/or mixed in with other different information.
Alright then, use the IDENTIFY command to determine how your drive is presently configured, and then for the most part use the SET FEATURES command to change how your drive is configured.
Have a look at section 7.48 of your ATA-8 document, where the SET FEATURES command is described. You will see that this command is a “No Data” type of command, that is there will not be a data phase associated with the command. Since we are using the SAT method of issuing these commands to the drive it is very important that you define your SAT command to have the exact-correct data-type definition. Set Features = no data.
The particular Feature, and whether you are setting it or resetting it, is defined by the Set Features Features feature field definition byte – the Feature, Count, and LBA bytes of the command.
Here are the list of features which can be set/reset:
Continuing our example of setting the drives Write Cache on or off, to turn Write Cache ON you would issue a SET FEATURES command with the value of 0x02 – Enable Volitle Write Cache – in the FEATURE field.
To turn Write Cache off you would issue the SET FEATURES command with the value of 0x82 – Disable Volitile Write Cache in the FEATURE field.
Playing with Write Cache for real
We will finish this lesson by actually changing the Write Cache settings of our test drive. Once again we will use the STB Suite Original mode User Defined CDB to issue our commands. If the following doesn’t make sense to you please re-read the first installment of this lesson.
First, determine if Write Cache is enabled or not. Issue an IDENTIFY command and examine word 85, bit position 5 (byte 0xAA):
We see that byte 0xAA – which is IDENTIFY word 85 has a value of 0x49.
As you can see, bit position 5 is NOT set – therefore we know that Volatile Write Cache is NOT enabled.
Now let’s issue a SET FEATURES command, and set the FEATURE field value to 0x02 – Enable Volatile Write Cache –
Issue another IDENTIFY command and again examine byte 0xAA –
Now we have a value of 0x69 – which means…drum roll please…
bit position 5 is set – Volatile Write cache is enabled!
Wasn’t that easy? Sure it was, and now you are one step further down the path of mastering SATA commands!
We’ve looked at a few Feature Sets, examined a few Features which can be set, and manually set the Enable Volatile Write Cache Feature.
FYI – the STB Suite gives you a much easier method of doing what we’ve just done. But learning the bare-metal way is always the best way to start.
If you start the STB Suite in Original mode, then choose the top-menu choice ATA/SATA->Commands->View & Set Features , then select your drive you will see:
Much easier to see what is set and also change settings!
This STB Suite feature only works on one drive at a time.
In order to change Features on many drives at once we provide a DMM Add-on program called “DMMSetFeatures.exe” Contact Sales to request this add-on.
This program is accessed via the DMM External Program test step, and it allows you to specify:
A) the feature, and B) the Count (if any). When DMM gets to this step in your test sequence it will issue the command to Set Feature on whatever feature you have specified, to all drives under test. BTW, the Count field is used when a feature has a value instead of a simple on/off.
For example, Advanced Acoustic Management lets you specify a value of acoustic management which will let you compromise performance versus noise level.
Take the time to explore the ATA-8 document sections on the SET FEATURE command and also on the various Feature Sets. In our next installment we will look at SATA FEATURE SETs in greater detail.