Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:zfs [2024/05/01 06:27] – [Linux ZFS] admin | linux:zfs [2025/02/05 12:49] (current) – [ZFS - notification] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Linux ZFS ====== | ====== Linux ZFS ====== | ||
+ | https:// | ||
< | < | ||
<code BASH> | <code BASH> | ||
Line 6: | Line 7: | ||
/dev/zvol/ | /dev/zvol/ | ||
├── rpool | ├── rpool | ||
- | │ ├── data | + | |
- | │ │ | + | │ |
- | │ │ | + | │ |
- | │ └── swap -> ../ | + | └── swap -> ../ |
- | └── tank | + | |
- | | + | zfs get all rpool/ |
- | ├── vm-100-disk-1-part1 -> ../ | + | zfs set compression=off rpool/data/subvol-111-disk-1 |
- | | + | |
- | ├── vm-100-disk-2 -> ../../zd64 | + | zfs get compressratio |
- | | + | NAME PROPERTY |
- | ├── vm-101-disk-1 -> ../../zd32 | + | rpool |
- | └── vm-101-disk-1-part1 -> ../ | + | rpool/ROOT compressratio |
+ | rpool/ROOT/pve-1 | ||
+ | rpool/data compressratio | ||
+ | rpool/data/subvol-110-disk-0 compressratio | ||
# start trim operation | # start trim operation | ||
Line 58: | Line 63: | ||
</ | </ | ||
++++ | ++++ | ||
+ | |||
+ | |||
+ | ===== ZFS - notification ===== | ||
+ | ++++ telegram notification zfs| | ||
+ | <code BASH> | ||
+ | # https:// | ||
+ | nano / | ||
+ | |||
+ | #!/bin/bash | ||
+ | TELEGRAM_BOT_TOKEN=" | ||
+ | TELEGRAM_CHAT_ID=" | ||
+ | |||
+ | subject=" | ||
+ | details=" | ||
+ | |||
+ | MESSAGE=" | ||
+ | Event: $subject | ||
+ | Details: | ||
+ | $details" | ||
+ | |||
+ | curl -s -X POST " | ||
+ | -d " | ||
+ | -d " | ||
+ | |||
+ | chmod +x / | ||
+ | |||
+ | # zed-functions.sh Modified zed_notify function | ||
+ | zed_notify() | ||
+ | { | ||
+ | zed_notify_email " | ||
+ | [ " | ||
+ | [ " | ||
+ | |||
+ | # Execute external Telegram script if it exists | ||
+ | if [ -x "/ | ||
+ | / | ||
+ | [ " | ||
+ | [ " | ||
+ | fi | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== ZFS backup ===== | ||
+ | |||
+ | <code bash> | ||
+ | # create file 20 gb | ||
+ | dd if=/ | ||
+ | # create pool on file | ||
+ | zpool create test / | ||
+ | |||
+ | |||
+ | # send data replication to local system | ||
+ | zfs send -vR rpool@snap1 | zfs receive | ||
+ | |||
+ | # send data of zpool to file | ||
+ | zfs send -vR rpool@snap1 > / | ||
+ | # recieve | ||
+ | zfs receive rpool < / | ||
+ | |||
+ | |||
+ | zpool attach rpool nvme-512GB_SSD_NJM358R015419P70GX-part3 ata-SPCC_Solid_State_Disk_AA230918S351201018-part3 | ||
+ | zpool remove rpool / | ||
+ | </ | ||
+ | |||
+ | ===== ZFS monitoring ===== | ||
+ | https:// | ||
+ | https:// | ||