From owner-svn-src-all@freebsd.org Sun Aug 25 18:52:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8595E6953; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46GklG5D4cz4JdS; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9440721E42; Sun, 25 Aug 2019 18:52:10 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7PIqA3t009797; Sun, 25 Aug 2019 18:52:10 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7PIqAnV009796; Sun, 25 Aug 2019 18:52:10 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201908251852.x7PIqAnV009796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 25 Aug 2019 18:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351483 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 351483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2019 18:52:10 -0000 Author: hrs Date: Sun Aug 25 18:52:10 2019 New Revision: 351483 URL: https://svnweb.freebsd.org/changeset/base/351483 Log: Document soft updates journaling and GEOM-based UFS journaling. Reviewed by: mckusick Modified: head/share/man/man7/ffs.7 Modified: head/share/man/man7/ffs.7 ============================================================================== --- head/share/man/man7/ffs.7 Sun Aug 25 18:46:10 2019 (r351482) +++ head/share/man/man7/ffs.7 Sun Aug 25 18:52:10 2019 (r351483) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2001 +.Dd August 25, 2019 .Dt FFS 7 .Os .Sh NAME @@ -46,6 +46,7 @@ In the kernel configuration file: .Cd "options UFS_DIRHASH" .Cd "options UFS_EXTATTR" .Cd "options UFS_EXTATTR_AUTOSTART" +.Cd "options UFS_GJOURNAL" .Pp In .Xr fstab 5 : @@ -84,20 +85,65 @@ and enforces metadata update dependencies (e.g., updating free block maps) to ensure that the file system remains consistent. .Pp -To enable soft updates on an -.Em unmounted -file system, use the following command: +To create a new file system with the soft updates +enabled, +use +.Xr newfs 8 +command: .Pp -.D1 Nm tunefs Fl n Cm enable Ar fs +.D1 Nm newfs Fl U Ar fs .Pp .Ar fs can be either a mount point listed in .Xr fstab 5 -(e.g., -.Pa /usr ) , +.Pq e.g. , Pa /usr , or a disk device -(e.g., -.Pa /dev/da0a ) . +.Pq e.g., Pa /dev/da0a . +.Pp +It is possible to enable soft updates on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl n Cm enable Ar fs +.Pp +Soft updates can also add journaling that reduces the time spent by +.Xr fsck_ffs 8 +cleaning up a filesystem after a crash from several minutes to a few seconds. +The journal is placed in an inode named +.Pa .sujournal , +and is kept as a circular log of segments containing +records that describe metadata operations. +.Pp +To create a new file system with both the soft updates +and soft updates journaling enabled, +use the following command: +.Pp +.D1 Nm newfs Fl j Ar fs +.Pp +This runs +.Xr tunefs 8 +command after +.Xr newfs 8 +command with +.Fl U +flag enabled. +It is possible to enable soft updates journaling on an +.Em unmounted +file system by using +.Xr tunefs 8 +command: +.Pp +.D1 Nm tunefs Fl j Cm enable Ar fs +.Pp +This flag automatically enables the soft updates feature +when it is not enabled. +Note that this +.Xr tunefs 8 +command will fail if a file +.Pa .sujournal +already exists before enabling the soft updates journaling. .El .Ss File Ownership Inheritance .Bl -tag -width 2n @@ -155,10 +201,9 @@ extattrctl initattr -p / 388 posix1e.acl_default .Ed .Pp On the next mount of the root file system, -the attributes will be automatically started -(if +the attributes will be automatically started if .Dv UFS_EXTATTR_AUTOSTART -is included in the kernel configuration), +is included in the kernel configuration, and ACLs will be enabled. .Ss Directory Hashing .Bl -tag -width 2n @@ -183,7 +228,52 @@ subdirectory of the file system root during the mount If found, extended attribute support will be automatically started for that file system. .El +.Ss GEOM-based Journaling +.Bl -tag -width 2n +.It Cd "options UFS_GJOURNAL" +Implements a block level journaling of a UFS file system, +which is for both data and metadata. +To enable this, +create a +.Xr gjournal 8 +GEOM provider for a block device by using the +following command: .Pp +.D1 Nm gjournal label Ar da0 +.Pp +In this example, +.Pa /dev/da0 +is used as the target block device, +and +.Pa /dev/da0.journal +is created. +Then create a new file system by using +.Xr newfs 8 +with the block level journaling flag and mount it: +.Pp +.D1 Nm newfs Fl J Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.Pp +.Cm async +option is not mandatory but recommended for better performance +because the journaling guarantees the consistency of an +.Cm async +mount. +.Pp +It is also possible to enable the block level journaling +on an existing file system. +To do so, +use +.Xr gjournal 8 +utility to label the underlying block device and +.Xr tunefs 8 +utility to enable the block level journaling flag: +.Pp +.D1 Nm gjournal label Ar da0 +.D1 Nm tunefs Fl J Cm enable Ar /dev/da0.journal +.D1 Nm mount Fl o Cm async Ar /dev/da0.journal Ar /mnt +.El +.Ss Xr sysctl 8 MIBs The following .Xr sysctl 8 MIBs are defined for use with @@ -192,11 +282,11 @@ MIBs are defined for use with .It Va vfs.ffs.doasyncfree Asynchronously write out modified i-node and indirect blocks upon reallocating file system blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .It Va vfs.ffs.doreallocblks Enable support for the rearrangement of blocks to be contiguous. -(Default: 1.) +.Pq Default: 1 . .El .Sh SEE ALSO .Xr quota 1 , @@ -204,7 +294,9 @@ to be contiguous. .Xr extattr 3 , .Xr edquota 8 , .Xr extattrctl 8 , -.Xr sysctl 8 +.Xr fsck_ffs 8 , +.Xr sysctl 8 , +.Xr tunefs 8 .Rs .%A M. McKusick .%A W. Joy @@ -223,4 +315,11 @@ to be contiguous. .%T "Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem" .%J "Proceedings of the Freenix Track at the 1999 Usenix Annual Technical Conference" .%P 71-84 +.Re +.Rs +.%A M. McKusick +.%A J. Roberson +.%D May 2010 +.%T "Journaled Soft-updates" +.%J "BSD Canada Conference 2010 (BSDCan)" .Re