[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/04: berlin: Migrate root file system to SAN storage.
From: |
Maxim Cournoyer |
Subject: |
04/04: berlin: Migrate root file system to SAN storage. |
Date: |
Sat, 30 Jul 2022 09:04:33 -0400 (EDT) |
apteryx pushed a commit to branch wip-san-migration
in repository maintenance.
commit ea4526070eb939da84d0a37e3b23e0a2d1b86b1f
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Fri Jul 29 15:19:46 2022 -0400
berlin: Migrate root file system to SAN storage.
Farewell, inodes exhaustion...
---
hydra/berlin.scm | 99 +++++++++++++++++++++++---------------------------------
1 file changed, 40 insertions(+), 59 deletions(-)
diff --git a/hydra/berlin.scm b/hydra/berlin.scm
index 851d233..1babce2 100644
--- a/hydra/berlin.scm
+++ b/hydra/berlin.scm
@@ -170,13 +170,16 @@ Happy hacking!\n"))
;;;
-;;; Btrfs RAID10 array.
+;;; Btrfs pools.
;;;
;;; 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-ssd-uuid "16ff18e1-eb41-4224-8df6-80d3b53c411a")
-(define %btrfs-raid-uuid "16ff18e1-eb41-4224-8df6-80d3b53c411a")
+;;; This is one large Btrfs partition on the MDC-provided SAN storage
+;;; (100 TiB).
+(define %btrfs-san-uuid "d5d1a040-7f2a-4c38-9a89-82f08866f6ec")
;;; TODO: Implement some mcron job that monitors the absent of a disk
;;; in the array, or IO related errors in dmesg, so that we can notice
@@ -185,48 +188,37 @@ Happy hacking!\n"))
("space_cache" . "v2")
"degraded"))
-;;; Top-level Btrfs subvolume.
-(define %btrfs-pool
+(define %btrfs-pool-san
(file-system
;; This is required by the 'btrbk' backup tool.
- (device (uuid %btrfs-raid-uuid))
- (mount-point "/mnt/btrfs-pool")
+ (device (uuid %btrfs-san-uuid))
+ (mount-point "/mnt/btrfs-pool-san")
(type "btrfs")
(options (alist->file-system-options
(cons '("subvolid" . "5")
%common-btrfs-options)))))
-;;; Root Btrfs subvolume.
-(define @root
+(define %btrfs-pool-ssd
(file-system
- (device (uuid %btrfs-raid-uuid))
- (mount-point "/new-root")
+ ;; This is required by the 'btrbk' backup tool.
+ (device (uuid %btrfs-ssd-uuid))
+ (mount-point "/mnt/btrfs-pool-ssd")
(type "btrfs")
(options (alist->file-system-options
- (cons '("subvol" . "@root")
+ (cons '("subvolid" . "5")
%common-btrfs-options)))))
-;;; Home Btrfs subvolume.
-(define @home
+(define (btrfs-subvolume-mount device-uuid name mount-point)
+ "Return a file system to mount the Btrfs subvolume NAME on DEVICE-UUID
+at MOUNT-POINT."
(file-system
- (device (uuid %btrfs-raid-uuid))
- (mount-point "/home")
+ (device (uuid device-uuid))
+ (mount-point mount-point)
+ (create-mount-point? #t)
(type "btrfs")
(options (alist->file-system-options
- (cons '("subvol" . "@home")
- %common-btrfs-options)))
- (dependencies (list @root))))
-
-;;; Cache Btrfs subvolume.
-(define @cache
- (file-system
- (device (uuid %btrfs-raid-uuid))
- (mount-point "/var/cache")
- (type "btrfs")
- (options (alist->file-system-options
- (cons '("subvol" . "@cache")
- %common-btrfs-options)))
- (dependencies (list @root))))
+ (cons (cons "subvol" name)
+ %common-btrfs-options)))))
(define (anonip-service file)
(service anonip-service-type
@@ -245,18 +237,15 @@ Happy hacking!\n"))
;; management interface can only be accessed through selected
;; servers within the MDC campus network.
(kernel-arguments '("console=tty0"
- "console=ttyS0,115200"
- ;; As the initrd lacks any device
- ;; synchronization support, give enough time for
- ;; the storage devices to be up before
- ;; attempting to assemble and mount the root
- ;; file system.
- "rootdelay=20"))
+ "console=ttyS0,115200"))
;; The Dell server need these kernel modules for the
;; RAID controller.
(initrd-modules (append (list "megaraid_sas" "scsi_transport_sas"
- "mpt3sas" "libsas")
+ "mpt3sas" "libsas"
+ ;; Suggested by 'guix system init' for
+ ;; the SAN storage.
+ "qla2xxx")
%base-initrd-modules))
;; Show the GRUB menu on the serial interface.
@@ -271,30 +260,22 @@ Happy hacking!\n"))
(mount-point "/boot/efi")
(device (uuid "E1B3-BF92" 'fat)) ;/dev/sdi1
(type "vfat"))
- ;; The root file system resides on just a single
- ;; disk, no RAID :-/
- (file-system
- (device (file-system-label "my-root"))
- (mount-point "/")
- (type "ext4"))
- ;; This is a large external storage array
- ;; connected via 2 HBA cards. We only mount it
- ;; through one of the HBA cards. We would need
- ;; to use multipathd otherwise.
+
+ (btrfs-subvolume-mount %btrfs-san-uuid "@root" "/")
+
+ (btrfs-subvolume-mount %btrfs-ssd-uuid "@home" "/home")
+ (btrfs-subvolume-mount %btrfs-ssd-uuid "@cache" "/var/cache")
+
+ ;; For convenience.
+ %btrfs-pool-san
+ %btrfs-pool-ssd
(file-system
- (device (uuid "a6455b66-59d2-40bd-bddb-0c572bb62a2f"))
- (mount-point "/gnu")
+ ;; This is device holding the old root file system,
+ ;; /dev/sdg1.
+ (device (uuid "76954008-06cf-4b91-b0bb-316d8bab0576"))
+ (mount-point "/mnt/old-root-fs")
(type "ext4"))
- ;; Access root file system without bind mounts.
- (file-system
- (device "/")
- (mount-point "/mnt/root-fs")
- (flags '(bind-mount))
- (type "none"))
- %btrfs-pool
- @root
- @home
- @cache
+
%base-file-systems))
;; Local admin account for MDC maintenance.