Write Cache Enable

Top  Previous  Next

The -wce command was added to facilitate one of the most common mode page changes. This enables the write cache on the disk drive.  (The command is generally not applicable to anything but disk drives. However, you could theoretically have a device that is not a disk drive that uses a write cache).  Conversely, use the -wcd command to disable the write cache.

 

(The write cache bit is located on mode page #8, byte #2, bit #2.  If that bit is set, the cache is enabled.  Note that only one byte is different in the commands below.

Example(s)

 

[root@BOSS etc]# ./smartmon-ux -wce /dev/sg2

SMARTMon-ux [Release 1.28, Build 01-APR-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered SEAGATE ST373307LC S/N "3HZ03822" on /dev/sg2 (SMART enabled)(70007 MB)

 Sending command:  -B S,08,12,14,00,FF,FF,00,00,FF,FF,FF,FF,00,20,00,00,00,00,00,00

          Result: (SUCCESS) - The write cache is now enabled

 

 

Program Ended.

 

[root@BOSS etc]# ./smartmon-ux -wcd /dev/sg2

SMARTMon-ux [Release 1.28, Build 01-APR-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered SEAGATE ST373307LC S/N "3HZ03822" on /dev/sg2 (SMART enabled)(70007 MB)

 Sending command:  -B S,08,12,10,00,FF,FF,00,00,FF,FF,FF,FF,00,20,00,00,00,00,00,00

          Result: (SUCCESS) - The write cache is now disabled

 

 

Program Ended.

 

[root@BOSS etc]# ./smartmon-ux -wcd /dev/sg2

SMARTMon-ux [Release 1.28, Build 01-APR-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered SEAGATE ST373307LC S/N "3HZ03822" on /dev/sg2 (SMART enabled)(70007 MB)

 Sending command:  -B S,08,12,10,00,FF,FF,00,00,FF,FF,FF,FF,00,20,00,00,00,00,00,00

          Result: (SUCCESS) - The write cache was already disabled.

 

Program Ended.

 

Finally, a warning .. the write cache is typically disabled for a reason.  When the cache is disabled, the disk does not return a complete code to the host until the disk has physically recorded the block(s).  When write cache is enabled, the disk immediately responds to the host telling it the I/O has been completed. This can significantly improve write performance.

 

You have a risk in that when you use a write cache, a power loss will result in permanent data loss of any writes that have occurred between the time the disk last flushed the pending writes to the disk drive and the power failure.  The amount of time it takes between flushing is typically a few seconds, but this value is vendor/product/device specific.

 

You may also use the mode page editor to control the write cache.  The -wce was introduced because enabling / disabling the write cache is a common activity performed by system administrators.