Traditional wisdom says that the best way to ensure filesystem integrity is by using a journaling filesystem. A journaling filesystem writes all disk changes to a small file, or journal, before writing them to the actual filesystem. This means that changes are safely and quickly cached on disk, so that in case of a power outage there is less chance of data loss. The system then goes back and reads the journal, writing the changes to the filesystem proper in a leisurely fashion. On boot, the system checks the journal file for any changes that were not yet written to disk and makes those changes, ensuring up-to-date data.