Re: USB drives and cache mode page



Darin Johnson wrote:
Jeff Jonas wrote:
Eric Gisin <gi...@xxxxxxxxxxxx> wrote:

There are no advanced SCSI-2 features in USB flash drives.

This isn't a flash drive. It's an IDE drive with a USB to IDE
adapter case around it. IDE drives do have caching and the
ability to turn it on and off.

If the USB converter in the case really provides no control command for
the cache to the host it is IMHO likely that it don't touch the cache
setting of the drive at all. In this case it should be possible to
remove the IDE drive from the case and disable the cache with native ATA
commands (only make sense if the drive can store the cache setup in a
nonvolatile memory).

The one part that has been discontinued used a Cypress
controller, and it had a vendor specific configuration setting
to enable mode page 8 (disabled by default). That bit comes
with the comment "if enabled, Windows will disable write
caching by default which will limit performance." That seems
to imply that they think not allowing the OS to turn off caching
is a good thing...

Low end hardware must be PnP, cheap and fast. Other features seems not
really relevant for marketing today.

[...]
The solution so far seems to be "software delays awhile before
killing power" without any hard and fast number to use for "awhile".
But that still doesn't account for the case where the customer
accidentally kicks out the power cord.

The next step I guess is to try using the FUA bit on all the writes.

For SBC devices in general even if no mode pages are implemented (or if
they are disabled) the MODE SENSE command should be implemented if they
use removable media or if the DPO & FUA bits are supported for
READ/WRITE. The DEVICE-SPECIFIC PARAMETER byte of the parameter header
contains the Bit DPOFUA for SBC devices. This Bit indicates if the DPO
and FUA Bits in READ/WRITE commands are supported.

Note:
The USB/ATA converter must not implement a SBC device (SCSI peripheral
device type 00h, USB subclass code 06h). For a harddisk USB also allow
to implement the SCSI RBC command set (SCSI peripheral device type 0Eh,
USB subclass 01h). DPO and FUA Bits don't exist in the READ(10) and
WRITE(10) commands defined by RBC, not even as an option. But the MODE
SENSE(6) command and mode page 06h are mandatory for RBC devices.
Finally the SYNCHRONIZE CACHE command is mandatory neither for SBC nor
for RBC.

Result:
There is no mandatory feature for cache control that must be present in
every USB mass storage harddisk device. Your USB/ATA converter should
support at least one of the following optional SCSI features:
- SYNCHRONIZE CACHE command
- Mode page 08h using SBC command set
- Mode page 06h using RBC command set
- WRITE(10) command with FUA using SBC command set
Every option allows the host to disable or bypass the write cache. If
none of this features is implemented in your converter, you should
consider to replace it with a better one (if the cache cannot be
permanently disabled directly at the drive).


Micha
.



Relevant Pages

  • Re: RSFC Komputer Korner: Help Needed
    ... into a USB external 2.5" HD enclosure ... One of the problems in not knowing what you are doing is buying an USB hard drive, a cheap one, that has no cache. ... Drives have have hardware caches to try to speed up througput and Windows uses a large part of your physical memory as a cache for programs and data. ... There is a lot that goes in to caching algorithms, trying to determine what will be fetched next, how much to fetch, how to keep the cache current, but their presence doesn't effect physical transfer characteristics, it just helps avoid having to repeat a process that has already been previously done. ...
    (rec.sport.football.college)
  • Re: RSFC Komputer Korner: Help Needed
    ... into a USB external 2.5" HD enclosure ... I have USB 2.0 hard drives that transfer slower than ... hard drive, a cheap one, that has no cache. ...
    (rec.sport.football.college)
  • Re: RSFC Komputer Korner: Help Needed
    ... into a USB external 2.5" HD enclosure ... I have USB 2.0 hard drives that transfer slower than ... One of the problems in not knowing what you are doing is buying an USB hard drive, a cheap one, that has no cache. ... Drives have have hardware caches to try to speed up througput and Windows uses a large part of your physical memory as a cache for programs and data. ...
    (rec.sport.football.college)
  • Re: Linux 2.6.6 "IDE cache-flush at shutdown fixes"
    ... >If this is indeed the case, that those drives don't support the "flush write ... >cache" command, I'd like to see Maxtor's excuse as to why.. ... the FLUSH CACHE EXT command. ...
    (Linux-Kernel)
  • Format USB drive
    ... I have a VB6 application that needs to be able to move files on to USB stick ... drives as fast and as efficiently as possible with as little user input as ... have found that fastest way to insure the disk is empty is to simply format ... Shell to the Command processor and run a format command there. ...
    (microsoft.public.vb.general.discussion)