about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-02-27 11:52:39 -0800
committerFranck Cuny <franck@fcuny.net>2022-02-27 13:05:31 -0800
commitbc2809fd9fd0ce8bb933090d29f9bd825dfeb16a (patch)
treee40b4c0a31373070818ce9c55665435b43b4910b
parentxdg: let's drop the mime configuration (diff)
downloadworld-bc2809fd9fd0ce8bb933090d29f9bd825dfeb16a.tar.gz
docs: add partition setup for the NAS
-rw-r--r--docs/install.org45
1 files changed, 43 insertions, 2 deletions
diff --git a/docs/install.org b/docs/install.org
index bad13a4..40ba5a8 100644
--- a/docs/install.org
+++ b/docs/install.org
@@ -77,6 +77,45 @@ Once the installation is completed:
 CUSTOMIZE_TIMESTAMP=$(date -u +%Y%m%dT%H%M%S)
 btrfs subvolume snapshot /mnt /mnt/.snapshots/$CUSTOMIZE_TIMESTAMP
 #+end_src
+** Partitions for the NAS
+Create the RAIDs:
+#+begin_src sh
+mdadm --create /dev/md/fast --level=mirror --raid-devices=2 /dev/sda /dev/sdb
+mdadm --create /dev/md/slow --level=mirror --raid-devices=2 /dev/sdc /dev/sde
+#+end_src
+
+Encrypt the RAIDs:
+#+begin_src sh
+cryptsetup --verify-passphrase -v luksFormat /dev/md/slow
+cryptsetup --verify-passphrase -v luksFormat /dev/md/fast
+#+end_src
+
+Then open them:
+#+begin_src sh
+cryptsetup open /dev/md/fast raid-fast
+cryptsetup open /dev/md/slow raid-slow
+#+end_src
+
+Create the filesystem:
+#+begin_src sh
+mkfs.btrfs /dev/mapper/raid-fast
+mkfs.btrfs /dev/mapper/raid-slow
+#+end_src
+
+Then we can mount them to generate the host configuration
+#+begin_src sh
+btrfs subvolume create /mnt/media
+btrfs subvolume create /mnt/containers
+umount /mnt
+
+mount -t btrfs /dev/mapper/raid-slow /mnt/
+btrfs subvolume create /mnt/backups
+mkdir /mnt/data/{backups,containers,media}
+mount -o subvol=media,compress=zstd,noatime,autodefrag /dev/mapper/raid-fast /mnt/data/media
+mount -o subvol=media,compress=zstd,noatime,autodefrag /dev/mapper/raid-fast /mnt/data/media
+mount -o subvol=containers,compress=zstd,noatime,autodefrag /dev/mapper/raid-fast /mnt/data/containers
+mount -o subvol=backups,compress=zstd,noatime,autodefrag /dev/mapper/raid-slow /mnt/data/backups
+#+end_src
 * Installing the system
 Let's add git and nixFlakes:
 #+begin_src sh
@@ -88,13 +127,15 @@ nixos-generate-config --root /mnt
 mkdir /mnt/root
 git clone https://git.fcuny.net/fcuny/world.git /mnt/root/world
 mkdir /mnt/root/world/hosts/<host name>
-cp /mn/etc/nixos/hardware-configuration.nix /mnt/root/hosts/hosts/<host name>/
+cp /mnt/etc/nixos/hardware-configuration.nix /mnt/root/world/hosts/<host name>/
 cp /mnt/root/world/hosts/aptos/default.nix /mnt/root/world/hosts/<host name>/
 vim /mnt/root/world/hosts/<host name>/default.nix
+cd /mnt/root/world
+git add hosts/tahoe
+cd /
 nixos-install --root /mnt --flake /mnt/root/world#<host name>
 #+end_src
 
-
 Create another snapshot
 #+begin_src sh
 CUSTOMIZE_TIMESTAMP=$(date -u +%Y%m%dT%H%M%S)