From nobody Fri Oct 21 17:57:48 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 4MvByP5V4Wz4gLwY; Fri, 21 Oct 2022 17:57:49 +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 4MvByP2zBTz3CZ1; Fri, 21 Oct 2022 17:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666375069; 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=L1SD1uwJbGalKJkVzihPLDHehjswM4M24ozBVcg1D1Q=; b=a9MheJPnoApLdYipHe1yQI9cH+i64keiAxxpjfVQNq158jmvnAzUkQnNN5S2Gq6932f0xf zXxPEtoGMQKxBoTCYXMLcAY06SHaD2/XGJFQaDtR58W/t0+20xmCm3I6c+kHsVzSwAjl1j qjhjDQ6FSCh5EiLkYgcFz1YjBVXm+M+QXbOPqNIFvFjAfnbe3HAD7Z8t7NZ4ghfDUqVpaW X+NHqNXOzmq6Ea6i6PQlBZx5uty9chH9fLJU7OIq3rH9Qzr0EV3Wj3FcVmxB4Xg3pIOC05 Ak3AMxYSxN3dykf0+JBKmEOJQo/yIDhdChLCNXw8X0tCN9xQ/3tFYBB1PG0k8A== 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 4MvByP045fzHwq; Fri, 21 Oct 2022 17:57:49 +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 29LHvmKM092891; Fri, 21 Oct 2022 17:57:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29LHvmc2092890; Fri, 21 Oct 2022 17:57:48 GMT (envelope-from git) Date: Fri, 21 Oct 2022 17:57:48 GMT Message-Id: <202210211757.29LHvmc2092890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 0929a153fc5c - main - 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/main X-Git-Reftype: branch X-Git-Commit: 0929a153fc5cfe35f7390ab5870a36daed19b0ce Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666375069; 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=L1SD1uwJbGalKJkVzihPLDHehjswM4M24ozBVcg1D1Q=; b=CMc6j21uMm6JUSZ3QY+idu3yPjujQTHj44P6wyRqqYRwJcEfJQvnZ7F1b4etwR0pr+jNGH s7SvJR69FbWVTWwK69iom03+Kg2DljoMIOJN1qwsVL3kOGJB3Sgn4abbsJv+ja2fI4EyXA Bm7u0HK4XiQJ+83qwY5bFp9IEedOA3DS7eEwCjKjAbrpTIl9tKv9GimNOpE3n8SEUV5hId iONYgaQ8nKf4P7L5L1KTqrwk6XmYrW127RnpNAFZ29vhXnbuol60GBEH8C8XJfRJrGjJL0 F/yCMcF7nKfYRhPIJF78IBb0W4w5o+r8Xk8kO2AfA1g7YnNuVOrurFIo44MsnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666375069; a=rsa-sha256; cv=none; b=QYod++kdQgFpJSKWyO9GAa43DYUvV/7prX5hZYNY1WOsaAcRZe/J5WRE5/6nHGToERSIOs TTF6YWfia11pPS8jjJabeqzlv9Sy29e6I6v/q0+13GTuZUdMirnKMtMei8irciXpos32Sz XbjacgxqdsPcNw6ikfmpOhd0an/UTJhyp88UGXlBfBdCSDPI9tit5sx5I4EQriIYaS0weX l6GL765neQlnn1WdPiHL30Ja8Kv+k1L4t2W+24m1PClD6WmvwaJF36avLFLe9BeK419KEU QMB7M8rsU0nMgO6FNSOeBYTFkObR//DFeEWEhrRWunQ17c+nthRTGKOn3lE4HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=0929a153fc5cfe35f7390ab5870a36daed19b0ce commit 0929a153fc5cfe35f7390ab5870a36daed19b0ce Author: Kirk McKusick AuthorDate: 2022-10-21 17:56:20 +0000 Commit: Kirk McKusick CommitDate: 2022-10-21 17:57:31 +0000 Add a description of soft updates journaling to newfs(8). Add a descrition to the newfs(8) -j (journal enablement) flag that explains what soft updates journaling does, the tradeoffs to using it, and the limitations that it imposes. Copied from the description in tunefs(8). PR: 261944 Sponsored by: The FreeBSD Foundation --- 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 a5b850c54675..a065563f86d1 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