Unofficial Hacker News client - receive Push Notifications on replies.

"This message has been on the screen for almost two hours now." (opens external site)

335 points by firloop 2 days ago | unsung.aresluna.org | 222 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (1)

  1. The SYNCHRONIZE CACHE command (0x35 / 0x91) instructs the drive to write the volatile cached data to non-volatile cache and/or the recording medium itself. Which one the drive chooses is anyone's guess, but can be influenced by the host beforehand (if the drive supports FUA and the host instructs the drive to WRITE data directly to the medium). This is the mechanism invoked by fsync() after the WRITEs from the host page cache have been issued and is where the drive can lie to the host.

    The START STOP UNIT command (0x1B) is used to instruct the drive to (among other things) unload or eject the medium and/or power down. This is what the Eject / Safely Remove Drive functions invoke. If the drive isn't ready to do so, for example because there is still data sitting in the volatile cache for it to write or a drive self-test is still in progress, it will tell you so.

    These are SCSI commands, which are also used in drives that aren't electrically or physically SCSI. These include SATA, SAS, and USB Mass Storage (both MSC and UAS). That's why they all show up as sdx devices in Linux; sd stands for SCSI Disk (see drivers/scsi/sd.c), and you can't use any of these types of drives without SCSI support enabled in the kernel configuration (CONFIG_SCSI=y).