diff --git a/README.md b/README.md index d37fca4..84a8a0c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,24 @@ # zfs +ZFS (Zettabyte File System) is a high-performance, open-source file system and volume manager known for its advanced features like data integrity, snapshots, compression, and pooled storage. It was originally developed by Sun Microsystems in 2001 and introduced in 2005 for Solaris, later evolving into OpenZFS for broader platform support. + +**🧠 Key Features of ZFS**: + +- **Pooled Storage Architecture**: Instead of managing individual volumes, ZFS uses storage pools (zpools) that aggregate multiple physical devices. This allows dynamic allocation of space to datasets without manual partitioning. +- **Copy-on-Write** (CoW): ZFS never overwrites data in place. When data is modified, it writes the new version to a new location and updates metadata, ensuring consistent snapshots and preventing corruption. +- **End-to-End Data Integrity**: ZFS checksums all data and metadata, automatically detecting and correcting silent data corruption using redundant copies. +- **Snapshots and Clones**: You can create instant, space-efficient snapshots of the file system. Clones allow writable copies of snapshots, useful for testing or backups. +- **Built-in RAID Support**: ZFS includes native support for various RAID levels (RAID-Z, RAID-Z2, RAID-Z3), eliminating the need for separate volume managers. +- **Compression and Deduplication**: ZFS supports transparent compression (e.g., LZ4, gzip) and optional deduplication to save space. +- **Scalability**: It supports massive storage capacities — up to 256 trillion yobibytes for volume size and 16 exbibytes for individual files + +## cli + ```bash #check status zpool status ``` -```bash -#check smart status -smartctl -a /dev/sdX -``` - ```bash #pool list zpool list -o name @@ -20,7 +29,20 @@ zpool list -o name zpool scrub poolname ``` -## health degrated +**check autotrim:** + +``` bash +zpool get autotrim rpool +``` + +*output example:* + +``` bash +NAME PROPERTY VALUE SOURCE +rpool autotrim off default +``` + +**health degrated:** First check if not smart errors @@ -28,3 +50,9 @@ First check if not smart errors # clear errors on zfs pool zpool clear poolname ``` + +**sync:** + +``` bash +sudo zfs set sync=standard rpool +``` diff --git a/docs/migrate-zfs-root-pool-and-boot-system-to-new-disk.md b/docs/migrate-zfs-root-pool-and-boot-system-to-new-disk.md new file mode 100644 index 0000000..6520a10 --- /dev/null +++ b/docs/migrate-zfs-root-pool-and-boot-system-to-new-disk.md @@ -0,0 +1,56 @@ +# How to Migrate a ZFS Root Pool and Boot System to a New Disk + +🪛 Goal + +Migrate boot system and ZFS root pool from one disk to another, preserving bootability and data integrity. + +Dont forget to Keep a rescue USB handy in case you need to recover the bootloader. + +**1. Partition the New Disk:** + +*Identify disks using lsblk or fdisk -l. and recreate partitions.* + + +**2. Format the EFI Partition:** + +if using UEFI boot: + +*Exemple using proxmox host os:* + +``` bash +proxmox-boot-tool format /dev/sdY2* +``` + +**3. Attach New Disk to ZFS Pool:** + +*This will mirror the pool temporarily:* + +``` bash +zpool attach rpool /dev/sdX3 /dev/sdY3 +``` + +**4. Wait for Resilvering:** + +*Monitor progress:* + +``` bash +zpool status rpool +``` + +**5. Detach Old Disk:** + +``` bash +zpool detach rpool /dev/sdX3 +``` + +**5. Update Boot Order:** + +*Ensure your BIOS/UEFI is set to boot from the new disk.* + +🧠 Notes + +If you don’t want to mirror temporarily, you can also: + +- Create a new ZFS pool on the new disk. +- Use zfs send | zfs receive to migrate datasets. +- Reconfigure bootloader manually.