btrfs scrub

This commit is contained in:
Daniel Langbein 2023-09-16 14:03:26 +02:00
parent 5711c62ff7
commit 6248fbc29a
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
4 changed files with 33 additions and 24 deletions

View File

@ -49,13 +49,6 @@ in
#../../modules/docker.nix #../../modules/docker.nix
]; ];
# BTRFS compression.
# `nixos-generate-config` does not detect mount options, so we add them here.
# https://nixos.wiki/wiki/Btrfs#Compression
fileSystems = {
"/".options = [ "compress=zstd" ];
};
networking.hostName = "yodaTab"; networking.hostName = "yodaTab";
services.openssh.ports = [ 22 ]; services.openssh.ports = [ 22 ];
boot.initrd.network.ssh.port = 22; boot.initrd.network.ssh.port = 22;

View File

@ -49,13 +49,6 @@ in
../../modules/docker.nix ../../modules/docker.nix
]; ];
# BTRFS compression.
# `nixos-generate-config` does not detect mount options, so we add them here.
# https://nixos.wiki/wiki/Btrfs#Compression
fileSystems = {
"/".options = [ "compress=zstd" ];
};
networking.hostName = "yodaTux"; networking.hostName = "yodaTux";
services.openssh.ports = [ 22 ]; services.openssh.ports = [ 22 ];
boot.initrd.network.ssh.port = 22; boot.initrd.network.ssh.port = 22;

View File

@ -51,13 +51,6 @@ in
../../modules/docker.nix ../../modules/docker.nix
]; ];
# BTRFS compression.
# `nixos-generate-config` does not detect mount options, so we add them here.
# https://nixos.wiki/wiki/Btrfs#Compression
fileSystems = {
"/".options = [ "compress=zstd" ];
};
networking.hostName = "yodaYoga"; networking.hostName = "yodaYoga";
services.openssh.ports = [ 2224 ]; services.openssh.ports = [ 2224 ];
boot.initrd.network.ssh.port = 2225; boot.initrd.network.ssh.port = 2225;

View File

@ -65,9 +65,39 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
]; ];
# Some programs need SUID wrappers, can be configured further or are # BTRFS compression.
# started in user sessions. #
# programs.mtr.enable = true; # `nixos-generate-config` does not detect mount options, so we add them here.
# https://nixos.wiki/wiki/Btrfs#Compression
fileSystems = {
"/".options = [ "compress=zstd" ];
};
# BTRFS scrub.
#
# Scrubbing is the process of checking file consistency.
# Scrubbing may be done "online", meaning you don't need to unmount a subvolume to scrub it.
# https://nixos.wiki/wiki/Btrfs#Scrubbing
# Btrfs scrub is "[a]n online filesystem checking tool. Reads all the data and metadata on the filesystem and uses checksums and the duplicate copies from RAID storage to identify and repair any corrupt data."
# https://wiki.archlinux.org/title/btrfs#Scrub
# The scrub command operates on a whole filesystem, not just individual subvolumes.
# https://unix.stackexchange.com/a/724412
#
# Manually:
# sudo btrfs scrub start /
# sudo btrfs scrub status /
# #=> UUID: 01f67928-9b35-48b2-aaa6-c58ff6c440a8
# #=> Scrub started: Sat Sep 16 12:54:47 2023
# #=> Status: finished
# #=> Duration: 0:00:42
# #=> Total to scrub: 64.43GiB
# #=> Rate: 1.53GiB/s
# #=> Error summary: no errors found
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [ "/" ];
};
nix.settings.auto-optimise-store = true; nix.settings.auto-optimise-store = true;