On Monday 20 December 2004 21:31, Spam wrote:
> 
> > On Monday 20 December 2004 17:32, Spam wrote:
> 
> >>   What happen with the performance when these barriers are active?
> > It's faster than with disk writecache off.
> > I didn't benchmark barriers=flush and writecache on.
> 
> >> 
> >>   Is it only during power failure the data in the write cache is lost?
> > No. See http://support.microsoft.com/kb/153296/EN-US/
> 
>   I think the answer to my question was yes. That link is about disk
>   cache not flushed properly before Windows shuts the computer off.
If the cache is not flushed prior to power off IDE drives may eat the cached 
data.

> 
> >>   
> >>   Also, does anyone know if the data in the disk write cache is
> >>   written out if the system crashes/freezes. Power failure is not a
> >>   very common occurrence, but crashes are much more so.
> > The cache should stay intact as long the harddisk is supplied with power.
> 
>   So, the question remains. Will the drive flush its cache if it still
>   has power or does it need to receive some kind of flush command from
>   the OS? If not, then a OS crash will not harm the integrity of the
>   data in the cache and the disk will flush it out.
The time of flush depends on the implementation of the drives cache flush 
algorithm. If you want to be sure that everything gets written then the OS 
has to send a flush command.
An OS crash does not eat the data in the drive cache.

> >>   Is it possible to detect if filesystem was unmounted due to power
> >>   failure or due to a kernel crash?
> > Kernel panics don't tend to reset the machine but output a dump to the
> > console /syslog via network and halt the machine.
> > If you have a UPS supplier supporting linux you will receive a power 
failure
> > notification event to take proper action.
> > For example: http://www2.apcupsd.com/
> 
>   No, I meant through software. So that fsck could detect if system
>   lost power and therefore make a more thorough test.
I don't think there is a possibility to detect if the platform doesn't
send a power failure event. I think the Intel Platform Monitoring Interface 
(IPMI) can do that. Maybe there is enough time for a flush till the power
wents off.

> 
>   If you have UPS then write-cache should never be dangerous?
If you perform a clean shutdown a power failure shouldn't.

-- 
lg, Chris

Reply via email to