summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoan V. C. <codeberg-hn80@joanvc.cat>2026-03-20 09:42:50 +0100
committerEfraim Flashner <efraim@flashner.co.il>2026-05-20 11:37:30 +0300
commit3b7fd1e76698559f8575ffeeed116673bd00ade1 (patch)
treee49b166727766800ed1005bd4baf792f667c1ec5 /doc
parent5912f01e976480b50c18c65f8236a998fc7db7f9 (diff)
gnu: services: Add btrfs-scrub-service-type.
* gnu/services/linux.scm (btrfs-scrub-configuration): New configuration record. (btrfs-scrub-service-type): New service type with custom actions. (fstrim-/shepherd-calendar-event?): Refactor to avoid name collisions. * doc/guix.texi: Add service documentation. Change-Id: I04747914591a80cd535d2f79d35e08f68081b2fc Signed-off-by: Joan Vilardaga Castro <codeberg-hn80@joanvc.cat> Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi76
1 files changed, 76 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 8d45ed1f43b..debe9b48a77 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -151,6 +151,7 @@ Copyright @copyright{} 2025 Noé Lopez@*
151Copyright @copyright{} 2026 David Elsing@* 151Copyright @copyright{} 2026 David Elsing@*
152Copyright @copyright{} 2026 Nguyễn Gia Phong@* 152Copyright @copyright{} 2026 Nguyễn Gia Phong@*
153Copyright @copyright{} 2026 Yarl Baudig@* 153Copyright @copyright{} 2026 Yarl Baudig@*
154Copyright @copyright{} 2026 Joan Vilardaga Castro@*
154 155
155Permission is granted to copy, distribute and/or modify this document 156Permission is granted to copy, distribute and/or modify this document
156under the terms of the GNU Free Documentation License, Version 1.3 or 157under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -45888,6 +45889,81 @@ mount.
45888@end table 45889@end table
45889@end deftp 45890@end deftp
45890 45891
45892@subsubheading btrfs-scrub Service
45893@cindex btrfs-scrub service
45894@cindex solid state drives, periodic trim
45895@cindex solid state drives, trim
45896
45897@c This was copied from the btrfs-scrub manpage, with some Texinfo touch-ups.
45898@quotation Information
45899Scrub is a validation pass over all filesystem data and metadata that
45900detects data checksum errors, basic super block errors, basic metadata
45901block header errors, and disk read errors.
45902
45903Scrub is done on a per-device base, if a device is specified to
45904@command{btrfs scrub start}, then only that device will be
45905scrubbed. Although btrfs will also try to read other device to find a
45906good copy, if the mirror on that specified device failed to be read or
45907pass verification.
45908
45909If a path of btrfs is specified to @command{btrfs scrub start}, btrfs
45910will scrub all devices in parallel.
45911
45912On filesystems that use replicated block group profiles (e.g. RAID1),
45913read-write scrub will also automatically repair any damage by copying
45914verified good data from one of the other replicas.
45915
45916Such automatic repair is also carried out when reading metadata or data
45917from a read-write mounted filesystem.
45918@end quotation
45919
45920@defvar btrfs-scrub-service-type
45921Type for a service that periodically runs @command{btrfs-scrub} on a
45922certain device, whose value must be an
45923@code{<btrfs-scrub-configuration>} object. The service can be
45924instantiated in its default configuration with:
45925
45926@lisp
45927;; This will scrub the root (@file{/}) filesystem.
45928(service btrfs-scrub-service-type)
45929
45930;; This will scrub the @file{/gnu/store} filesystem (assuming it's a
45931;; different filesystem from @file{/}).
45932
45933(service btrfs-scrub-service-type
45934 (btrfs-scrub-configuration
45935 (to-scrub "/gnu/store")))
45936@end lisp
45937@end defvar
45938
45939@c %start of fragment
45940
45941@deftp {Data Type} btrfs-scrub-configuration
45942Available @code{btrfs-scrub-configuration} fields are:
45943
45944@table @asis
45945@item @code{package} (default: @code{btrfs-progs}) (type: file-like)
45946The package providing the @command{btrfs} command.
45947
45948@item @code{schedule} (default: @code{"0 0 1-7 * 0"}) (type: Shepherd calendar event)
45949Schedule for launching @command{btrfs-scrub}, expressed as a string in
45950traditional cron syntax or as a gexp evaluating to a Shepherd calendar
45951event (@pxref{Timers,,, shepherd, The GNU Shepherd Manual}). By default
45952this is set to run the 1st Sunday of the month, at 00:00.
45953
45954@item @code{to-scrub} (default: @code{"/"}) (type: maybe-string)
45955Device to scrub. It will scrub the root (@file{/}) if not given.
45956
45957@item @code{extra-arguments} (type: maybe-list-of-strings)
45958Extra options to append to @command{btrfs scrub start} (run @samp{man
45959btrfs-scrub.8} for more information). Keep in mind that, by definition,
45960this service uses the @option{-B} flag (do not background and print
45961scrub statistics when finished).
45962
45963@end table
45964
45965@end deftp
45966
45891@cindex oom 45967@cindex oom
45892@cindex out of memory killer 45968@cindex out of memory killer
45893@cindex earlyoom 45969@cindex earlyoom