Disk configuration for 'companion'
home |
airgap |
charisma |
verve |
trail |
commitment |
discernment |
lore
For more info see 'companion'.
sde (1TB)
TBA
/boot/efi
md0 (1GB)
md1 (50GB)
best (100GB)
fast (700GB)
sdf (1TB)
TBA
/boot/efi
md0 (1GB)
md1 (50GB)
best (100GB)
fast (700GB)
sdg (1TB)
TBA
/boot/efi
md0 (1GB)
md1 (50GB)
best (100GB)
fast (700GB)
sdh (1TB)
TBA
/boot/efi
md0 (1GB)
md1 (50GB)
best (100GB)
fast (700GB)
sda (4TB)
V6GGTPKS
data
sdb (4TB)
V1JBN0GH
data
sdc (4TB)
V6H42DES
data
sdd (4TB)
V6GGRKVS
data
nvme0n1 (500GB)
184634801586
data:cache
MD RAID
Note: all MD RAID devices are used with a single partition.
Device |
RAID |
Components |
Capacity |
/dev/md0 |
RAID10 |
4x 1GB |
2GB |
/dev/md1 |
RAID10 |
4x 50GB |
100GB |
fstab
Partition |
Capacity |
File-system |
Mount point |
Mount options |
/dev/md0p1 |
2GB |
ext4 |
/boot |
noatime |
/dev/md1p1 |
100GB |
btrfs |
/ |
noatime |
ZFS zpools
Pool |
RAID |
Capacity |
Compression |
Dedup |
best |
RAID0 |
400GB |
off |
off |
fast |
RAID10 |
1.5TB |
lz4 |
on |
data |
RAIDZ |
12TB |
zstd |
on |
ZFS datasets
These are the datasets we create on our zpools.
Dataset |
Mount |
Compression |
Dedup |
best/temp |
/temp |
off |
off |
best/scratch |
/best/scratch |
off |
off |
best/stash |
/best/stash |
zstd |
on |
fast |
/fast |
lz4 |
on |
fast/home |
/home |
lz4 |
on |
fast/home/jj5 |
/home/jj5 |
lz4 |
on |
fast/mysql |
/var/lib/mysql |
lz4 |
off |
fast/session |
/var/log/session |
zstd |
off |
fast/vbox |
/fast/vbox |
lz4 |
on |
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/extract |
/temp/extract |
zstd |
on |
data/rubbish |
/temp/rubbish |
zstd |
on |
Commands
Initial setup on 2023-01-21
#!/bin/bash
set -euo pipefail;
FAST_DISK_1=/dev/disk/by-id/
FAST_DISK_2=/dev/disk/by-id/
FAST_DISK_3=/dev/disk/by-id/
FAST_DISK_4=/dev/disk/by-id/
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=/dev/disk/by-id/nvme-WDS500G2X0C-00L350_184634801586
apt install zfsutils-linux
zpool create -f \
-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 "${FAST_DISK_1}-part4" "${FAST_DISK_2}-part4" "${FAST_DISK_3}-part4" "${FAST_DISK_4}-part4"
zpool create -f \
-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}-part5" "${FAST_DISK_2}-part5" mirror "${FAST_DISK_3}-part5" "${FAST_DISK_4}-part5"
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/temp
zfs set mountpoint=/temp best/temp
zfs create best/scratch
zfs create best/stash
zfs set dedup=on best/stash
zfs set compression=zstd best/stash
zfs create fast/home
zfs create fast/home/jj5
zfs create fast/mysql
zfs set dedup=off 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 fast/vbox
zfs create data/archive
zfs create data/backup
zfs create data/blob
zfs create data/copy
zfs create data/host
zfs create data/image
zfs create data/restore
zfs create data/share
zfs create data/extract
zfs set mountpoint=/temp/extract data/extract
zfs create data/rubbish
zfs set mountpoint=/temp/rubbish data/rubbish
mv /home /home.bak
zfs set mountpoint=/home fast/home
chown jj5:jj5 /home/jj5
shopt -s dotglob;
mv /home.bak/jj5/* /home/jj5/
rmdir /home.bak/jj5
rmdir /home.bak