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 [2025/10/07 22:42] – [Setups] gsys | linux:filesystem:zfs [2025/10/08 03:44] (current) – [Format NVMe with bigger sector size] gsys | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| </ | </ | ||
| - | ==== Setups ==== | + | ===== Setups |
| 4x NVMe as VM datastore (Hypervisor installed on nvme0n1 and nvme1n1) | 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 normalization=formD datastore-nvme01 mirror / | + | zpool create -o ashift=12 -O compression=lz4 -O atime=off -O xattr=sa -O local-datastore-nvme01 mirror / |
| + | </ | ||
| + | |||
| + | Parameters | ||
| + | < | ||
| + | ashift=12 # Aligns to 4K sectors (SSD optimal) | ||
| + | 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.1759869773.txt.gz · Last modified: by gsys