Re:Mistakes to Avoid When Buying a MicroSD Card (2018)
by zargon on Monday August 19, 2019 @01:13PM
(#20739600)
I would hope that unmounting invalidates the cache, because the kernel can't know that the device wasn't modified between mounts. I like the sibling's idea of using two separate computers though.
[ Parent
| on HN ]
Re:Mistakes to Avoid When Buying a MicroSD Card (2018)
by rlpb on Monday August 19, 2019 @01:32PM
(#20739783)
The kernel is still in control of the underlying block device, and handles all reads and writes through that block device even when it is unmounted. So it can know that the device wasn't modified between mounts (or, more likely, it'll keep the block device cache maintained).
Unplugging and replugging the card really should invalidate the cache though.
Re:Mistakes to Avoid When Buying a MicroSD Card (2018)
by jolmg on Monday August 19, 2019 @01:56PM
(#20740054)
This discussion got me thinking that it might be possible that storage devices might expose a datum that lets the kernel know if there were any writes since it last saw the storage device. Something like total number of writes to the device, last modified time, or something. I'm just wondering out loud. It really seems safest to reboot the computer to destroy whatever cache one might have.