linux:filesystem:zfs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:filesystem:zfs [2024/06/14 17:06] – gsys | linux:filesystem:zfs [2025/10/08 03:44] (current) – [Format NVMe with bigger sector size] gsys | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| </ | </ | ||
| - | ===== Cache ===== | + | ===== Adaptive Replacement |
| - | 1GB Cache per 1 TB Storage \\ | + | Rule of thumb: \\ |
| + | '' | ||
| Set Cache Min/ | Set Cache Min/ | ||
| Line 26: | Line 27: | ||
| < | < | ||
| update-initramfs -u && reboot | update-initramfs -u && reboot | ||
| + | </ | ||
| + | |||
| + | ===== Setups ===== | ||
| + | |||
| + | 4x NVMe as VM datastore (Hypervisor installed on nvme0n1 and nvme1n1) | ||
| + | < | ||
| + | zpool create -o ashift=12 -O compression=lz4 -O atime=off -O xattr=sa -O local-datastore-nvme01 mirror / | ||
| + | </ | ||
| + | |||
| + | Parameters | ||
| + | < | ||
| + | ashift=12 | ||
| + | autotrim=on | ||
| + | compression=lz4 | ||
| + | atime=off | ||
| + | xattr=sa | ||
| + | </ | ||
| + | |||
| + | by-id | ||
| + | < | ||
| + | zpool create -o ashift=12 -O compression=lz4 -O atime=off -O xattr=sa local-datastore-nvme01 \ | ||
| + | mirror / | ||
| + | mirror / | ||
| + | </ | ||
| + | ===== Delete ZFS Pool ===== | ||
| + | |||
| + | < | ||
| + | zpool destroy < | ||
| + | wipefs -a / | ||
| + | wipefs -a / | ||
| + | wipefs -a / | ||
| + | wipefs -a / | ||
| + | </ | ||
| + | |||
| + | ===== NVMe ===== | ||
| + | ==== Format NVMe with bigger sector size ==== | ||
| + | < | ||
| + | apt update && apt install nvme-cli | ||
| + | </ | ||
| + | |||
| + | Check column " | ||
| + | < | ||
| + | root@pve01: smartctl -a / | ||
| + | {...} | ||
| + | Supported LBA Sizes (NSID 0x1) | ||
| + | Id Fmt Data Metadt | ||
| + | 0 + | ||
| + | 1 - 4096 | ||
| + | {...} | ||
| + | </ | ||
| + | |||
| + | Format the device with bigger sector size. Column " | ||
| + | < | ||
| + | nvme format / | ||
| + | </ | ||
| + | |||
| + | Verify the change. | ||
| + | < | ||
| + | root@pve01: smartctl -a / | ||
| + | {...} | ||
| + | Supported LBA Sizes (NSID 0x1) | ||
| + | Id Fmt Data Metadt | ||
| + | 0 - | ||
| + | 1 + 4096 | ||
| + | {...} | ||
| + | </ | ||
| + | https:// | ||
| + | |||
| + | < | ||
| + | lsblk -d -o NAME, | ||
| + | nvme id-ns -H / | ||
| + | </ | ||
| + | |||
| + | ===== Misc ===== | ||
| + | |||
| + | ==== Remove orphaned pool ==== | ||
| + | |||
| + | Debian fails to start import service of an orphaned pool. | ||
| + | < | ||
| + | zpool set cachefile=/ | ||
| + | update-initramfs -k all -u | ||
| + | reboot | ||
| + | </ | ||
| + | |||
| + | check labels on disks | ||
| + | < | ||
| + | zdb -l / | ||
| </ | </ | ||
linux/filesystem/zfs.1718377562.txt.gz · Last modified: by gsys