Disk configuration for 'discernment'
home |
airgap |
charisma |
verve |
trail |
commitment |
discernment |
lore
For more info see 'discernment'.
sda (750GB)
WD-WX81A43N0219
sda1 (1GB)
/boot/efi
sda2 (2GB)
md0
sda3 (750GB)
rust
sdb (4TB)
K7GNY0ML
sdb1 (1GB)
/boot/efi
sdb2 (2GB)
md0
sdb3 (4TB)
data
sdc (4TB)
VBG5BA1R
sdc1 (1GB)
/boot/efi
sdc2 (2GB)
md0
sdc3 (4TB)
data
sdd (4TB)
K4K6MJ9B
sdd1 (1GB)
/boot/efi
sdd2 (2GB)
md0
sdd3 (4TB)
data
sde (500GB)
184220A00B57
sde1 (100GB)
md1
sde2 (400GB)
fast
sdf (500GB)
184301A00645
sdf1 (100GB)
md1
sdf2 (400GB)
fast
sdg (250GB)
182481801165
data:cache
fstab
Device |
Capacity |
File-system |
Mount |
md0p1 |
2GB |
ext4 |
/boot |
md1p1 |
100GB |
btrfs |
/ |
ZFS zpools
Pool |
RAID |
Capacity |
Compression |
Dedup |
fast |
RAID1 |
400GB |
lz4 |
on |
data |
RAIDZ |
8TB |
zstd |
on |
rust |
RAID0 |
750GB |
zstd |
on |
ZFS datasets
These are the datasets we create on our zpools.
Dataset |
Mount |
fast |
/fast |
fast/home |
/home |
fast/home/jj5 |
/home/jj5 |
fast/session |
/var/log/session |
data |
/data |
data/restore |
/data/restore |
data/opt |
/opt |
data/srv |
/srv |
data/git |
/var/git |
data/mailman |
/var/lib/mailman |
data/mysql |
/var/lib/mysql |
data/state |
/var/state |
data/svn |
/var/svn |
data/vmail |
/var/vmail |
data/www |
/var/www |
rust |
/rust |
Commands
Initial setup on 2023-03-02
#!/bin/bash
set -euo pipefail;
shopt -s dotglob;
RUST_DISK=/dev/disk/by-id/ata-WDC_WD7500BPKT-22PK4T0_WD-WX81A43N0219
FAST_DISK_1=/dev/disk/by-id/ata-WDC_WDS500G2B0B_184220A00B57
FAST_DISK_2=/dev/disk/by-id/ata-WDC_WDS500G2B0B_184301A00645
DATA_DISK_1=/dev/disk/by-id/ata-WDC_WD4002FFWX-68TZ4N0_K7GNY0ML
DATA_DISK_2=/dev/disk/by-id/ata-WDC_WD4003FFBX-68MU3N0_VBG5BA1R
DATA_DISK_3=/dev/disk/by-id/ata-WDC_WD4002FFWX-68TZ4N0_K4K6MJ9B
DATA_CACHE=/dev/disk/by-id/ata-WDC_WDS250G2B0B-00YS70_182481801165
apt install zfsutils-linux
zpool create -f \
-o ashift=12 -o autotrim=on \
-O acltype=posixacl -O compression=lz4 \
-O dnodesize=auto -O normalization=formD -O atime=off -O dedup=on \
-O xattr=sa \
fast mirror ${FAST_DISK_1}-part2 ${FAST_DISK_2}-part2
zpool create -f \
-O acltype=posixacl -O compression=zstd \
-O dnodesize=auto -O normalization=formD -O atime=off -O dedup=on \
-O xattr=sa \
data raidz ${DATA_DISK_1}-part3 ${DATA_DISK_2}-part3 ${DATA_DISK_3}-part3
zpool add data cache ${DATA_CACHE}
zpool create -f \
-O acltype=posixacl -O compression=zstd \
-O dnodesize=auto -O normalization=formD -O atime=off -O dedup=on \
-O xattr=sa \
rust ${RUST_DISK}-part3
zfs create fast/home
zfs create fast/home/jj5
zfs create fast/session
zfs set dedup=off fast/session
zfs set compression=zstd fast/session
zfs set mountpoint=/var/log/session fast/session
chmod 1777 /var/log/session
zfs create data/restore
zfs create data/opt
zfs set mountpoint=/opt data/opt
zfs create data/srv
zfs set mountpoint=/srv data/srv
zfs create data/git
zfs set mountpoint=/var/git data/git
zfs create data/mailman
zfs set mountpoint=/var/lib/mailman data/mailman
zfs create data/mysql
zfs set mountpoint=/var/lib/mysql data/mysql
zfs create data/state
zfs set mountpoint=/var/state data/state
zfs create data/svn
zfs set mountpoint=/var/svn data/svn
zfs create data/vmail
zfs set mountpoint=/var/vmail data/vmail
zfs create data/www
zfs set mountpoint=/var/www data/www
mv /home /home.bak
zfs set mountpoint=/home fast/home
chown jj5:jj5 /home/jj5
mv /home.bak/jj5/* /home/jj5/
rmdir /home.bak/jj5
rmdir /home.bak