Differences between revisions 1 and 2
Revision 1 as of 2023-07-20 01:13:32
Size: 1340
Comment:
Revision 2 as of 2023-07-20 02:00:04
Size: 2565
Comment:
Deletions are marked like this. Additions are marked like this.
Line 41: Line 41:
----



== Pools ==

The lowest level of ZFS is '''pools'''.

Identify disks by their IDs like:

{{{
$ ls -lh /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-ABCDE
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-FGHIJ
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-KLMNO
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-PQRST
}}}

With these 4 drives of ''N'' GB storage each, create a '''RAIDz2''' pool where ''2N'' GB will be dedicated to parity rather than storage. The pool will be fault tolerant for up to 2 failed drives.

{{{
zpool create -f tank raidz2 ata-ABCDE ata-FGHIJ ata-KLMNO ata-PQRST
}}}

Alternatively create a '''RAIDz1''' pool where just ''N'' GB will be dedicated to parity (but the pool will only be fault tolerant of 1 drive failure).

''Alternatively'' alternatively, create a '''Mirror''' pool to maximize fault tolerance (up to 3 failed drives) but leaving just ''N'' GB of storage.

Pools can be created with encryption, but it is not recommended. A pool's encryption setting is inherited, so the pool is permanently locked to this singular cryptographic algorithm.

The pool will be mounted to a root-level directory named after the pool (`/tank` in this case).

OpenZFS

OpenZFS, formerly ZFS on Linux, is a project aimed at bringing the ZFS file system to the Linux kernel.

If using a BSD, ZFS should be supported out of the box.


Installation

Arch

The first step is almost always downgrading the kernel.

version=major.minor.patch-release
sudo pacman -U https://archive.archlinux.org/packages/l/linux-lts/linux-lts-$version-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/l/linux-lts-headers/linux-lts-headers-$version-x86_64.pkg.tar.zst
sudo mkinitcpio -P
sudo grub-mkconfig -o /boot/grub/grub.cfg

To determine which kernel version is supported, try installing ZFS from the unofficial repository.

sudo pacman-key -r DDF7DB817396A49B2A2723F7403BD972F75D9D76
sudo pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76
sudo bash -c 'echo "[archzfs]\nServer = https://archzfs.com/$repo/$arch\n" >> /etc/pacman.conf'
sudo pacman -Syu archzfs-linux

If the last command gives an error about an unsatisfiable dependency involving the kernel, the indicated version is what to use in the above snippet.

With a supported kernel and the ZFS module installed, try booting.


Pools

The lowest level of ZFS is pools.

Identify disks by their IDs like:

$ ls -lh /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-ABCDE
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-FGHIJ
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-KLMNO
lrwxrwxrwx 1 root root 1 Jan 01 12:30 ata-PQRST

With these 4 drives of N GB storage each, create a RAIDz2 pool where 2N GB will be dedicated to parity rather than storage. The pool will be fault tolerant for up to 2 failed drives.

zpool create -f tank raidz2 ata-ABCDE ata-FGHIJ ata-KLMNO ata-PQRST

Alternatively create a RAIDz1 pool where just N GB will be dedicated to parity (but the pool will only be fault tolerant of 1 drive failure).

Alternatively alternatively, create a Mirror pool to maximize fault tolerance (up to 3 failed drives) but leaving just N GB of storage.

Pools can be created with encryption, but it is not recommended. A pool's encryption setting is inherited, so the pool is permanently locked to this singular cryptographic algorithm.

The pool will be mounted to a root-level directory named after the pool (/tank in this case).


CategoryRicottone

OpenZFS (last edited 2023-07-20 03:24:14 by DominicRicottone)