From nobody Tue Nov 01 00:14:29 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N1VrQ1Z0Wz4gv2Q; Tue, 1 Nov 2022 00:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N1VrQ0rpZz3MVh; Tue, 1 Nov 2022 00:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667261670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1+Q9TpXBMYB0yv69rCTjWUKKxQ59fGnXMasjvHtAvI=; b=rw8v5aMAYPBK1LmI+ZJ3vUPSYGTEP3eXBLRdVbIDyJge+O1NoJ+llnFlb2P1s9B9qeirJh /r30ATYHLUfqzKnsQ0qDEW939aJfDA40NexsC2OMCUR3+1tZHnoCKLPb19IUmR1hViApIg z5BxUFOnRDP7ux1uaBFewcIQRCJta0DMGWSDcdFJIJh2x5wJ1t+pLkLNLGN3E3Kasa4Ip9 bb/+R7MVhIFHD5lNw9vFP0R8KAYWGTOF9viRPEAADAr3GToF21d1LeqaLb+PSAH1W9Aby5 Tw6GHlE+yAFIb88HNGOF3Cz1d9MVUeXfVY4+q2WXUvsi2WGbpUwu/ex1cMozOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N1VrP6zBqzw2r; Tue, 1 Nov 2022 00:14:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A10ETXZ099133; Tue, 1 Nov 2022 00:14:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A10ET1J099132; Tue, 1 Nov 2022 00:14:29 GMT (envelope-from git) Date: Tue, 1 Nov 2022 00:14:29 GMT Message-Id: <202211010014.2A10ET1J099132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 0f58c5454c66 - releng/12.4 - Add a description of soft updates journaling to newfs(8). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 0f58c5454c660ea744963bc0cb347646da4b4cb8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667261670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1+Q9TpXBMYB0yv69rCTjWUKKxQ59fGnXMasjvHtAvI=; b=O5in81UCRaiy3MZfO8payBsQ+ejdZQHnkj2QXO/h16TyEQQtWRIzRSVPCalwtxHPN8Qy1l PrCnFcrYhwVIF7Vx0RFpAYrOlRrGkYskAeSa0On69bZyn+YNhIfnljpE6bR7mYcFRtUqWS MwEvZZGaJKeckFHVZ6A17uIRGfUhuYRaottpKYDRjLov4vpz6Gn7baHTwUngUORTfX5J7y 7Pyb5llTjhj2PCFJwZ1z1K/WeORLd974KW8Y1BzmNuTakZrChRgARj0+310dY0MQGH7Awm be87eq9APGRA2LUb4yeyyC/0wVxEcV4OTnBZxFJO+ZawZnSu8cvgx+Yisz8Fhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667261670; a=rsa-sha256; cv=none; b=Hl9aQ/iNowj3kfAVOVlWzFna4jfrEHR+E8NnwYjsi4p6FH2d7mvwBPbp0XWA7hXjarn/x+ WHHZH+f4ht3J42MtNtoRereNMNXR12u8O1WvnXfZrKUtMXrZDj7PQ4iA3nwSi71AJVONw8 zL56eBVagxHhd5JXsyIvIMnlQ/6LYC12kri01eHwjUE6ogthhdSEmhp1j30xtrRy42m5Cz M7XiJRimFcNfntdySvw9vvJwtdMfkUrH1KMbQaERYe4Lbl4fOuRQlPBoc3CKtGAhQTiqJV gpFDDWRtR2APMVagcR80feqw3XFXOuLTNE21c9SrAmKca+U/xOIvM/7jqDNn5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=0f58c5454c660ea744963bc0cb347646da4b4cb8 commit 0f58c5454c660ea744963bc0cb347646da4b4cb8 Author: Kirk McKusick AuthorDate: 2022-10-21 17:56:20 +0000 Commit: Kirk McKusick CommitDate: 2022-11-01 00:11:22 +0000 Add a description of soft updates journaling to newfs(8). Requested by: Graham Perrin PR: 261944 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation (cherry picked from commit 0929a153fc5cfe35f7390ab5870a36daed19b0ce) (cherry picked from commit 759ee8654012dc35380eed6204bf4f35f6eacaaf) --- sbin/newfs/newfs.8 | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index e64bdeb367f4..31f384e144d5 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd April 17, 2021 +.Dd October 21, 2022 .Dt NEWFS 8 .Os .Sh NAME @@ -169,6 +169,46 @@ This flag is implemented by running the .Xr tunefs 8 utility found in the user's .Dv $PATH . +.Pp +Enabling journaling reduces the time spent by +.Xr fsck_ffs 8 +cleaning up a filesystem after a crash to a few seconds from minutes to hours. +Without journaling, the time to recover after a crash is a function +of the number of files in the filesystem and the size of the filesystem. +With journaling, the time to recover after a crash is a function of the +amount of activity in the filesystem in the minute before the crash. +Journaled recovery time is usually only a few seconds and never +exceeds a minute. +.Pp +The drawback to using journaling is that the writes to its log adds +an extra write load to the media containing the filesystem. +Thus a write-intensive workload will have reduced throughput on a +filesystem running with journaling. +.Pp +Like all journaling filesystems, the journal recovery will only fix +issues known to the journal. +Specifically if a media error occurs, +the journal will not know about it and hence will not fix it. +Thus when using journaling, it is still necessary to run a full fsck +every few months or after a filesystem panic to check for and fix +any errors brought on by media failure. +A full fsck can be done by running a background fsck on a live +filesystem or by running with the +.Fl f +flag on an unmounted filesystem. +When running +.Xr fsck_ffs 8 +in background on a live filesystem the filesystem performance +will be about half of normal during the time that the background +.Xr fsck_ffs 8 +is running. +Running a full fsck on a UFS filesystem is the equivalent of +running a scrub on a ZFS filesystem. +.Pp +Presently it is not possible to take a snapshot on a UFS filesystem +running with journaled soft updates. +Thus it is not possible to reliably dump mounted filesystems or +to run background fsck on filesystems enabled for journaling. .It Fl k Ar held-for-metadata-blocks Set the amount of space to be held for metadata blocks in each cylinder group. When set, the file system preference routines will try to save