Differences between revisions 4 and 5
Revision 4 as of 2022-11-16 23:40:48
Size: 2059
Editor: SamatJain
Comment:
Revision 5 as of 2023-01-18 09:29:35
Size: 2144
Editor: SamatJain
Comment: zdb
Deletions are marked like this. Additions are marked like this.
Line 42: Line 42:
## show pool information from member device, e.g. /dev/sde
sudo zdb -l /dev/sde1

   1 # ZFS
   2 
   3 DRIVES=$(echo /dev/sd{a..j})
   4 
   5 for i in $DRIVES; do
   6     # Clear any existing partition table
   7     echo sudo sgdisk --zap-all $i
   8     echo sudo sgdisk --largest-new=1 $i
   9 done
  10 
  11 # TODO: should give whole disks to ZFS
  12 
  13 DRIVE_PARTITIONS=$(echo /dev/sd{e,d,c,f,h,g,i,j}1)
  14 
  15 NAME=archive
  16 
  17 CACHE_DISKS="nvme-SAMSUNG_MZQL2960HCJR-00A07*-part3"
  18 DATA_DISKS="ata-TOSHIBA_MG08ACA16TEY_*"
  19 
  20 ## create main array, 1-disk party raidz
  21 # use ashift=12 for 4K sector disks
  22 sudo zpool create -o ashift=12 -f $NAME raidz /dev/disk/by-id/${DATA_DISKS}
  23 
  24 # no parity disk raid0 equivalent
  25 sudo zpool create -o ashift=12 -f $NAME /dev/disk/by-id/${DATA_DISKS}
  26 
  27 ## add cache
  28 sudo zpool add -f $NAME cache /dev/disk/by-id/${CACHE_DISKS}
  29 
  30 ## list devices
  31 zpool status -v
  32 
  33 sudo zfs set xattr=sa ${NAME}
  34 sudo zfs set compression=lz4 ${NAME}
  35 sudo zfs set atime=off ${NAME}
  36 sudo zfs set relatime=off ${NAME}
  37 # See https://blog.programster.org/zfs-record-size about setting recordsize
  38 #sudo zfs set recordsize=16K ${NAME}  # For BitTorrent
  39 #sudo zfs set recordsize=1M ${NAME}   # For long-term storage
  40 
  41 ## show pool information from member device, e.g. /dev/sde
  42 sudo zdb -l /dev/sde1
  43 
  44 
  45 ROOT=/mnt
  46 
  47 mount /dev/md1 /mnt
  48 mount /dev/md0 /mnt/boot
  49 mount -o bind /proc /mnt/proc
  50 mount -o bind /sys /mnt/sys
  51 mount -o bind /run /mnt/run
  52 mount -o bind /dev /mnt/dev
  53 
  54 installimage -n geta -r yes -l 1 -p /boot:ext3:1G,/:xfs:128G -f yes -t yes -d nvme0n1,nvme1n1 -i /root/images/Debian-1101-bullseye-amd64-base.tar.gz

References

https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/

https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Workload%20Tuning.html#bit-torrent

ZFS RAIDZ stripe width, or: How I Learned to Stop Worrying and Love RAIDZ: Use RAID-Z. Not too wide. Enable compression.

dRAID, Finally!: Intro to dRAID, ZFS RAID w/ fixed record size to enable faster resilvers.

SamatsWiki: ZFS (last edited 2023-09-29 23:02:16 by SamatJain)