From nobody Mon Oct 31 03:54:57 2022 X-Original-To: dev-commits-src-all@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 4N0znF6w7Yz4gW3J; Mon, 31 Oct 2022 03:54:57 +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 4N0znF6M5jz3dqq; Mon, 31 Oct 2022 03:54:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667188497; 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=TuruS7PHC8/x+qJjKKdZS3u42e6Dm5DGYY0pZlPbW0I=; b=DY6v1esU7LDWHjiKtYCx7Q+DITbmewQPv9hNyET7GsSCNoYmvsYF68UiOmrohZisCtk/aw drulCtDjfNqMv9kQOFhwTSukqAhcw0gkYO8vtFtUm1hnT4xGhO0zUgahQ4SDSDWlSvjQ1V 5k0gCBOSjdkZydCjpupgjSWcncEXUz/b93WqCuTCZ1iIcPq2eKlSGuD2OLWxttIWUgTGuq DgFvpHVkWG/gPQU2ymSNO3KBHgGzDI9YcGoG/TGUsngmNBeGkusMvdfRrQ6YLG3ezcAyG8 SidQ8TA2lrZWi1c78gj1vxmTsUIGKxEZraAWQ94TDNVJwkjKqwrvWmRmkW1PJg== 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 4N0znF5MxNzNDH; Mon, 31 Oct 2022 03:54:57 +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 29V3svaY074999; Mon, 31 Oct 2022 03:54:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29V3svI5074998; Mon, 31 Oct 2022 03:54:57 GMT (envelope-from git) Date: Mon, 31 Oct 2022 03:54:57 GMT Message-Id: <202210310354.29V3svI5074998@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: b06a5f6f5e39 - stable/12 - Add a description of soft updates journaling to newfs(8). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/12 X-Git-Reftype: branch X-Git-Commit: b06a5f6f5e3910951f61ee8314ac66fb9ec7029e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667188497; 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=TuruS7PHC8/x+qJjKKdZS3u42e6Dm5DGYY0pZlPbW0I=; b=p5DeewBNmemxqO5mEMZBnymyPO7tOAURkIzoH6BgU2pzKn7NROXoTgmgis8YFbVSB6d4gl RX7AheOH3YEjs8jDjCycb0HTYZnahJTPc6ctfXlmxbekHvVRBjFLxPm+YijNNCCR523VSV IJzqqwnIW859GKt38JVn9T9evXQ3zjgayfElSx7MM/sb83/wMOQwGlyu2CpyxAN/uoE6Dy Z+6MeMo/2J21/22JKO3TLubPR62hVnSSSKF/gpQ0UDa2UL1T526a+5JqZpQKTGK7ig/gVZ aYC1n1P9RJWJ+lwG3CXauuRS+0C3InMPAfVLgwXqahYWyYx3fKDdCSewdXyoNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667188497; a=rsa-sha256; cv=none; b=ymYqEy98VuPKY+UKAqytUwqq7G3vI6j8buoyg3hHLpwSgmaM7Tq515WK50DZixpmFh0GM4 PMz+eYMLpFl9hO+Oz98+TZOVY4LyTPnHBypavEEasAuAs63TExSHqAQVga8z/Y+AYQkIJV JAZ+uPxeVXfs3xrkGIEEYiwB1/Hbrk09TXSukOxdgjQ3kcGlN4aOHCD90vBK2MbqWHm+Sx vJ8k3gpDL3ADP2Xrtqsi2cgqCBsD8ZaHdhi+diPzKv89j6vQzZ0xVl/bRiNkb5IIXUuYBQ A6VSgdBu5yZT+6dgwtOo2nK+W2RdGFW0JCw917wN/qn1L9a6Upo7BJDcaTuXZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=b06a5f6f5e3910951f61ee8314ac66fb9ec7029e commit b06a5f6f5e3910951f61ee8314ac66fb9ec7029e Author: Kirk McKusick AuthorDate: 2022-10-21 17:56:20 +0000 Commit: Kirk McKusick CommitDate: 2022-10-31 03:53:19 +0000 Add a description of soft updates journaling to newfs(8). Requested by: Graham Perrin PR: 261944 Sponsored by: The FreeBSD Foundation (cherry picked from commit 0929a153fc5cfe35f7390ab5870a36daed19b0ce) --- 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