guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: berlin: Expose the new Btrfs RAID10 array.


From: Maxim Cournoyer
Subject: 03/03: berlin: Expose the new Btrfs RAID10 array.
Date: Wed, 26 Jan 2022 14:49:16 -0500 (EST)

apteryx pushed a commit to branch master
in repository maintenance.

commit 24719b0e533c3220ea3f53be07c5e329d24cd044
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Wed Jan 26 13:58:26 2022 -0500

    berlin: Expose the new Btrfs RAID10 array.
    
    Temporarily expose the @root and @home subvolumes as /new-root and
    /new-home, respectively.
    
    * hydra/berlin.scm (%btrfs-raid-uuid): New variable.
    (%common-btrfs-options): Likewise.
    (%btrfs-pool): Likewise.
    (@root): Likewise.
    (@home): Likewise.
    (file-systems): Add %btrfs-pool, @root and @home.
---
 hydra/berlin.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 2fac61c..5ffba94 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -6,6 +6,7 @@
 ;; Copyright © 2020, 2021 Florian Pelz <pelzflorian@pelzflorian.de>
 ;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe@gnu.org>
 ;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;; Released under the GNU GPLv3 or any later version.
 
 (use-modules (gnu) (guix) (sysadmin services) (sysadmin people) (sysadmin dns)
@@ -166,6 +167,54 @@ Happy hacking!\n"))
          (file-name "/var/cache/guix/publish"))))
 
 
+;;;
+;;; Btrfs RAID10 array.
+;;;
+;;; This Btrfs storage array is composed of six (6) Samsung 870 QVO
+;;; SSDs of 8 TB each; configured to use the raid1c4 Btrfs profile for
+;;; metadata and raid10 for data.
+
+(define %btrfs-raid-uuid "16ff18e1-eb41-4224-8df6-80d3b53c411a")
+
+;;; TODO: Honor rootflags in the initrd, then remove degraded (see:
+;;; https://issues.guix.gnu.org/40998).
+(define %common-btrfs-options '(("compress-force" . "zstd")
+                                ("space_cache" . "v2")
+                                "degraded"))
+
+;;; Top-level Btrfs subvolume.
+(define %btrfs-pool
+  (file-system
+    ;; This is required by the 'btrbk' backup tool.
+    (device (uuid %btrfs-raid-uuid))
+    (mount-point "/mnt/btrfs-pool")
+    (type "btrfs")
+    (options (alist->file-system-options
+              (cons '("subvolid" . "5")
+                    %common-btrfs-options)))))
+
+;;; Root Btrfs subvolume.
+(define @root
+  (file-system
+    (device (uuid %btrfs-raid-uuid))
+    (mount-point "/new-root")
+    (type "btrfs")
+    (options (alist->file-system-options
+              (cons '("subvol" . "@root")
+                    %common-btrfs-options)))))
+
+;;; Home Btrfs subvolume.
+(define @home
+  (file-system
+    (device (uuid %btrfs-raid-uuid))
+    (mount-point "/new-home")
+    (type "btrfs")
+    (options (alist->file-system-options
+              (cons '("subvol" . "@home")
+                    %common-btrfs-options)))
+    (dependencies (list @root))))
+
+
 (operating-system
   (host-name "berlin.guix.gnu.org")
   (timezone "Europe/Berlin")
@@ -218,6 +267,9 @@ Happy hacking!\n"))
                    (mount-point "/mnt/root-fs")
                    (flags '(bind-mount))
                    (type "none"))
+                 %btrfs-pool
+                 @root
+                 @home
                  %base-file-systems))
 
   ;; Local admin account for MDC maintenance.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]