Drive write cache protection (HC-1)

Share here your ideas for new projects

Moderators: meveric, mdrjr, odroid

Drive write cache protection (HC-1)

Unread postby y.trudeau » Sat Nov 11, 2017 12:36 am

Hi,
some time ago I bought 4 XU-4 to build a small ceph cluster. If I had to buy now, I would buy HC-1 for sure. The HC1 is very insteresting but there's one feature that would be amazing: a disk power protection for a few seconds. I forgot to disable the write cache of my USB hard disks and after a power outage, I got into trouble... I now have disabled the drives write cache but the performance is much less. With the HC-1, it would be awesome to have a capacitor or something else able to keep the power on for a few seconds (maybe just 1 or 2s) to allow the disk to flush its write cache. That would allow to safely boost the write performance.

Regards,

Yves
y.trudeau
 
Posts: 1
Joined: Sat Nov 11, 2017 12:24 am
languages_spoken: english
ODROIDs: XU-4

Re: Drive write cache protection (HC-1)

Unread postby crashoverride » Sun Nov 12, 2017 6:52 am

y.trudeau wrote:it would be awesome to have a capacitor or something else able to keep the power on for a few seconds (maybe just 1 or 2s) to allow the disk to flush its write cache.

The issue is not the disk cache and the solution is commonly available: an un-interruptible power supply (UPS).

A significant amount of power is required to keep the system running until an appropriate amount of time has passed that power is deemed off (black out) rather than interrupted (brown out). Linux then needs to send termination signals and wait for all processes to terminate. This closes any files they are using and forces them to flush their file caches. Once the file caches are flushed, the linux disk cache is flush. After the linux disk cache is flushed (along with any journals in use), the drive is sent a shutdown command so that it flushes its own cache and "parks" itself (mechanical drives only, SSDs instead wait for all flash write operations to complete). After all this occurs, then system power can also be safely shutdown.
crashoverride
 
Posts: 3104
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1


Return to The Ideas

Who is online

Users browsing this forum: No registered users and 5 guests