Disk configuration for 'trick'

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


For more info see 'trick'.

nvme0n1 (1TB)
S3ETNX0HC08620Y
best
sda (512G)
S2BENWAJ207751D
sda1 (1G)
/boot/efi
sda2 (2G)
md0
sda3 (100G)
md1
sda4 (16G)
data:cache
sda5 (360G)
fast
sdb (512G)
S2BENWAJ207761X
sdb1 (1G)
[unused]
sdb2 (2G)
md0
sdb3 (100G)
md1
sdb4 (16G)
data:cache
sdb5 (360G)
fast
sdc (6TB)
WSB076SN
data
sdd (6TB)
ZA16N4ZH
data
Drive Description Model Commissioned Sequential Random WRL
nvme0n1 Samsung SSD 960 EVO 1TB Samsung SSD 960 EVO 1TB 2017-04-18 1,276 MB/s 80 MB/s 400 TBW
sd[ab] Samsung SSD 850 PRO 512GB Samsung SSD 850 PRO 512GB 2017-04-18 407 MB/s 57 MB/s 150 TBW
sdc Seagate BarraCuda Compute 6TB ST6000DM003-2CY186 2022-09-16 102 MB/s 2.29 MB/s 55 TB/yr
sdd Seagate IronWolf 6TB ST6000VN0041-2EL11C 2017-04-18 186 MB/s 2 MB/s 180 TB/yr

MD RAID

Note: all MD RAID devices are used with a single partition.

Device RAID Components Capacity
/dev/md0 RAID1 2x 2GB 2GB
/dev/md1 RAID1 2x 100GB 100GB

Mounts

Partition Capacity File-system Mount point Mount options
/dev/sda1 1GB vfat /boot/efi defaults
/dev/md0p1 2GB ext4 /boot noatime
/dev/md1p1 100GB btrfs / noatime

ZFS zpools

Pool RAID Components Capacity
fast RAID1 2x 377GB 377GB
data RAID1 2x 6TB 6TB
best RAID0 1x 1TB 1TB

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/session /var/log/session zstd off
data /data zstd on
data/backup /data/backup zstd on
data/host /data/host zstd on
best /best off off
best/mysql /var/lib/mysql off off

Commands

#!/bin/bash

set -euo pipefail;

DISK1=/dev/disk/by-id/nvme-Samsung_SSD_960_EVO_1TB_S3ETNX0HC08620Y
DISK2A=/dev/disk/by-id/ata-Samsung_SSD_850_PRO_512GB_S2BENWAJ207751D
DISK2B=/dev/disk/by-id/ata-Samsung_SSD_850_PRO_512GB_S2BENWAJ207761X
DISK3A=/dev/disk/by-id/scsi-SATA_ST6000DM003-2CY1_WSB076SN
DISK3B=/dev/disk/by-id/scsi-SATA_ST6000VN0041-2EL_ZA16N4ZH


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 mirror ${DISK2A}-part5 ${DISK2B}-part5

zpool create \
    -O acltype=posixacl -O compression=zstd \
    -O dnodesize=auto -O normalization=formD -O atime=off -O dedup=on \
    -O xattr=sa \
    data mirror ${DISK3A} ${DISK3B}

zpool create \
    -o ashift=12 -o autotrim=on \
    -O acltype=posixacl -O compression=off \
    -O dnodesize=auto -O normalization=formD -O atime=off -O dedup=off \
    -O xattr=sa \
    best ${DISK1}

zpool add data cache ${DISK2A}-part4
zpool add data cache ${DISK2B}-part4

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/backup
zfs create data/backup/database
zfs set dedup=off data/backup/database
zfs set compression=off data/backup/database
zfs create data/backup/longing
zfs create data/backup/longing/archive
zfs create data/backup/longing/blob
zfs create data/backup/longing/blob/zip
zfs set dedup=off data/backup/longing/blob/zip
zfs set compression=off data/backup/longing/blob/zip
zfs create data/backup/longing/image
zfs set dedup=off data/backup/longing/image
zfs set compression=off data/backup/longing/image
zfs create data/backup/longing/share
zfs create data/host

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

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/