How to change between the Write-through Cache and Write-Back Cache on Storage?

Solution In Progress - Updated -

Issue

  • How to change/switch between the Write-through Cache and Write-Back Cache on the storage end?
  • To perform a disk benchmark through a virtual machine it is recommended to disable virtual disk write-cache.
  • What are the different methods of changing the on-disk write cache settings?
  • Which versions of RHEL support hdparm use?
  • Which versions of RHEL support sdparm use?
  • What are the alternatives to sdparm or hdparm use for changing write cache setting on a block device?
  • Why does sdparm work but hdparm fail to report or change write cache setting on a block device?
  • How to ensure written data integrity to a block device?
  • How do I ensure that data is securely and reliably written to disk?
  • What is meant by enabling 'Fast Writes' to improve io write performance?
  • How to enable/disable caching for block device.
  • When editing a file on block device the write operation will not take place immediately because of caching is enabled.
  • When discovering the LUN, the linux kernel enables "write-through" for the AMS1000 and "write-back" for the AMS2300.

    • The "write-through" gives poor performances in this situation. How can I force linux to enable the "write back" feature ?

      Feb 14 11:29:56 kernel:   Vendor: HITACHI   Model: DF600F            Rev: 0000
      Feb 14 11:29:56 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 03
      Feb 14 11:29:56 kernel: SCSI device sda: 122159104 512-byte hdwr sectors (62545 MB)
      Feb 14 11:29:56 kernel: sda: Write Protect is off
      Feb 14 11:29:56 kernel: SCSI device sda: drive cache: write through ( ====> AMS 1000 <=======)
      Feb 14 11:29:56 kernel:  sda: sda1
      Feb 14 11:29:56 kernel: sd 0:0:0:0: Attached scsi disk sda
      
      Feb 14 11:29:56 kernel:   Vendor: HITACHI   Model: DF600F            Rev: 0000
      Feb 14 11:29:56 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
      Feb 14 11:29:56 kernel: SCSI device sdb: 2097152 512-byte hdwr sectors (1074 MB)
      Feb 14 11:29:56 kernel: sdb: Write Protect is off
      Feb 14 11:29:56 kernel: SCSI device sdb: drive cache: write back (=======> AMS 2300 <============)
      Feb 14 11:29:56 kernel:  sdb: sdb1
      Feb 14 11:29:56 kernel: sd 0:0:1:1: Attached scsi disk sdb
      

Environment

  • Red Hat Enterprise Linux (RHEL) all versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content