External HD: No Caching mode page found (Western Digital My Book 1140)

Asked by Njorl on 2020-10-22

I’m getting “No Caching mode page found / Assuming drive cache: write through”, in dmesg, when I connect a particular external hard drive.

A drive without a cache seems unusual, and hdparm suggests there is one:
 Enabled Supported:
    * SMART feature set
      Security Mode feature set
    * Power Management feature set
    * Write cache

I fear letting the O/S believe there’s no write cache to flush is a very bad idea, and will cause data loss, sooner or later (probably sooner).

It may just be a fault in this particular unit (a Western Digital My Book 1140), as I’ve found nothing with a Google search.

Please advise the best thing I can do (short of buying a new hard drive).

Below is the relevant (I hope) technical stuff.

[ 240.607283] usb 1-3: new high-speed USB device number 4 using xhci_hcd
[ 240.756305] usb 1-3: New USB device found, idVendor=1058, idProduct=1140, bcdDevice=10.25
[ 240.756307] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[ 240.756308] usb 1-3: Product: My Book 1140
[ 240.756309] usb 1-3: Manufacturer: Western Digital
[ 240.756310] usb 1-3: SerialNumber: xxxxxxxxxxxxxxxxxxxxxxxx
[ 240.785397] usb-storage 1-3:1.0: USB Mass Storage device detected
[ 240.787935] scsi host2: usb-storage 1-3:1.0
[ 240.788642] usbcore: registered new interface driver usb-storage
[ 240.790854] usbcore: registered new interface driver uas
[ 241.819981] scsi 2:0:0:0: Direct-Access WD My Book 1140 1025 PQ: 0 ANSI: 6
[ 241.820216] scsi 2:0:0:1: Enclosure WD SES Device 1025 PQ: 0 ANSI: 6
[ 241.821025] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 241.821183] scsi 2:0:0:1: Attached scsi generic sg2 type 13
[ 241.824960] sd 2:0:0:0: [sdb] Spinning up disk...
[ 242.843248] .
[ 249.844693] scsi 2:0:0:1: Failed to get diagnostic page 0x1
[ 249.844698] scsi 2:0:0:1: Failed to bind enclosure -19
[ 250.875128] .......ready
[ 257.019718] sd 2:0:0:0: [sdb] 732558336 4096-byte logical blocks: (3.00 TB/2.73 TiB)
[ 257.020145] sd 2:0:0:0: [sdb] Write Protect is off
[ 257.020147] sd 2:0:0:0: [sdb] Mode Sense: 47 00 10 08
[ 257.020406] sd 2:0:0:0: [sdb] No Caching mode page found
[ 257.020409] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 257.091033] sdb: sdb1 sdb2
[ 257.091979] sd 2:0:0:0: [sdb] Attached SCSI disk
[ 257.092020] ses 2:0:0:1: Attached Enclosure device

sudo hdparm -I /dev/sdb
/dev/sdb:

ATA device, with non-removable media
 Model Number: WDC WD30EZRX-00MMMB0
 Serial Number: WD-WCAWZxxxxxxx
 Firmware Revision: 80.00A80
 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
 Supported: 8 7 6 5
 Likely used: 8
Configuration:
 Logical max current
 cylinders 16383 16383
 heads 16 16
 sectors/track 63 63
 --
 CHS current addressable sectors: 16514064
 LBA user addressable sectors: 268435455
 LBA48 user addressable sectors: 5860533168
 Logical Sector size: 512 bytes
 Physical Sector size: 4096 bytes
 Logical Sector-0 offset: 0 bytes
 device size with M = 1024*1024: 2861588 MBytes
 device size with M = 1000*1000: 3000592 MBytes (3000 GB)
 cache/buffer size = unknown
Capabilities:
 LBA, IORDY(can be disabled)
 Queue depth: 32
 Standby timer values: spec'd by Standard, with device specific minimum
 R/W multiple sector transfer: Max = 16 Current = 0
 DMA: *mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 udma6
      Cycle time: min=120ns recommended=120ns
 PIO: pio0 pio1 pio2 pio3 pio4
      Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
 Enabled Supported:
    * SMART feature set
      Security Mode feature set
    * Power Management feature set
    * Write cache
    * Look-ahead
    * Host Protected Area feature set
    * WRITE_BUFFER command
    * READ_BUFFER command
    * NOP cmd
    * DOWNLOAD_MICROCODE
      Power-Up In Standby feature set
    * SET_FEATURES required to spinup after power up
      SET_MAX security extension
    * 48-bit Address feature set
    * Device Configuration Overlay feature set
    * Mandatory FLUSH_CACHE
    * FLUSH_CACHE_EXT
    * SMART error logging
    * SMART self-test
    * General Purpose Logging feature set
    * 64-bit World wide name
    * {READ,WRITE}_DMA_EXT_GPL commands
    * Segmented DOWNLOAD_MICROCODE
    * Gen1 signaling speed (1.5Gb/s)
    * Gen2 signaling speed (3.0Gb/s)
    * Gen3 signaling speed (6.0Gb/s)
    * Native Command Queueing (NCQ)
    * Host-initiated interface power management
    * Phy event counters
    * NCQ priority information
      DMA Setup Auto-Activate optimization
    * Software settings preservation
    * SMART Command Transport (SCT) feature set
    * SCT Write Same (AC2)
    * SCT Features Control (AC4)
    * SCT Data Tables (AC5)
      unknown 206[12] (vendor specific)
      unknown 206[13] (vendor specific)
