Disk configuration for 'companion'

home | airgap | charisma | verve | trail | commitment | discernment | lore


For more info see 'companion'.

sdg (250GB)
182481804949
sdg1 (1MB)
grub
sdg2 (2GB)
md0
sdg3 (128GB)
md1
sdg4 (102GB)
data:cache
sdh (250GB)
182481801165
sdh1 (1MB)
grub
sdh2 (2GB)
md0
sdh3 (128GB)
md1
sdh4 (102GB)
data:cache
sde (500GB)
184220A00B57
fast
sdf (500GB)
184301A00645
fast
nvme0n1 (500GB)
184634801586
fast
sda (4TB)
V6GGTPKS
data
sdb (4TB)
V1JBN0GH
data
sdc (4TB)
V6H42DES
data
sdd (4TB)
V6GGRKVS
data
Drive Description Model Commissioned Sequential Random WRL
sd[gh] WD Blue 250GB SATA SSD WDC WDS250G2B0B-00YS70 2019-03-21 304 MB/s 47 MB/s 100 TBW
nvme0n1 WD Black 500GB NVMe SSD WDS500G2X0C-00L350 2019-03-11 1,469 MB/s 84 MB/s 300 TBW
sd[ef] WD Blue 500GB SATA SSD WDC WDS500G2B0B 2019-03-11 388 MB/s 56 MB/s 200 TBW
sd[abcd] WD Ultrastar 4TB * HGST HUS726T4TALA6L4 2019-03-11 140 MB/s 2 MB/s 550TB/yr

fstab

Device RAID Capacity File-system Mount
md0 RAID1 2GB ext4 /boot
md1 RAID1 128GB btrfs /

ZFS zpools

Pool RAID Capacity Compression Dedup
fast RAIDZ 1TB lz4 on
data RAIDZ 12TB zstd on

ZFS datasets

These are the datasets we create on our zpools.

Dataset Mount Note
fast /fast
fast/home /home
fast/home/jj5 /home/jj5
fast/vbox /fast/vbox
fast/session /var/log/session
data /data
data/host /data/host
data/mysql /var/lib/mysql

Commands

Initial setup on 2022-12-??

#!/bin/bash

set -euo pipefail;

FAST_DISK_1=/dev/disk/by-id/scsi-SATA_WDC_WDS500G2B0B_184220A00B57
FAST_DISK_2=/dev/disk/by-id/scsi-SATA_WDC_WDS500G2B0B_184301A00645
FAST_DISK_3=/dev/disk/by-id/nvme-WDS500G2X0C-00L350_184634801586

DATA_DISK_1=/dev/disk/by-id/scsi-SATA_HGST_HUS726T4TAL_V6GGTPKS
DATA_DISK_2=/dev/disk/by-id/scsi-SATA_HGST_HUS726T4TAL_V1JBN0GH
DATA_DISK_3=/dev/disk/by-id/scsi-SATA_HGST_HUS726T4TAL_V6H42DES
DATA_DISK_4=/dev/disk/by-id/scsi-SATA_HGST_HUS726T4TAL_V6GGRKVS

DATA_CACHE_1=/dev/disk/by-id/scsi-SATA_WDC_WDS250G2B0B-_182481804949-part4
DATA_CACHE_2=/dev/disk/by-id/scsi-SATA_WDC_WDS250G2B0B-_182481801165-part4

apt install zfsutils-linux

zpool create \
    -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 raidz ${FAST_DISK_1} ${FAST_DISK_2} ${FAST_DISK_3}

zpool create \
    -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} ${DATA_DISK_4}

zpool add data cache ${DATA_CACHE_1}
zpool add data cache ${DATA_CACHE_2}

zfs create fast/home
zfs create fast/home/jj5
zfs create fast/vbox

zfs create fast/mysql
zfs set mountpoint=/var/lib/mysql fast/mysql

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/host

mv /home /home.bak

zfs set mountpoint=/home fast/home

chown jj5:jj5 /home/jj5
mv /home.bak/jj5/.[!.]* /home/jj5/
#mv /home.bak/jj5/* /home/jj5/
rmdir /home.bak/jj5
rmdir /home.bak