View Single Post
  #174   Report Post  
Posted to uk.d-i-y
dennis@home dennis@home is offline
external usenet poster
 
Posts: 9,369
Default UPS server wiring no-no



"The Natural Philosopher" wrote in message
...

I agree is a good system and it reduces the probability of errors
considerably but it cannot eliminate them. Not without hardware
assistance.

The ONLY way round that one is to e.g. hold the uberblock in NVRAM


Totally untrue.
When you issue a command to a disk it will either successfully write it or
it will leave its sectors unchanged in the event of a power fail.
Once you work this out you will realise how it works.

So yes the hardware is designed to cope with a power fail, the hardware
being the disk.

if you didn't design the disk to work this way you would get thousands of
corruptions, every time you power it off.
It is plain to see that this does not happen as the disks detect the power
loss and complete any write to the platter that is in progress, then they
shut down.


So now you can write the data and stuff to the log on the disk and then
write the data, etc to the disk, then mark it finished in the log after you
have updated the "uberblocks". On a power fail restart you just replay the
logs to ensure everything is OK.

If you don't worry about the data you can just write a list of inodes you
are writing and do a quick rebuild on start up after a power fail.