Journaling is how file-systems save metadata so that data can be recovered in the event of corruption.
Journaling is an area where a file-system logs its actions and other information, so that if it is interrupted (crash, power cut, etc.), the file-system can rebuild itself and finish up any uncompleted actions.
An example scenario on what types of errors journaling can solve is provided by Wikipedia:
For example, deleting a file on a Unix file system involves two steps:
- Removing its directory entry.
- Marking space for the file and its inode as free in the free space map.
If a crash occurs between steps 1 and 2, there will be an orphaned inode and hence a storage leak. On the other hand, if only step 2 is performed first before the crash, the not-yet-deleted file will be marked free and possibly be overwritten by something else.
A journaled filsystem, by comparison, would know that it has only done one of the above actions, and will do the other upon startup.
Most modern filesystems are journaled, most notably:
- ext3 (default on most Linux distributions)
- ReiserFS
- XFS
- JFS
- NTFS (Windows NT and up standard filesystem)
- HFS+ (the standard OSX filesystem)