Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Soft updates
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Approach to maintaining file system}} '''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 system]]s. == Method of operation == 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 collection (computer science)|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. == Implementations == [[FreeBSD]] supports soft updates for the [[Unix File System|UFS]] file system<ref>{{cite book | title=The Design and Implementation of the FreeBSD Operating System | first1=Marshall Kirk | last1=McKusick | first2=George V. | last2=Neville-Neil | date=2005 | chapter=8.6 | publisher=[[Addison-Wesley]] | isbn=978-0321968975}}</ref> 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 <kbd>newfs</kbd> command.<ref>{{cite web | url=https://www.freebsd.org/cgi/man.cgi?query=newfs | title=newfs(8) | publisher=[[FreeBSD]] | date=2017-07-07 | access-date=2019-02-02}}</ref> They can be disabled or enabled anytime thereafter with an option to the <kbd>tunefs</kbd> command.<ref>{{cite web | url=https://www.freebsd.org/cgi/man.cgi?query=tunefs | title=tunefs(8) | publisher=FreeBSD | date=2016-04-19 | access-date=2019-02-02}}</ref> FreeBSD 9.0 introduced a journaling supplement to soft updates for the purpose of eliminating a background <kbd>fsck</kbd> for garbage collection after a crash.<ref>{{cite web | url=https://www.freebsd.org/releases/9.0R/relnotes-detailed.html#FS | title=FreeBSD 9.0-RELEASE Release Notes | publisher=FreeBSD | date=2012-01-12 | access-date=2019-02-02}}</ref><ref>{{cite web | url=https://www.mckusick.com/softdep/suj.pdf | title=Journaled Soft-updates | first1=Marshall Kirk | last1=McKusick | first2=Jeff | last2=Roberson | date=2010-01-23 | access-date=2019-02-02}}</ref> However, enabling journaling on a file system with soft updates disables the ability to make file system snapshots.<ref>{{cite web | url=https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195485 | title=Bug 195485 - [ufs] mksnap_ffs(8) cannot create snapshot with journaled soft updates enabled | publisher=FreeBSD | date=2014-11-28 | access-date=2019-02-02}}</ref> 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. <ref>{{cite web | url=https://undeadly.org/cgi?action=article;sid=20230706044554 | title=Soft updates disabled for future VFS work | publisher=[[OpenBSD_Journal]] | date=2023-07-05 | access-date=2024-03-09}}</ref> [[NetBSD]] supported soft updates until the 6.0 release (2012) at which time it was deprecated in favor of [[WAPBL]] journaling.<ref>{{cite web | url= //www.netbsd.org/releases/formal-6/NetBSD-6.0.html#removals | title=Announcing NetBSD 6.0 | publisher=[[NetBSD]] | date=2012-10-17 | access-date=2019-02-02}}</ref> == Comparison to journaling file systems == Neither journaling nor soft updates guarantees that no data will be lost, but they do make sure that the file system remains consistent. An advantage of a file system with soft updates is that it can be mounted immediately after a crash, since there is no log replay. == Notes == * {{cite journal | url=https://www.archive.ece.cmu.edu/~ganger/papers/osdi94.pdf | title=Metadata Update Performance in File Systems | first1=Gregory R. | last1=Ganger | first2=Yale N. | last2=Patt | date=Nov 1994 | journal=Proceedings of the USENIX Symposium on Operating Systems Design and Implementation (OSDI) | pages=49β60}} * {{cite web | url=https://www.usenix.org/legacy/publications/library/proceedings/bsdcon02/mckusick.html | title=Running "fsck" in the Background | first=Marshall Kirk | last=McKusick | date=2002 | work=Proceedings of the BSDCon 2002 | pages=55β64}} * {{cite web | url=https://www.usenix.org/legacy/publications/library/proceedings/usenix99/mckusick.html | title=Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem | first1=Marshall Kirk | last1=McKusick | first2=Gregory R. | last2=Ganger | date=1999 | work=USENIX Annual Technical Conference | pages=1β18}} * {{cite web | url=https://www.usenix.org/legacy/publications/library/proceedings/usenix2000/general/seltzer.html | title=Journaling Versus Soft Updates: Asynchronous Meta-data Protection in File Systems | author=Margo I. Seltzer | date=2000 | work=USENIX Annual Technical Conference | pages=71β84|display-authors=etal}} == External links == * Marshall Kirk McKusick: [http://www.mckusick.com/softdep/ Information about Soft Updates, Snapshots, and Back-ground Fsck] == References == {{Reflist}} {{FreeBSD |state=expanded}} {{DragonFly}} {{OpenBSD}} {{File systems |state=expanded}} [[Category:Berkeley Software Distribution]] [[Category:BSD software]] [[Category:Computer file systems]] [[Category:Disk file systems]] [[Category:FreeBSD]] [[Category:DragonFly BSD]] [[Category:OpenBSD]] [[Category:Unix file system technology]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:DragonFly
(
edit
)
Template:File systems
(
edit
)
Template:FreeBSD
(
edit
)
Template:OpenBSD
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)