Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Post-POST, post-BIOS screen, post-GRUB; when I boot Debian with a SD card or USB stick plugged in, one of the first things to pop up on the screen (so quickly that usually I don't even notice) looks a little something like:

[sdX] no caching page mode present

text, text, X starts about halfway through that long list of stuff, the text gets noticeably smaller, and just before the window manager starts, I see the very familiar device message (isn't that what dmesg stands for, anyhow?)

[sdX] assuming drive cache. write through

So, technically speaking, what's the difference between those two states? What's being cached? What's the page? What's 'writing through'? And what precludes the assumption of drive cache so that the writing through can happen, directly following boot?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

"sd" stands for SCSI disk. When a disk device is first detected, the kernel (among other things) requests the device's caching mode page, which will indicate if the device has an onboard memory buffer that sits in front of the media (disk, flash memory, whatever). In your case the device doesn't have a caching mode page, so the kernel assumes there is no caching of reads or buffering of writes, and that therefore writes to the device will be "write through," i.e. will go directly to the media.

The kernel cares about write buffering because filesystem consistency checking and recovery depends in part on the order in which data is written to storage. If there were a device onboard cache, a filesystem module might want to send the SCSI command to disable the caching of writes so that fsck continues to work properly.

share|improve this answer
    
It says "assuming drive cache" so I don't think "there is no caching of reads or buffering of writes" is correct. Generally, a write-through cache means "Write is done synchronously both to the cache and to the backing store" So there can definitely still be caching of reads. –  Matthew Flaschen Nov 27 '12 at 19:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.