ZFS
migration
These commands will migrate one zfs pool to another server using netcat
zfs snapshot -r data@migrate_20200215
zfs list -t snapshot
zfs send -R data@migrate_20200215 | nc -l 3333
On the remote server you can execute
nc 10.7.10.71 3333 | zfs recv -Fd data
The version with netcat performed with much higher transfere speed than if you would use ssh.
installation
apt install lsscsi hddtemp lm-sensors vim htop screen mpt-status smartmontools parted lsof hdparm zfsutils-linux -y
Clean disks
wipefs -a /dev/sdb
RAIDZ1
zpool create data raidz1 sdb sdi sdq raidz1 sdc sdj sdr raidz1 sdd sdk sds raidz1 sde sdl sdt raidz1 sdf sdm sdu raidz1 sdg sdn sdv raidz1 sdh sdo sdw
RAIDZ2
zpool create data raidz2 sdb sdc sdy sdz sdq sdr raidz2 sdd sde sdw sdx sdo sdp raidz2 sdf sdg sdu sdv sdm sdn raidz2 sdh sdi sdk sdl sds sdt
zfs set compression=zstd data
zpool export data
zpool import -d /dev/disk/by-id data
zfs set mountpoint=/var/lib/docker data
zfs set mountpoint=none data
zfs get mountpoint data
pool
replace
blkid
lsblk -r|awk 'NR==1{print $0" DEVICE-ID(S)"}NR>1{dev=$1;printf $0" ";system("find /dev/disk/by-id -lname \"*"dev"\" -printf \" %p\"");print "";}'
sdb 8:16 0 2.7T 0 disk /dev/disk/by-id/wwn-0x5000cca0585fdc44 /dev/disk/by-id/scsi-35000cca0585fdc44
zpool offline data 8254740297691293767
zpool replace data 8254740297691293767 /dev/disk/by-id/wwn-0x5000cca0585fdc44