Security:
 Master password revision code = 65534
  supported
 not enabled
 not locked
 not frozen
 not expired: security count
  supported: enhanced erase
 more than 508min for SECURITY ERASE UNIT. more than 508min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: xxxxxxxxxxxxxxxx
 NAA : 5
 IEEE OUI : 0014ee
 Unique ID : xxxxxxxxx
Checksum: correct

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2020-11-07
Last reply:
3 hours ago
Manfred Hampl (m-hampl) said : #1

For diagnostic purposes please add the output of the commands

uname -a
lsb_release -crid

Njorl (usingcoconuts) said : #2

Thank you. Sorry to have been insufficient in the first instance.

$ uname -a
Linux HP250G5-002-Linux 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Launchpad Janitor (janitor) said : #3

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Njorl (usingcoconuts) said : #4

"This question was expired because it remained in the 'Needs information' state without activity for the last 15 days."

I guess I must have neglected to toggle some status field, when I responded to the RFI.

Manfred Hampl (m-hampl) said : #5

No, you have made everything correct with your answer, but it seems that on "our" side nobody knows any further.

I do not understand why you expect this to cause data loss. In my opinion the kernel does not trust the capabilities of the disk (or to be exact cannot identify them) and so switches to write-trough mode, which should be safe.

see e.g. https://askubuntu.com/a/36979

Njorl (usingcoconuts) said : #6

Thank you.

My interpretation differs, but I’d prefer for yours to be correct.

The item you linked says, “the firmware and driver doesn't report whether the controller is in ‘write-through’ mode or ‘write-back’ [AKA ‘write-behind’] mode. Without this information, the block layer assumes ‘write-through’. This is safe, because the controller has a battery-backed cache”. The conclusion of safety rests, solely, it seems to me, on the cache being protected against power cuts (and, one has to presume, the battery also being capable to sustain completion of the write-out to the disc). The dmesg excerpt I gave indicates I am in the same peril: “Assuming drive cache: write through”. The kernel is not operating in, or achieving, a write-through mode; it is proceeding under the incorrect assumption that the external HD is in write-through mode, and hence, I fear, will not schedule explicit sync commands to the device.

Is there any mount option I can specify to force the kernel to make the opposite assumption, i.e. that the external HD is in ‘write-back’ mode, please?

asfaaw3 (asgaw34aa) said : #7

It looks like you ran out of disk area. Free a few up and strive once more. One brief/easy manner to unfastened a few disk area is to run: https://answers.launchpad.net/ubuntu/+question/693637
sudo apt easyguide https://bestcoffeemaker2021.com/best-french-press-coffee-maker/

Relevant Logs:
cp: error writing '/var/tmp/mkinitramfs_2fAaIZ//usr/lib/modules/five.Four.0-42-usual/kernel/drivers/goal/target_core_mod.Ko': No space left on tool

Njorl (usingcoconuts) said : #8

Thank you, but I can't see that's it.

I've two partitions on the external drive. One is NTFS and largely, if not entirely empty, and the other is btrfs (on luks) and only about half full. The log message appears when the drive is plugged in, and, once I've mounted the encrypted btrfs partition, I've been able to add new data to it.

I've not really been using the NTFS partition, but I'll check it, next time I power up the drive.

Manfred Hampl (m-hampl) said : #9

You should ignore comment #7
That message has nothing to do with your problem, but was created just for the purpose of posting a dubious link.
To make the message look valid, the spammer re-uses snippets from valid questions and puts them together without checking whether the result makes sense.

Njorl (usingcoconuts) said : #10

Damn! Fooled by the AI.

Thanks for letting me know.

Can you help with this problem?

Provide an answer of your own, or ask Njorl for more information if necessary.

To post a message you must log in.