Disk configuration for 'companion'

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


For more info see 'companion'.

nvme0n1 (500GB)
184634801586
/boot/efi
/boot (2GB)
/ (100GB)
fast:cache (32GB)
data:cache (64GB)
best (266GB)
sda (4TB)
V6GGTPKS
data
sdb (4TB)
V1JBN0GH
data
sdc (4TB)
V6H42DES
data
sdd (4TB)
V6GGRKVS
data
sde (1TB)
TBA
fast
sdf (1TB)
TBA
fast
sdg (1TB)
TBA
fast
sdh (1TB)
TBA
fast
Device Drive Model Commissioned Sequential Random WRL Temp °C Data Sheet
nvme0n1 WD Black 500GB NVMe SSD WDS500G2X0C-00L350 2019-03-11 1,469 MB/s 84 MB/s 300 TBW 0°C to 70°C download
sd[abcd] WD Ultrastar 4TB * HGST HUS726T4TALA6L4 2019-03-11 140 MB/s 2 MB/s 550TB/yr 5°C to 60°C download
sd[efgh] WD Blue SA510 1TB M.2 SATA SSD WDS100T3B0B TBA 369 MB/s 41 MB/s 400 TBW 0°C to 70°C download

fstab

When creating these don't mirror disks on the same disk controller.

Mount Capacity File-system
/boot 2GB ext4
/ 100GB btrfs

ZFS zpools

Pool RAID Capacity Compression Dedup
best RAID0 400GB lz4 on
fast RAID10 2TB lz4 on
data RAIDZ 12TB zstd on

ZFS datasets

These are the datasets we create on our zpools.

Dataset Mount Compression Dedup
fast /fast lz4 on
fast/home /home lz4 on
fast/home/jj5 /home/jj5 lz4 on
fast/mysql /var/lib/mysql lz4 off
fast/vbox /fast/vbox lz4 on
fast/session /var/log/session zstd off
data /data zstd on
data/archive /data/archive zstd on
data/backup /data/backup zstd on
data/blob /data/blob zstd on
data/host /data/host zstd on
data/image /data/image zstd on
data/share /data/share zstd on
data/temp /temp zstd on
data/temp/extract /temp/extract zstd on
data/temp/rubbish /temp/rubbish zstd on

Commands

Initial setup on 2023-01-21

#!/bin/bash

set -euo pipefail;

BEST_DISK=/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="${BEST_DISK}-part5"

apt install zfsutils-linux

zpool create \
    -o autotrim=on \
    -O acltype=posixacl -O compression=lz4 \
    -O dnodesize=auto -O normalization=formD -O atime=off -O dedup=on \
    -O xattr=sa \
    best "${BEST_DISK}-part6"

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

zpool add data cache ${DATA_CACHE}

zfs create best/fast
zfs set mountpoint=/fast best/fast
zfs create best/home
zfs create best/home/jj5
zfs create best/mysql
zfs set dedup=off best/mysql
zfs set mountpoint=/var/lib/mysql best/mysql
zfs create best/session
zfs set dedup=off best/session
zfs set compression=zstd best/session
zfs set mountpoint=/var/log/session best/session
chmod 1777 /var/log/session

zfs create data/archive
zfs create data/backup
zfs create data/blob
zfs create data/host
zfs create data/image
zfs create data/restore
zfs create data/share
zfs create data/temp
zfs set mountpoint=/temp data/temp
zfs create data/temp/extract
zfs create data/temp/rubbish

# 2023-01-21 jj5 - can move this from 'best' to 'fast' when we have those drives...
mv /home /home.bak
zfs set mountpoint=/home best/home
shopt -s dotglob;
chown jj5:jj5 /home/jj5
mv /home.bak/jj5/* /home/jj5/
rmdir /home.bak/jj5
rmdir /home.bak

  

TODO: 'fast' setup

#!/bin/bash

set -euo pipefail;

BEST_DISK=/dev/disk/by-id/nvme-WDS500G2X0C-00L350_184634801586

# 2023-01-21 jj5 - NOTE: we don't have these drives yet...
FAST_DISK_1=/dev/disk/by-id/TBA
FAST_DISK_2=/dev/disk/by-id/TBA
FAST_DISK_3=/dev/disk/by-id/TBA
FAST_DISK_4=/dev/disk/by-id/TBA

FAST_CACHE="${BEST_DISK}-part4"

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

zpool add fast cache ${FAST_CACHE}

zfs set mountpoint=/best/fast best/fast

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

zfs set mountpoint=/home.bak best/home
zfs set mountpoint=/home fast/home

mv /home.bak/jj5 /home/

zfs create fast/vbox

zfs create fast/mysql
zfs set dedup=off fast/mysql

service mysql stop

shopt -s dotglob;

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

mv /best/mysql/* /var/lib/mysql/

service mysql start

zfs set mountpoint=/best/session best/session

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

mv /best/session/* /var/log/session/

# 2023-01-21 jj5 - TODO: destroy unneeded 'best' file systems...
#zfs destroy best/mysql
#zfs destroy best/session