Patrick O'Callaghan wrote:
It may be possible for HAL to manage turning off the write caching on the drive as part of mounting the drive, at least when HAL is mounting the drive. It may also be possible to have HAL take care of making sure the drive flushes its buffers before telling you that it is safe to remove the drive. HAL can have different rules for different drives.If I am reading this correctly, it is talking about the buffers on the drive itself, if you have write buffering enabled on the drive. To get around this, you would have to send a command to the drive telling it to write its buffers to disk, and have some way to know that it has done this. A work around would be to make sure that write caching is disabled on any removable hard drive.According to the standard specification (e.g., POSIX.1-2001), sync() schedules the writes, but may return before the actual writing is done. However, since version 1.3.20 Linux does actually wait. (This still does not guarantee data integrity: modern disks have large caches.)It's possible that 'eject' can handle such a drive-specific command, but again the man page doesn't say so. Disabling write-caching may not always be possible, it depends on the drive itself. Some drives may even do caching without telling you (many of them already mess around with the internal geometry so what they present to the outside world is not always the truth). Designers trying to be clever make it harder for driver software to be clever.
This does not help with drives that you mount manually, so you will have to count on the user there for now. On the other hand, if you are mounting the drive manually, you should know a bit more about what you are doing. You either have to be root, or have an entry in /etc/fstab to do it... So HAL could be configured to help prevent users from shooting themselves in the foot.
The hardest part of configuring HAL to do this would be writing rules for specific drives or drive families.
Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup!
Attachment:
signature.asc
Description: OpenPGP digital signature
-- fedora-list mailing list fedora-list@xxxxxxxxxx To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list