2.2 KiB
2.2 KiB
ariane
Hard disks
| V1 | V2 | V3 | V4 | |
|---|---|---|---|---|
| H1 | 00 /dev/sda 6TB WD-WX21D36PP32E |
04 | 08 | 12 |
| H2 | 01 /dev/sdb 6TB WD-WX21D36PPLPH |
05 | 09 | 13 |
| H3 | 02 /dev/sdc 6TB WD-WX21D36PP0K1 |
06 | 10 | 14 |
| H4 | 03 /dev/sdd 6TB WD-WXB1HB4MJCMM |
07 | 11 | 15 |
Install ZFS
apt-get install zfsutils-linux
modprobe zfs
systemctl restart zfs-import-cache
systemctl restart zfs-import-scan
systemctl restart zfs-mount
systemctl restart zfs-share
Initial ZFS Setup
Find disk serial numbers
for i in a b c d e f g; do echo -n "/dev/sd$i: "; hdparm -I /dev/sd$i | awk '/Serial Number/ {print $3}'; done
Wipe disks
mdadm --zero-superblock --force /dev/sda
sgdisk --zap-all /dev/sdX
Partition disks
sgdisk -n1:0:0 -t1:BF01 /dev/sdX
Create zpool
zpool create -o ashift=12 -O atime=off -O compression=lz4 \
zv1 raidz2 \
/dev/disk/by-id/ata-WDC_WD60EFRX-68L0BN1_WD-WX21D36PP32E-part1 \
/dev/disk/by-id/ata-WDC_WD60EFRX-68L0BN1_WD-WX21D36PPLPH-part1 \
/dev/disk/by-id/ata-WDC_WD60EFRX-68L0BN1_WD-WX21D36PP0K1-part1 \
/dev/disk/by-id/ata-WDC_WD60EFRX-68L0BN1_WD-WXB1HB4MJCMM-part1
Create datasets
zfs create zv1/homes
zfs create zv1/daten
zfs create zv1/fotos
Set dataset quota
zfs set quota=1T zv1/daten zv1/fotos zv1/homes
Transfer data
rsync --stats -avhP --exclude Pictures root@atlas:/mnt/save/fet_daten/ /zv1/daten/
rsync --stats -avhP root@atlas:/mnt/save/fet_daten/Pictures/ /zv1/fotos/
rsync --stats -avhP root@atlas:/home/ /zv1/homes/
Before reinstalling
zfs export
After reinstalling
zfs import
Add 2GB log partition on ssd
zpool add zv1 log mirror /dev/nvme0n1p2 /dev/nvme1n1p2
If intend using ACL (not done!)
zfs set xattr=sa <dataset>
zfs set acltype=posixacl <dataset>
ZFS Maintenance
zpool status -v
zpool list -v
zpool get all
zpool history
zpool scrub zv1
MDADM Maintenance
mdadm --misc --detail /dev/md0
echo check > /sys/block/md0/md/sync_action
watch -n 0.1 cat /proc/mdstat