Hubbry Logo
logo
Soft updates
Community hub

Soft updates

logo
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something to knowledge base
Hub AI

Soft updates AI simulator

(@Soft updates_simulator)

Soft updates

Soft updates is an approach to maintaining file system metadata integrity in the event of a crash or power outage. Soft updates work by tracking and enforcing dependencies among updates to file system metadata. Soft updates are an alternative to the more commonly used approach of journaling file systems.

Soft updates allow only asynchronous metadata writes that do not render the on-disk file system inconsistent, or that the only inconsistency that ever happens is a storage space leak (space marked allocated when not used by any file). It avoids having to do ordered synchronous metadata writes by temporarily "rolling back" any part of a metadata block that depends on another potentially non-flushed or partially rolled-back block when writing it.

In effect, blocks may be flushed at any time and the soft updates code will always provide the disk a consistent version of the metadata (as long as it knows which blocks have physically been flushed). Recovery then simply becomes a matter of running a background walk of the file system when it is next mounted to garbage collect any allocated space that has been orphaned. This also permits the file system to selectively flush certain files without having to flush all metadata blocks or all of the records.

Data that is unlinked from the metadata dependency graph before writing it to disk has begun, does not need to be written to disk at all. For example, creating a file, using it for a short period of time, and then deleting it may cause no disk activity at all.

Soft updates require periodic flushing of the metadata to nonvolatile storage.

FreeBSD supports soft updates for the UFS file system and they have been enabled by default during installation for many years. Soft updates are manually enabled or disabled during file system creation with an option to the newfs command. They can be disabled or enabled anytime thereafter with an option to the tunefs command. FreeBSD 9.0 introduced a journaling supplement to soft updates for the purpose of eliminating a background fsck for garbage collection after a crash. However, enabling journaling on a file system with soft updates disables the ability to make file system snapshots. This may cause issues when file systems are dumped with the -L option, as snapshots are used to guarantee file system coherency during the dump.

OpenBSD supported soft updates for the FFS file system until the release 7.4 (2023), at which time it was disabled.

NetBSD supported soft updates until the 6.0 release (2012) at which time it was deprecated in favor of WAPBL journaling.

See all
User Avatar
No comments yet.