linux:zfs

Linux ZFS

https://lepkov.ru/zfs-cheatsheet/ backup https://habr.com/ru/companies/macloud/articles/547056/
<https://denisbondar.github.io/post/zfs-manual-rus/> - manual <https://xakep.ru/2014/07/08/zfs-at-home/#toc07.> old one

# zfs pools and mount points
tree /dev/zvol/
/dev/zvol/
├── rpool
    ├── data
    │   ├── vm-100-disk-1 -> ../../../zd0
    │   └── vm-100-disk-1-part1 -> ../../../zd0p1
    └── swap -> ../../zd16
 
zfs get all rpool/data/subvol-111-disk-1  | grep com
zfs set compression=off rpool/data/subvol-111-disk-1
 
zfs get compressratio
NAME                          PROPERTY       VALUE  SOURCE
rpool                         compressratio  1.07x  -
rpool/ROOT                    compressratio  1.78x  -
rpool/ROOT/pve-1              compressratio  1.78x  -
rpool/data                    compressratio  1.06x  -
rpool/data/subvol-110-disk-0  compressratio  1.77x  -
 
 
# start trim operation
 zpool trim rpool
# show status
 zpool status -t rpool

Recompress zfs

# create file  20 gb
dd if=/dev/zero of=/mnt/sdb3/zpool_test bs=1G count=20
# create pool on file 
zpool create test /mnt/sdb3/zpool_test
 
 
# send data replication to local  system 
 zfs send -vR rpool@snap1 | zfs receive  test -F
 
# send data of zpool to file 
zfs send -vR rpool@snap1 > /mnt/pve/backup/zfs-pve-rpool-20240624.backup
# recieve 
zfs receive rpool < /mnt/pve/backup/zfs-pve-rpool-20240624.backup
 
 
zpool attach rpool nvme-512GB_SSD_NJM358R015419P70GX-part3 ata-SPCC_Solid_State_Disk_AA230918S351201018-part3
zpool remove rpool /mnt/sdb3/zpool_mirror1_1
  • linux/zfs.txt
  • Last modified: 2024/07/14 12:00
  • by admin