archiso-zfs/README.md

57 lines
2.7 KiB
Markdown
Raw Normal View History

2020-05-01 17:00:24 +02:00
### Why this
2020-05-01 20:15:57 +02:00
If you want to install Archlinux on ZFS, you need to deal with the [ZFS licensing problem](https://wiki.archlinux.org/index.php/ZFS). The kernel module isn't included in the default archiso image, you need to [include it](https://wiki.archlinux.org/index.php/ZFS#Embed_the_archzfs_packages_into_an_archiso) into a custom archiso image to be able to install ZFS.
2020-05-01 17:00:24 +02:00
2021-06-12 13:26:08 +02:00
I wrote an article about [archiso netbooting](https://eoli3n.github.io/2020/04/25/recovery.html).
2020-05-06 14:11:25 +02:00
This script lets you include the zfs kernel module on any archiso image without creating a custom one.
2020-05-01 17:00:24 +02:00
### Archzfs
2020-05-01 19:05:31 +02:00
The [Archzfs](https://github.com/archzfs/archzfs/wiki) unofficial user repository offers multiple ways to install the ZFS kernel module.
2020-05-06 14:11:25 +02:00
We can install precompiled module with ``zfs-linux`` package or compile the zfs module using [DKMS method](https://wiki.archlinux.org/index.php/ZFS#DKMS).
2020-05-01 19:05:31 +02:00
In order to build the module, DKMS needs the ``linux-headers`` package for the running kernel.
2020-05-01 17:00:24 +02:00
2020-05-02 17:35:24 +02:00
### How does it work
2020-05-01 17:00:24 +02:00
2020-05-06 14:11:25 +02:00
It extracts running kernel version and try to find a matching ZFS module in ``Archzfs`` repositories.
If it doesn't, it fallbacks to the DKMS build of the ZFS module.
2022-02-16 13:15:45 +01:00
In that case, the script uses [Arch Linux Archive](https://wiki.archlinux.org/index.php/Arch_Linux_Archive#How_to_restore_all_packages_to_a_specific_date) to install the ``linux-headers`` and ``base-devel`` packages required for DKMS. You need at least ~6Gb RAM to use that method to be able to store packages in cowspace.
2020-05-01 17:00:24 +02:00
2022-02-17 17:21:17 +01:00
In some very specific cases, you won't be able to get ZFS module working for a specific archiso version.
In that case, just switch to the previous month iso.
2020-05-01 17:00:24 +02:00
### How to use
2020-05-01 16:19:33 +02:00
2020-05-01 20:15:57 +02:00
Boot on any archiso system, and run:
2020-05-01 16:19:33 +02:00
```
$ curl -s https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init | bash
2020-05-01 16:19:33 +02:00
```
2020-05-01 17:28:19 +02:00
2022-02-16 13:58:07 +01:00
![dkms-screenshot](./screenshot.png)
2020-08-20 10:03:04 +02:00
### Debug
By default, command outputs are redirected to /dev/null.
2020-08-20 10:03:04 +02:00
To run the script in verbose mode, use:
```
$ curl -s https://raw.githubusercontent.com/eoli3n/archiso-zfs/master/init | bash -s -- -v
2022-02-16 11:16:38 +01:00
```
2022-08-31 11:07:30 +02:00
Running the script produces a ``debug.log`` file.
2022-08-31 11:03:58 +02:00
To upload this easily, you can
```
$ pacman -Syy pastebinit
$ pastebinit -b sprunge.us debug.log
```
And then paste me the url in your issue.
2022-02-16 11:16:38 +01:00
### Dev
2022-08-31 11:07:30 +02:00
To easily generate a VM with the latest archiso, to test the script in, on your host with qemu/libvirt and vagrant installed :
Use [https://github.com/eoli3n/arch-config/tree/master/vagrant](https://github.com/eoli3n/arch-config/tree/master/vagrant).
2020-08-20 10:03:04 +02:00
2020-05-08 13:06:51 +02:00
### Related
2020-05-01 17:21:43 +02:00
2020-05-06 14:11:25 +02:00
- [Archzfs issue : Dynamically build/load ZFS module on default archiso #337](https://github.com/archzfs/archzfs/issues/337)
- [Archlinux Wiki : Install Arch Linux On ZFS](https://wiki.archlinux.org/index.php/Install_Arch_Linux_on_ZFS#Get_ZFS_module_on_archiso_system)