3

According to this page, filesystems like ext4 have journaling for both blocks and metadata, and it's used to prevent data corruption:

A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the intentions of such changes in a data structure known as a "journal", which is usually a circular log. In the event of a system crash or power failure, such file systems can be brought back online more quickly with a lower likelihood of becoming corrupted.

Btrfs doesn't seem to have journaling according to this page.

Yet, this page quotes ext4 primary developer and maintainer Theodore T'so as saying that btrfs is better than ext4:

Despite the fact that Ext4 adds a number of compelling features to the filesystem, T'so doesn't see it as a major step forward. He dismisses it as a rehash of outdated "1970s technology" and describes it as a conservative short-term solution. He believes that the way forward is Oracle's open source Btrfs filesystem, which is designed to deliver significant improvements in scalability, reliability, and ease of management.

So, how does btrfs prevent data corruption without journaling?

1 Answer 1

5

Btrfs uses copy on write (CoW) so the existing data are not overwritten when modified but copied to a new location and the copy is changed. So journal is not needed because in case of power failure or system crash you still have the original data. Btrfs also uses checksums to detect random data corruptions so it knows whether both data and metadata are valid or corrupted.

More information about copy on write is available here or more general description on wikipedia.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .