Is NTFS fail-safe in case of a power outage?
In case of a power outage, can the NTFS filesystem be harmed? E.g be broken or cause file corruption? And is the NTFS built-in mirroring on dynamic disks guaranteed to keep the files in a consistent state in case of a power outage?
My point of view of this is that journaling file systems is specifictly designed to tolerate such kind of problems. The user data is not guaranteed by the NTFS file system, but applications like database management system has transaction managers that protects the data.
A few quotes from the great book Microsoft Windows Internals:
NTFS
NTFS includes a number of advanced features. One of its most significant features is recoverability. If a system is halted unexpectedly, the metadata of a FAT volume can be left in an inconsistent state, leading to the corruption of large amounts of file and directory data. NTFS logs changes to metadata in a transactional manner so that file system structures can be repaired to a consistent state with no loss of file or directory structure information. (File data can be lost, however.)
NTFS Design Goals and Features
High-End File System Requirements
From the start, NTFS was designed to include features required of an enterprise-class file system. To minimiza data loss in the face of an unexpected system outage or crash, a file system must ensure that the integrity of its metadata is guaranteed at all times. Finally, a file system must allow for software-based data redundancy as a low-cost alternative to hardware-redundant solutions for protecting user data.
Recoverability
NTFS uses atomic transactions to implement its file system recovery features. If a program initiates an I/O operation that alters the structure of an NTFS volume - that is, changes the directory structure, extends a file, allocates space for a new file, and so on - NTFS treats that operation as an atomic transaction. It guarantees that the transaction os either completed or, if the system fails while executing the transaction, rolled back.
In addition, NTFS uses redundant storage for vital file system information so that if a sector on the disk goes bad, NTFS can still access the volume's critical file system data.
Data Redundancy and Fault Tolerance
In addition to recoverability of file system data, some customers require that their own data not be endangered by a power outage or a catastrophic disk failure. The NTFS recovery capabilities do ensure that the file system on a volume remains accessible, but they make no guarantees for complete recovery of user files. Protection for applications that can't risk losing data is provided through data redundancy.
Data redundancy for user files is implemented via the Windows layered driver model, which provides fault-tolerant disk support. A volume manager can mirror, or duplicate, data from one disk onto another disk so that a redundant copy can always be retrieved.
NTFS Recovery Support
NTFS recovery support ensures that if a power failure or a system failure occurs, no file system operations (transactions) will be left incomplete and the structure of the disk volume will remain intact without the need to run a disk repair utility. The NTFS Chkdsk utility is used to repair catastrophic disk corruption caused by I/O errors (bad sectors, electrical anomalies, or disk failures, for example) or software bugs. But with the NTFS recovery capabilities in place, Chkdsk is rarely needed.
Recoverable File Systems
Although NTFS doesn't guarantee protection of user data in the event of a system crash - some changes can be lost from the cache - applications can take advantage of the NTFS write-through and cash-flushing capabilities to ensure that file modifications are recorded on disk at appropriate intervals. Both cache write-through - forcing the write operations to be immediately recorded on disk - and cash flushing - forcing contents to be written to disk - are efficient operations. Furthermore, unlike the FAT file system, NTFS guarantees that user data will be consistent and available immediately after a write-through operation or a cash flush, even if the system subsequently fails.
Theory aside, there are so many problems to be found on this site, caused on NTFS by power outage, that the answer has to be : NO.
I have personally handled on this site problems that went from suddenly appearing bad sectors and up to Windows installation completely hosed.
A computer is an extremely complex hardware, and modern hard disks have also become small computers of their own. Each has its own processor and memory, so each is vulnerable to power glitches happening at the wrong moment.
Even if NTFS is fail-safe (which I don't really believe), the components that handle changes to the hard disk are certainly not fail-safe. So the whole question is quite academical and doesn't relate to the real world.
The answer then has to be that NTFS is safer, but not fail-safe.
NTFS only journals metadata, which prevents corruption of the file system, but God help you with the data, which is not journaled. If a power outage occurs during write, data is lost.