Disk configuration for 'duty'
home |
airgap |
charisma |
verve |
trail |
commitment |
discernment |
lore
For more info see 'duty'.
sda (500GB)
184220A00B57
sda1 (1GB)
/boot/efi
sda2 (2GB)
md0
sda3 (100GB)
md1
sda4 (363GB)
fast
sdb (500GB)
184301A00645
sdb1 (1GB)
/boot/efi
sdb2 (2GB)
md0
sdb3 (100GB)
md1
sdb4 (363GB)
fast
sdc (4TB)
K7GNY0ML
data
sdd (4TB)
VBG5BA1R
data
sde (4TB)
K4K6MJ9B
data
sdf (750GB)
WD-WX81A43N0219
rust
fstab
Device |
Capacity |
File-system |
Mount |
md0p1 |
2GB |
ext4 |
/boot |
md1p1 |
100GB |
btrfs |
/ |
sdf |
750GB |
ext4 |
/rust |
ZFS zpools
Pool |
RAID |
Capacity |
Compression |
Dedup |
fast |
RAID1 |
400GB |
lz4 |
on |
data |
RAIDZ |
8TB |
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 |
Commands
Initial setup on 2023-02-21
#!/bin/bash
set -euo pipefail;
shopt -s dotglob;
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
# 2023-02-21 jj5 - this will be added when the PCIe SATA adapter arrives
#DATA_CACHE=/dev/disk/by-id/
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}-part4 ${FAST_DISK_2}-part4
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} ${DATA_DISK_2} ${DATA_DISK_3}
#zpool add data cache ${DATA_CACHE}
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