about summary refs log tree commit diff
path: root/docs/install.org
diff options
context:
space:
mode:
Diffstat (limited to 'docs/install.org')
-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)