- Replaced intances of `dracut_install` with `inst_simple` - Removed calls to `test -x mark_hostonly` because the function is an inbuilt dracut function - Removed redundant installation of `systemd-ask-password` and `systemd-tty-ask-password-agent` because they are already installed by the systemd module. There is no need to install them again - Removed multiple calls to the `mark_hostonly` function because the `inst_simple` has a command-line switch for it - Cleaned up the installation of the `zpool.cache`, `vdev_id.conf` and `hostid` files to make the logic easier to follow - Cleaned up and simplified the systemd service installation logic by invoking systemctl instead of creating symlinks manually - Replaced various hard-coded paths with dracut equivalents to better conform with expected dracut behaviour - Removed redundant call to `mkdir` (`inst_simple` creates the parent directory if it does not exist on the destination initrd) Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Andrew J. Hesford <ajh@sideband.org> Signed-off-by: Savyasachee Jha <hi@savyasacheejha.com> Closes #13010 |
||
|---|---|---|
| .. | ||
| 02zfsexpandknowledge | ||
| 90zfs | ||
| Makefile.am | ||
| README.md | ||
Basic setup
- Install
zfs-dracut - Set
mountpoint=/for your root dataset (for compatibility,legacyalso works, but is not recommended for new installations):zfs set mountpoint=/ pool/dataset - Either (a) set
bootfs=on the pool to the dataset:zpool set bootfs=pool/dataset pool - Or (b) append
root=zfs:pool/datasetto your kernel cmdline. - Re-generate your initrd and update it in your boot bundle
Encrypted datasets have keys loaded automatically or prompted for.
If the root dataset contains children with mountpoint=s of /etc, /bin, /lib*, or /usr, they're mounted too.
cmdline
-
root=Root dataset is… Pools imported (empty) the first bootfs=afterzpool import -aNall zfs:AUTO(as above, but overriding other autoselection methods) all ZFS=pool/datasetpool/datasetpoolzfs:pool/dataset(as above) poolAll
+es are replaced with spaces (i.e. to boot fromroot pool/data set, passroot=zfs:root+pool/data+set).The dataset can be at any depth, including being the pool's root dataset (i.e.
root=zfs:pool). -
spl_hostid: passed tozgenhostid -f, useful to override the/etc/hostidfile baked into the initrd. -
bootfs.snapshot,bootfs.snapshot=snapshot-name: enableszfs-snapshot-bootfs.service, which creates a snapshot$root_dataset@$(uname -r)(or, in the second form,$root_dataset@snapshot-name) after pool import but before the rootfs is mounted. Failure to create the snapshot is noted, but booting continues. -
bootfs.rollback,bootfs.rollback=snapshot-name: enableszfs-snapshot-bootfs.service, which-Rfrolls back to$root_dataset@$(uname -r)(or, in the second form,$root_dataset@snapshot-name) after pool import but before the rootfs is mounted. Failure to roll back will fall down to the rescue shell. This has obvious potential for data loss: make sure your persistent data is not below the rootfs and you don't care about any intermediate snapshots. -
If both
bootfs.snapshotandbootfs.rollbackare set,bootfs.rollbackis ordered afterbootfs.snapshot. -
zfs_force,zfs.force,zfsforce: add-fto allzpool importinvocations. May be useful. Use with caution.