Solutions for rolling kernel releases
This commit is contained in:
committed by
Richard Laager
parent
b2d60382ba
commit
5bb0cb5999
@@ -22,16 +22,6 @@ Caution
|
|||||||
will not work on 4Kn with legacy (BIOS) booting.
|
will not work on 4Kn with legacy (BIOS) booting.
|
||||||
<http://savannah.gnu.org/bugs/?46700>`__
|
<http://savannah.gnu.org/bugs/?46700>`__
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
Due to the release cycle of OpenZFS and the rapid adoption of new kernels
|
|
||||||
it may happen that you won’t be able to
|
|
||||||
build DKMS packages for the most recent kernel update.
|
|
||||||
If the `latest OpenZFS release <https://github.com/openzfs/zfs/releases/latest>`__
|
|
||||||
does not yet support the installed kernel,
|
|
||||||
`use an older live image <https://mirrors.dotsrc.org/archlinux/iso/>`__
|
|
||||||
before installation.
|
|
||||||
|
|
||||||
Support
|
Support
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
@@ -86,16 +76,26 @@ or raidz topologies) are used, the data only has to be encrypted once.
|
|||||||
|
|
||||||
Preinstallation
|
Preinstallation
|
||||||
----------------
|
----------------
|
||||||
|
Download Arch Linux live image
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#. Choose a mirror
|
||||||
|
|
||||||
|
https://archlinux.org/mirrorlist/all/
|
||||||
|
|
||||||
|
#. Download January 2021 build. `File a new issue and mention @ne9z
|
||||||
|
<https://github.com/openzfs/openzfs-docs/issues/new?body=@ne9z,%20Update%20Live%20Image%20Arch%20Linux%20Root%20on
|
||||||
|
%20ZFS%20HOWTO:>`__ if it's
|
||||||
|
no longer available.
|
||||||
|
|
||||||
|
https://mirrors.dotsrc.org/archlinux/iso/2021.01.01/archlinux-2021.01.01-x86_64.iso
|
||||||
|
|
||||||
|
#. Write the image to a USB drive or an optical disc.
|
||||||
|
|
||||||
|
#. Boot the target computer from the prepared live medium.
|
||||||
|
|
||||||
Prepare the Live Environment
|
Prepare the Live Environment
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
#. Download the latest Arch Linux Live Image
|
|
||||||
`from official website <https://archlinux.org/download/>`__
|
|
||||||
and write it to a USB drive or an optical disc.
|
|
||||||
|
|
||||||
#. Boot the target computer from the prepared live medium.
|
|
||||||
|
|
||||||
#. Connect to the internet.
|
#. Connect to the internet.
|
||||||
If the target computer aquires IP address with DHCP,
|
If the target computer aquires IP address with DHCP,
|
||||||
no further steps need to be taken.
|
no further steps need to be taken.
|
||||||
@@ -141,6 +141,19 @@ Prepare the Live Environment
|
|||||||
Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch
|
Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
#. Select mirror:
|
||||||
|
|
||||||
|
- Kill ``reflector``::
|
||||||
|
|
||||||
|
killall -9 reflector
|
||||||
|
|
||||||
|
- Edit the following files::
|
||||||
|
|
||||||
|
/etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
Uncomment and move mirrors to
|
||||||
|
the beginning of the file.
|
||||||
|
|
||||||
#. Install ZFS in the live environment::
|
#. Install ZFS in the live environment::
|
||||||
|
|
||||||
pacman -Sy --noconfirm archzfs-linux --ignore=linux
|
pacman -Sy --noconfirm archzfs-linux --ignore=linux
|
||||||
@@ -150,27 +163,25 @@ Prepare the Live Environment
|
|||||||
If this fails with ``unable to satisfy dependency``,
|
If this fails with ``unable to satisfy dependency``,
|
||||||
install archzfs-dkms instead:
|
install archzfs-dkms instead:
|
||||||
|
|
||||||
#. Check the current kernel version with::
|
- Check kernel variant::
|
||||||
|
|
||||||
live_kernel=$(uname -r)
|
LIVE_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
|
||||||
|
|
||||||
#. Search and install kernel headers::
|
- Check kernel version::
|
||||||
|
|
||||||
curl https://america.archive.pkgbuild.com/packages/l/linux-headers/ \
|
LIVE_LINVER=$(pacman -Qi ${LIVE_LINVAR} | grep Version | awk '{ print $3 }')
|
||||||
| grep ${live_kernel%%-*} \
|
|
||||||
| grep -v sig
|
|
||||||
# <a href="linux-headers-5.10.3-1-x86_64.pkg.tar.zst">
|
|
||||||
|
|
||||||
pacman -U \
|
- Install kernel headers::
|
||||||
https://america.archive.pkgbuild.com/packages/l/linux-headers/linux-headers-5.10.3-1-x86_64.pkg.tar.zst
|
|
||||||
|
|
||||||
#. Expand root filesystem::
|
pacman -U https://archive.archlinux.org/packages/l/${LIVE_LINVAR}-headers/${LIVE_LINVAR}-headers-${LIVE_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
mount -o remount,size=1G /run/archiso/cowspace
|
- Expand root filesystem::
|
||||||
|
|
||||||
#. Install archzfs-dkms::
|
mount -o remount,size=1G /run/archiso/cowspace
|
||||||
|
|
||||||
pacman -S archzfs-dkms
|
- Install archzfs-dkms::
|
||||||
|
|
||||||
|
pacman -S archzfs-dkms
|
||||||
|
|
||||||
#. Load kernel module::
|
#. Load kernel module::
|
||||||
|
|
||||||
@@ -553,14 +564,24 @@ Package Installation
|
|||||||
|
|
||||||
#. Install base packages::
|
#. Install base packages::
|
||||||
|
|
||||||
pacstrap $INST_MNT base vi grub
|
pacstrap $INST_MNT base vi mandoc grub
|
||||||
|
|
||||||
|
#. Check compatible kernel version::
|
||||||
|
|
||||||
|
INST_LINVER=$(pacman -Si zfs-${INST_LINVAR} \
|
||||||
|
| grep 'Depends On' \
|
||||||
|
| sed "s|.*${INST_LINVAR}=||" \
|
||||||
|
| awk '{ print $1 }')
|
||||||
|
|
||||||
|
#. Install kernel::
|
||||||
|
|
||||||
|
pacstrap -U $INST_MNT \
|
||||||
|
https://archive.archlinux.org/packages/l/${INST_LINVAR}/${INST_LINVAR}-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
#. Install archzfs package::
|
||||||
|
|
||||||
pacstrap $INST_MNT archzfs-$INST_LINVAR
|
pacstrap $INST_MNT archzfs-$INST_LINVAR
|
||||||
|
|
||||||
#. If archzfs package failed to install with mismatched kernel version::
|
|
||||||
|
|
||||||
pacstrap $INST_MNT $INST_LINVAR ${INST_LINVAR}-headers
|
|
||||||
pacstrap $INST_MNT archzfs-dkms
|
|
||||||
|
|
||||||
#. If your computer has hardware that requires firmware to run::
|
#. If your computer has hardware that requires firmware to run::
|
||||||
|
|
||||||
pacstrap $INST_MNT linux-firmware
|
pacstrap $INST_MNT linux-firmware
|
||||||
@@ -569,18 +590,28 @@ Package Installation
|
|||||||
|
|
||||||
pacstrap $INST_MNT dosfstools efibootmgr
|
pacstrap $INST_MNT dosfstools efibootmgr
|
||||||
|
|
||||||
|
#. Microcode:
|
||||||
|
|
||||||
|
- ``pacstrap $INST_MNT amd-ucode``
|
||||||
|
- ``pacstrap $INST_MNT intel-ucode``
|
||||||
|
|
||||||
|
#. For other optional packages,
|
||||||
|
see `ArchWiki <https://wiki.archlinux.org/index.php/Installation_guide#Installation>`__.
|
||||||
|
|
||||||
System Configuration
|
System Configuration
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
#. Generate list of datasets for ``zfs-mount-generator`` to mount them at boot::
|
#. Generate list of datasets for ``zfs-mount-generator`` to mount them at boot::
|
||||||
|
|
||||||
propfile=`mktemp`
|
# tab-separated zfs properties
|
||||||
|
# see /etc/zfs/zed.d/history_event-zfs-list-cacher.sh
|
||||||
cat /etc/zfs/zed.d/history_event-zfs-list-cacher.sh \
|
export \
|
||||||
| sed ':a;N;$!ba;s|\\\n||g' \
|
PROPS="name,mountpoint,canmount,atime,relatime,devices,exec\
|
||||||
| grep PROPS | grep name > $propfile
|
,readonly,setuid,nbmand,encroot,keylocation\
|
||||||
|
,org.openzfs.systemd:requires,org.openzfs.systemd:requires-mounts-for\
|
||||||
source $propfile
|
,org.openzfs.systemd:before,org.openzfs.systemd:after\
|
||||||
|
,org.openzfs.systemd:wanted-by,org.openzfs.systemd:required-by\
|
||||||
|
,org.openzfs.systemd:nofail,org.openzfs.systemd:ignore"
|
||||||
|
|
||||||
mkdir -p $INST_MNT/etc/zfs/zfs-list.cache
|
mkdir -p $INST_MNT/etc/zfs/zfs-list.cache
|
||||||
|
|
||||||
@@ -589,7 +620,6 @@ System Configuration
|
|||||||
|
|
||||||
sed -Ei "s|$INST_MNT/?|/|" $INST_MNT/etc/zfs/zfs-list.cache/*
|
sed -Ei "s|$INST_MNT/?|/|" $INST_MNT/etc/zfs/zfs-list.cache/*
|
||||||
|
|
||||||
|
|
||||||
#. Generate fstab::
|
#. Generate fstab::
|
||||||
|
|
||||||
echo bpool_$INST_UUID/BOOT/default /boot zfs rw,xattr,posixacl 0 0 >> $INST_MNT/etc/fstab
|
echo bpool_$INST_UUID/BOOT/default /boot zfs rw,xattr,posixacl 0 0 >> $INST_MNT/etc/fstab
|
||||||
@@ -634,11 +664,12 @@ System Configuration
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
Customize this file if the system is not a DHCP client.
|
Customize this file if the system is not a DHCP client.
|
||||||
|
See `Network Configuration <https://wiki.archlinux.org/index.php/Network_configuration>`__.
|
||||||
|
|
||||||
#. Timezone::
|
#. Timezone::
|
||||||
|
|
||||||
ln -sf $INST_TZ $INST_MNT/etc/localtime
|
ln -sf $INST_TZ $INST_MNT/etc/localtime
|
||||||
|
hwclock --systohc
|
||||||
|
|
||||||
#. archzfs repository::
|
#. archzfs repository::
|
||||||
|
|
||||||
@@ -655,7 +686,7 @@ System Configuration
|
|||||||
echo "en_US.UTF-8 UTF-8" >> $INST_MNT/etc/locale.gen
|
echo "en_US.UTF-8 UTF-8" >> $INST_MNT/etc/locale.gen
|
||||||
echo "LANG=en_US.UTF-8" >> $INST_MNT/etc/locale.conf
|
echo "LANG=en_US.UTF-8" >> $INST_MNT/etc/locale.conf
|
||||||
|
|
||||||
Other locales should be added after reboot, not here.
|
Other locales should be added after reboot.
|
||||||
|
|
||||||
#. Chroot::
|
#. Chroot::
|
||||||
|
|
||||||
@@ -817,67 +848,76 @@ Finish Installation
|
|||||||
|
|
||||||
After Reboot
|
After Reboot
|
||||||
------------
|
------------
|
||||||
#. Mirror EFI system partition
|
Mirror EFI System Partition
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#. Format redundant EFI partitions::
|
||||||
|
|
||||||
#. Format redundant EFI partitions::
|
mkfs.vfat -n EFI2 /dev/disk/by-id/target_disk2-part1
|
||||||
|
mkfs.vfat -n EFI3 /dev/disk/by-id/target_disk3-part1
|
||||||
|
|
||||||
mkfs.vfat -n EFI2 /dev/disk/by-id/target_disk2-part1
|
#. Create mountpoints::
|
||||||
mkfs.vfat -n EFI3 /dev/disk/by-id/target_disk3-part1
|
|
||||||
|
|
||||||
#. Create mountpoints::
|
mkdir -p /boot/efis/{2,3}
|
||||||
|
|
||||||
mkdir -p /boot/efis/{2,3}
|
#. Mount redundant EFI partitions::
|
||||||
|
|
||||||
#. Mount redundant EFI partitions::
|
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk2-part1 /boot/efis/2
|
||||||
|
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk3-part1 /boot/efis/3
|
||||||
|
|
||||||
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk2-part1 /boot/efis/2
|
#. Add fstab entries::
|
||||||
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk3-part1 /boot/efis/3
|
|
||||||
|
|
||||||
#. Add fstab entries::
|
pacman -S --needed arch-install-scripts rsync
|
||||||
|
|
||||||
pacman -S --needed arch-install-scripts rsync
|
genfstab / | grep efis >> /etc/fstab
|
||||||
|
|
||||||
genfstab / | grep efis >> /etc/fstab
|
#. Sync EFI system partition contents::
|
||||||
|
|
||||||
#. Sync EFI system partition contents::
|
for i in /boot/efis/*; do
|
||||||
|
/usr/bin/rsync -a /boot/efi/ $i/
|
||||||
|
done
|
||||||
|
|
||||||
for i in /boot/efis/*; do
|
#. Add EFI boot entries::
|
||||||
/usr/bin/rsync -a /boot/efi/ $i/
|
|
||||||
done
|
|
||||||
|
|
||||||
#. Add EFI boot entries::
|
efibootmgr -cgd /dev/disk/by-id/target_disk2-part1 \
|
||||||
|
-p 1 -L "arch-2" -l "\EFI\arch\grubx64.efi"
|
||||||
|
efibootmgr -cgd /dev/disk/by-id/target_disk3-part1 \
|
||||||
|
-p 1 -L "arch-3" -l "\EFI\arch\grubx64.efi"
|
||||||
|
|
||||||
efibootmgr -cgd /dev/disk/by-id/target_disk2-part1 \
|
#. Create a service to monitor and sync EFI partitions::
|
||||||
-p 1 -L "arch-2" -l "\EFI\arch\grubx64.efi"
|
|
||||||
efibootmgr -cgd /dev/disk/by-id/target_disk3-part1 \
|
|
||||||
-p 1 -L "arch-3" -l "\EFI\arch\grubx64.efi"
|
|
||||||
|
|
||||||
#. Create a service to monitor and sync EFI partitions::
|
tee /usr/lib/systemd/system/boot/efis-sync.path << EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Monitor changes in EFI system partition
|
||||||
|
|
||||||
tee /usr/lib/systemd/system/boot/efis-sync.path << EOF
|
[Path]
|
||||||
[Unit]
|
PathModified=/boot/efi/EFI/arch/
|
||||||
Description=Monitor changes in EFI system partition
|
|
||||||
|
|
||||||
[Path]
|
[Install]
|
||||||
PathModified=/boot/efi/EFI/arch/
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
[Install]
|
tee /usr/lib/systemd/system/boot/efis-sync.service << EOF
|
||||||
WantedBy=multi-user.target
|
[Unit]
|
||||||
EOF
|
Description=Sync EFI system partition contents to backups
|
||||||
|
|
||||||
tee /usr/lib/systemd/system/boot/efis-sync.service << EOF
|
[Service]
|
||||||
[Unit]
|
Type=oneshot
|
||||||
Description=Sync EFI system partition contents to backups
|
ExecStart=/usr/bin/bash -c 'for i in /boot/efis/*; do /usr/bin/rsync -a /boot/efi/ $i/; done'
|
||||||
|
EOF
|
||||||
|
|
||||||
[Service]
|
systemctl enable --now efis-sync.path
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/bin/bash -c 'for i in /boot/efis/*; do /usr/bin/rsync -a /boot/efi/ $i/; done'
|
|
||||||
EOF
|
|
||||||
|
|
||||||
systemctl enable --now efis-sync.path
|
Boot Environment Manager
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Optional: install ``rozb3-pac`` pacman hook and ``bieaz`` from AUR to
|
||||||
|
create boot environments.
|
||||||
|
|
||||||
#. Optional: install ``rozb3-pac`` pacman hook and ``bieaz`` from AUR to
|
Post installation
|
||||||
create boot environments.
|
~~~~~~~~~~~~~~~~~
|
||||||
|
For post installation recommendations,
|
||||||
|
see `ArchWiki <https://wiki.archlinux.org/index.php/Installation_guide#Post-installation>`__.
|
||||||
|
|
||||||
|
Remember to create separate datasets for individual users.
|
||||||
|
|
||||||
Recovery
|
Recovery
|
||||||
--------
|
--------
|
||||||
|
|||||||
@@ -79,21 +79,32 @@ or raidz topologies) are used, the data only has to be encrypted once.
|
|||||||
|
|
||||||
Preinstallation
|
Preinstallation
|
||||||
----------------
|
----------------
|
||||||
|
Download Artix Linux live image
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
OpenRC is used throughout this guide.
|
||||||
|
|
||||||
|
Other init systems, runit and s6, are also supported.
|
||||||
|
Change the service commands to the equivalent commands.
|
||||||
|
|
||||||
|
#. Choose a mirror:
|
||||||
|
|
||||||
|
https://artixlinux.org/download.php
|
||||||
|
|
||||||
|
#. Download January 2021 build. `File a new issue and mention @ne9z
|
||||||
|
<https://github.com/openzfs/openzfs-docs/issues/new?body=@ne9z,%20Update%20Live%20Image%20Artix%20Linux%20Root%20on
|
||||||
|
%20ZFS%20HOWTO:>`__ if it's
|
||||||
|
no longer available.
|
||||||
|
|
||||||
|
https://eu-mirror.artixlinux.org/iso/artix-base-openrc-20210101-x86_64.iso
|
||||||
|
|
||||||
|
#. Write the image to a USB drive or an optical disc.
|
||||||
|
|
||||||
|
#. Boot the target computer from the prepared live medium.
|
||||||
|
|
||||||
|
|
||||||
Prepare the Live Environment
|
Prepare the Live Environment
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
#. Download the latest Artix Linux OpenRC Base Image
|
|
||||||
`from official website <https://iso.artixlinux.org/isos.php>`__
|
|
||||||
and write it to a USB drive or an optical disc.
|
|
||||||
|
|
||||||
OpenRC is used throughout this guide.
|
|
||||||
|
|
||||||
Other init systems, runit and s6, are also supported.
|
|
||||||
Change the service commands to the equivalent commands.
|
|
||||||
|
|
||||||
#. Boot the target computer from the prepared live medium.
|
|
||||||
|
|
||||||
#. Connect to the internet.
|
#. Connect to the internet.
|
||||||
If the target computer aquires IP address with DHCP,
|
If the target computer aquires IP address with DHCP,
|
||||||
no further steps need to be taken.
|
no further steps need to be taken.
|
||||||
@@ -146,16 +157,20 @@ Prepare the Live Environment
|
|||||||
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
|
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
|
||||||
Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch
|
Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch
|
||||||
EOF
|
EOF
|
||||||
|
#. Select mirror:
|
||||||
|
|
||||||
|
- Edit the following files::
|
||||||
|
|
||||||
|
/etc/pacman.d/mirrorlist
|
||||||
|
/etc/pacman.d/mirrorlist-arch
|
||||||
|
|
||||||
|
Uncomment and move mirrors to
|
||||||
|
the beginning of the file.
|
||||||
|
|
||||||
#. Install ZFS in the live environment::
|
#. Install ZFS in the live environment::
|
||||||
|
|
||||||
pacman -Sy --noconfirm gdisk dosfstools archzfs-dkms
|
pacman -Sy --noconfirm gdisk dosfstools archzfs-dkms
|
||||||
|
|
||||||
Unlike Arch Live image,
|
|
||||||
Artix Live image ships with ``linux-headers``.
|
|
||||||
This makes building kernel module
|
|
||||||
possible within live environment.
|
|
||||||
|
|
||||||
#. Load kernel module::
|
#. Load kernel module::
|
||||||
|
|
||||||
modprobe zfs
|
modprobe zfs
|
||||||
@@ -537,9 +552,75 @@ Package Installation
|
|||||||
|
|
||||||
#. Install base packages::
|
#. Install base packages::
|
||||||
|
|
||||||
basestrap $INST_MNT base vi grub connman connman-openrc openrc
|
basestrap $INST_MNT base vi mandoc grub connman connman-openrc openrc
|
||||||
basestrap $INST_MNT $INST_LINVAR ${INST_LINVAR}-headers
|
|
||||||
basestrap $INST_MNT archzfs-dkms
|
#. Install kernel headers and archzfs-dkms package:
|
||||||
|
|
||||||
|
Check kernel version::
|
||||||
|
|
||||||
|
pacman -Syi ${INST_LINVAR} \
|
||||||
|
| grep 'Version' \
|
||||||
|
| awk '{ print $3 }'
|
||||||
|
# 5.10.1.artix1-1
|
||||||
|
|
||||||
|
Check zfs-dkms package version::
|
||||||
|
|
||||||
|
DKMS_VER=$(pacman -Si zfs-dkms \
|
||||||
|
| grep 'Version' \
|
||||||
|
| awk '{ print $3 }' \
|
||||||
|
| sed 's|-.*||')
|
||||||
|
|
||||||
|
Visit OpenZFS release page::
|
||||||
|
|
||||||
|
curl https://github.com/openzfs/zfs/releases/zfs-${DKMS_VER} \
|
||||||
|
| grep Linux \
|
||||||
|
| grep compat \
|
||||||
|
| grep kernel
|
||||||
|
# Linux: compatible with 3.10 - 5.10 kernels
|
||||||
|
|
||||||
|
If the kernel is supported:
|
||||||
|
|
||||||
|
- Install archzfs-dkms::
|
||||||
|
|
||||||
|
basestrap $INST_MNT archzfs-dkms ${INST_LINVAR} ${INST_LINVAR}-headers
|
||||||
|
|
||||||
|
If the kernel is not yet supported, install an older kernel:
|
||||||
|
|
||||||
|
- Check build date::
|
||||||
|
|
||||||
|
DKMS_DATE=$(pacman -Syi zfs-dkms \
|
||||||
|
| grep 'Build Date' \
|
||||||
|
| sed 's/.*: //' \
|
||||||
|
| LC_ALL=C xargs -i{} date -d {} +%Y/%m/%d)
|
||||||
|
|
||||||
|
- Check kernel version::
|
||||||
|
|
||||||
|
curl https://archive.artixlinux.org/repos/${DKMS_DATE}/system/os/x86_64/ \
|
||||||
|
| grep \"${INST_LINVAR}-'[0-9]' \
|
||||||
|
| grep -v sig
|
||||||
|
# <a href="linux-5.10.3.arch1-1-x86_64.pkg.tar.zst">
|
||||||
|
|
||||||
|
- Set kernel version in a variable::
|
||||||
|
|
||||||
|
# <a href="linux-5.10.3.arch1-1-x86_64.pkg.tar.zst">
|
||||||
|
INST_LINVER=5.10.3.arch1-1
|
||||||
|
|
||||||
|
- Install kernel and headers::
|
||||||
|
|
||||||
|
basestrap -U $INST_MNT \
|
||||||
|
https://archive.artixlinux.org/packages/l/${INST_LINVAR}/${INST_LINVAR}-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
https://archive.artixlinux.org/packages/l/${INST_LINVAR}-headers/${INST_LINVAR}-headers-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
- Install archzfs-dkms::
|
||||||
|
|
||||||
|
basestrap $INST_MNT archzfs-dkms
|
||||||
|
|
||||||
|
#. Hold kernel package from updates::
|
||||||
|
|
||||||
|
sed -i 's/#.*HoldPkg/HoldPkg/' $INST_MNT/etc/pacman.conf
|
||||||
|
sed -i "/^HoldPkg/ s/$/ ${INST_LINVAR} ${INST_LINVAR}-headers/" $INST_MNT/etc/pacman.conf
|
||||||
|
|
||||||
|
Kernel must be manually updated, see kernel update section in Getting Started.
|
||||||
|
|
||||||
#. If your computer has hardware that requires firmware to run::
|
#. If your computer has hardware that requires firmware to run::
|
||||||
|
|
||||||
@@ -552,7 +633,15 @@ Package Installation
|
|||||||
#. If a swap partition has been created::
|
#. If a swap partition has been created::
|
||||||
|
|
||||||
basestrap $INST_MNT cryptsetup
|
basestrap $INST_MNT cryptsetup
|
||||||
basestrap $INST_MNT cryptsetup-openrc # or other init
|
basestrap $INST_MNT cryptsetup-openrc
|
||||||
|
|
||||||
|
#. Microcode:
|
||||||
|
|
||||||
|
- ``pacstrap $INST_MNT amd-ucode``
|
||||||
|
- ``pacstrap $INST_MNT intel-ucode``
|
||||||
|
|
||||||
|
#. For other optional packages,
|
||||||
|
see `ArchWiki <https://wiki.archlinux.org/index.php/Installation_guide#Installation>`__.
|
||||||
|
|
||||||
System Configuration
|
System Configuration
|
||||||
--------------------
|
--------------------
|
||||||
@@ -587,6 +676,7 @@ System Configuration
|
|||||||
#. Timezone::
|
#. Timezone::
|
||||||
|
|
||||||
ln -sf $INST_TZ $INST_MNT/etc/localtime
|
ln -sf $INST_TZ $INST_MNT/etc/localtime
|
||||||
|
hwclock --systohc
|
||||||
|
|
||||||
#. archzfs repository::
|
#. archzfs repository::
|
||||||
|
|
||||||
@@ -603,7 +693,7 @@ System Configuration
|
|||||||
echo "en_US.UTF-8 UTF-8" >> $INST_MNT/etc/locale.gen
|
echo "en_US.UTF-8 UTF-8" >> $INST_MNT/etc/locale.gen
|
||||||
echo "LANG=en_US.UTF-8" >> $INST_MNT/etc/locale.conf
|
echo "LANG=en_US.UTF-8" >> $INST_MNT/etc/locale.conf
|
||||||
|
|
||||||
Other locales should be added after reboot, not here.
|
Other locales should be added after reboot.
|
||||||
|
|
||||||
#. Chroot::
|
#. Chroot::
|
||||||
|
|
||||||
@@ -778,44 +868,54 @@ Finish Installation
|
|||||||
|
|
||||||
After Reboot
|
After Reboot
|
||||||
------------
|
------------
|
||||||
#. Mirror EFI system partition
|
Mirror EFI System Partition
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
#. Format redundant EFI partitions::
|
#. Format redundant EFI partitions::
|
||||||
|
|
||||||
mkfs.vfat -n EFI2 /dev/disk/by-id/target_disk2-part1
|
mkfs.vfat -n EFI2 /dev/disk/by-id/target_disk2-part1
|
||||||
mkfs.vfat -n EFI3 /dev/disk/by-id/target_disk3-part1
|
mkfs.vfat -n EFI3 /dev/disk/by-id/target_disk3-part1
|
||||||
|
|
||||||
#. Create mountpoints::
|
#. Create mountpoints::
|
||||||
|
|
||||||
mkdir -p /boot/efis/{2,3}
|
mkdir -p /boot/efis/{2,3}
|
||||||
|
|
||||||
#. Mount redundant EFI partitions::
|
#. Mount redundant EFI partitions::
|
||||||
|
|
||||||
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk2-part1 /boot/efis/2
|
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk2-part1 /boot/efis/2
|
||||||
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk3-part1 /boot/efis/3
|
mount -o umask=0022,fmask=0022,dmask=0022 /dev/disk/by-id/target_disk3-part1 /boot/efis/3
|
||||||
|
|
||||||
#. Add fstab entries::
|
#. Add fstab entries::
|
||||||
|
|
||||||
pacman -S --needed artools-base rsync
|
pacman -S --needed artools-base rsync
|
||||||
|
|
||||||
fstabgen / | grep efis >> /etc/fstab
|
fstabgen / | grep efis >> /etc/fstab
|
||||||
|
|
||||||
#. Sync EFI system partition contents::
|
#. Sync EFI system partition contents::
|
||||||
|
|
||||||
for i in /boot/efis/*; do
|
for i in /boot/efis/*; do
|
||||||
/usr/bin/rsync -a /boot/efi/ $i/
|
/usr/bin/rsync -a /boot/efi/ $i/
|
||||||
done
|
done
|
||||||
|
|
||||||
#. Add EFI boot entries::
|
#. Add EFI boot entries::
|
||||||
|
|
||||||
efibootmgr -cgd /dev/disk/by-id/target_disk2-part1 \
|
efibootmgr -cgd /dev/disk/by-id/target_disk2-part1 \
|
||||||
-p 1 -L "artix-2" -l "\EFI\arch\grubx64.efi"
|
-p 1 -L "artix-2" -l "\EFI\arch\grubx64.efi"
|
||||||
efibootmgr -cgd /dev/disk/by-id/target_disk3-part1 \
|
efibootmgr -cgd /dev/disk/by-id/target_disk3-part1 \
|
||||||
-p 1 -L "artix-3" -l "\EFI\arch\grubx64.efi"
|
-p 1 -L "artix-3" -l "\EFI\arch\grubx64.efi"
|
||||||
|
|
||||||
#. Optional: install ``rozb3-pac`` pacman hook and ``bieaz`` from AUR to
|
Boot Environment Manager
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Optional: install ``rozb3-pac`` pacman hook and ``bieaz`` from AUR to
|
||||||
create boot environments.
|
create boot environments.
|
||||||
|
|
||||||
|
Post installation
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
For post installation recommendations,
|
||||||
|
see `ArchWiki <https://wiki.archlinux.org/index.php/Installation_guide#Post-installation>`__.
|
||||||
|
|
||||||
|
Remember to create separate datasets for individual users.
|
||||||
|
|
||||||
Recovery
|
Recovery
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|||||||
@@ -12,17 +12,10 @@ Installation
|
|||||||
If you want to use ZFS as your root filesystem, see the `Root on ZFS`_
|
If you want to use ZFS as your root filesystem, see the `Root on ZFS`_
|
||||||
links below instead.
|
links below instead.
|
||||||
|
|
||||||
.. note::
|
Add archzfs repo
|
||||||
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Due to the release cycle of OpenZFS and the rapid adoption of new kernels
|
ZFS packages are provided by the third-party
|
||||||
it may happen that you won’t be able to
|
|
||||||
build DKMS packages for the most recent kernel update.
|
|
||||||
If the `latest OpenZFS release <https://github.com/openzfs/zfs/releases/latest>`__
|
|
||||||
does not yet support the installed kernel,
|
|
||||||
`downgrade kernel <https://wiki.archlinux.org/index.php/downgrading_packages>`__
|
|
||||||
before installation.
|
|
||||||
|
|
||||||
ZFS packages are provided by the third-party
|
|
||||||
`archzfs repository <https://github.com/archzfs/archzfs>`__.
|
`archzfs repository <https://github.com/archzfs/archzfs>`__.
|
||||||
You can use it as follows.
|
You can use it as follows.
|
||||||
|
|
||||||
@@ -46,26 +39,246 @@ Update pacman database::
|
|||||||
|
|
||||||
pacman -Sy
|
pacman -Sy
|
||||||
|
|
||||||
Install packages.
|
Prebuilt zfs package
|
||||||
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Install prebuilt zfs package.
|
This only applies to vanilla Arch Linux kernels.
|
||||||
Kernel package version must match the zfs package version.
|
For other kernels, use `archzfs-dkms package`_.
|
||||||
|
|
||||||
- archzfs-linux
|
Check kernel variant::
|
||||||
- archzfs-linux-lts
|
|
||||||
- archzfs-linux-zen
|
|
||||||
- archzfs-linux-hardened
|
|
||||||
|
|
||||||
::
|
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
|
||||||
|
|
||||||
pacman -S archzfs-linux
|
Install compatible package::
|
||||||
|
|
||||||
* If kernel dependency fails, or if you use a custom kernel,
|
pacman -Sy archzfs-${INST_LINVAR}
|
||||||
install zfs-dkms
|
|
||||||
|
|
||||||
::
|
If kernel dependency failed, you can either:
|
||||||
|
|
||||||
pacman -S archzfs-dkms
|
* Install `archzfs-dkms package`_, or
|
||||||
|
|
||||||
|
* Downgrade kernel
|
||||||
|
to a compatible version:
|
||||||
|
|
||||||
|
Downgrade to compatible kernel
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Check compatible kernel version::
|
||||||
|
|
||||||
|
INST_LINVER=$(pacman -Si zfs-${INST_LINVAR} \
|
||||||
|
| grep 'Depends On' \
|
||||||
|
| sed "s|.*${INST_LINVAR}=||" \
|
||||||
|
| awk '{ print $1 }')
|
||||||
|
|
||||||
|
Install compatible kernel::
|
||||||
|
|
||||||
|
pacman -U \
|
||||||
|
https://archive.archlinux.org/packages/l/${INST_LINVAR}/${INST_LINVAR}-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
Install archzfs::
|
||||||
|
|
||||||
|
pacman -Sy archzfs-${INST_LINVAR}
|
||||||
|
|
||||||
|
Ignore kernel update when dependency fails
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Sometimes archzfs prebuilt package might lag behind
|
||||||
|
kernel updates::
|
||||||
|
|
||||||
|
pacman -Syu
|
||||||
|
# error: failed to prepare transaction (could not satisfy dependencies)
|
||||||
|
# :: installing linux-lts (5.4.93-2) breaks dependency 'linux-lts=5.4.92-1' required by zfs-linux-lts
|
||||||
|
|
||||||
|
Temporarily ignore kernel update to upgrade other packages::
|
||||||
|
|
||||||
|
pacman -Syu --ignore=linux=lts
|
||||||
|
|
||||||
|
archzfs-dkms package
|
||||||
|
~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
This package will dynamically build ZFS modules for
|
||||||
|
supported kernels. Both Arch Linux and derivatives
|
||||||
|
are supported.
|
||||||
|
|
||||||
|
Check OpenZFS compatibility
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Check kernel version::
|
||||||
|
|
||||||
|
uname -r
|
||||||
|
# 5.4.92-1-lts
|
||||||
|
|
||||||
|
Check newer archzfs-dkms package version::
|
||||||
|
|
||||||
|
DKMS_VER=$(pacman -Si zfs-dkms \
|
||||||
|
| grep 'Version' \
|
||||||
|
| awk '{ print $3 }' \
|
||||||
|
| sed 's|-.*||')
|
||||||
|
|
||||||
|
Visit OpenZFS release page ::
|
||||||
|
|
||||||
|
curl https://github.com/openzfs/zfs/releases/zfs-${DKMS_VER} \
|
||||||
|
| grep Linux \
|
||||||
|
| grep compat \
|
||||||
|
| grep kernel
|
||||||
|
# Linux: compatible with 3.10 - 5.10 kernels
|
||||||
|
|
||||||
|
If it's not supported, see `Install alternative kernel`_.
|
||||||
|
Otherwise, continue to next step.
|
||||||
|
|
||||||
|
Normal installation
|
||||||
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Check kernel variant::
|
||||||
|
|
||||||
|
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
|
||||||
|
|
||||||
|
Check kernel version::
|
||||||
|
|
||||||
|
INST_LINVER=$(pacman -Qi ${INST_LINVAR} | grep Version | awk '{ print $3 }')
|
||||||
|
|
||||||
|
Install kernel headers::
|
||||||
|
|
||||||
|
pacman -U https://archive.archlinux.org/packages/l/${INST_LINVAR}-headers/${INST_LINVAR}-headers-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
# for artix
|
||||||
|
pacman -U https://archive.artixlinux.org/packages/l/${INST_LINVAR}-headers/${INST_LINVAR}-headers-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
Install archzfs-dkms::
|
||||||
|
|
||||||
|
pacman -Sy archzfs-dkms
|
||||||
|
|
||||||
|
Hold kernel package from updates::
|
||||||
|
|
||||||
|
sed -i 's/#.*HoldPkg/HoldPkg/' /etc/pacman.conf
|
||||||
|
sed -i "/^HoldPkg/ s/$/ ${INST_LINVAR} ${INST_LINVAR}-headers/" /etc/pacman.conf
|
||||||
|
|
||||||
|
Kernel must be manually updated, see `Kernel update`_.
|
||||||
|
|
||||||
|
Install alternative kernel
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
If the kernel is not yet supported, install a supported kernel:
|
||||||
|
|
||||||
|
Choose kernel variant. Available variants are:
|
||||||
|
|
||||||
|
* linux
|
||||||
|
* linux-lts
|
||||||
|
|
||||||
|
For Artix, replace ``archlinux.org`` with ``artixlinux.org``.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
INST_LINVAR=linux
|
||||||
|
|
||||||
|
Check build date::
|
||||||
|
|
||||||
|
DKMS_DATE=$(pacman -Syi zfs-dkms \
|
||||||
|
| grep 'Build Date' \
|
||||||
|
| sed 's/.*: //' \
|
||||||
|
| LC_ALL=C xargs -i{} date -d {} +%Y/%m/%d)
|
||||||
|
|
||||||
|
Check kernel version::
|
||||||
|
|
||||||
|
curl https://archive.archlinux.org/repos/${DKMS_DATE}/core/os/x86_64/ \
|
||||||
|
| grep \"${INST_LINVAR}-'[0-9]' \
|
||||||
|
| grep -v sig
|
||||||
|
# <a href="linux-5.10.3.arch1-1-x86_64.pkg.tar.zst">
|
||||||
|
|
||||||
|
Set kernel version in a variable::
|
||||||
|
|
||||||
|
# <a href="linux-5.10.3.arch1-1-x86_64.pkg.tar.zst">
|
||||||
|
INST_LINVER=5.10.3.arch1-1
|
||||||
|
|
||||||
|
Install kernel and headers::
|
||||||
|
|
||||||
|
pacman -U \
|
||||||
|
https://archive.archlinux.org/packages/l/${INST_LINVAR}/${INST_LINVAR}-${INST_LINVER}-x86_64.pkg.tar.zst \
|
||||||
|
https://archive.archlinux.org/packages/l/${INST_LINVAR}-headers/${INST_LINVAR}-headers-${INST_LINVER}-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
Install archzfs-dkms::
|
||||||
|
|
||||||
|
pacman -Sy archzfs-dkms
|
||||||
|
|
||||||
|
Hold kernel package from updates::
|
||||||
|
|
||||||
|
sed -i 's/#.*HoldPkg/HoldPkg/' /etc/pacman.conf
|
||||||
|
sed -i "/^HoldPkg/ s/$/ ${INST_LINVAR} ${INST_LINVAR}-headers/" /etc/pacman.conf
|
||||||
|
|
||||||
|
Kernel must be manually updated, see `Kernel update`_.
|
||||||
|
|
||||||
|
Kernel update
|
||||||
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
This applies to archzfs-dkms package.
|
||||||
|
|
||||||
|
Check kernel variant::
|
||||||
|
|
||||||
|
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
|
||||||
|
|
||||||
|
Check newer kernel version::
|
||||||
|
|
||||||
|
pacman -Syi $INST_LINVAR \
|
||||||
|
| grep 'Version' \
|
||||||
|
| awk '{ print $3 }'
|
||||||
|
# 5.10.1.1-1
|
||||||
|
|
||||||
|
Check newer archzfs-dkms package version::
|
||||||
|
|
||||||
|
pacman -Si zfs-dkms \
|
||||||
|
| grep 'Version' \
|
||||||
|
| awk '{ print $3 }' \
|
||||||
|
| sed 's|-.*||'
|
||||||
|
# 2.0.1
|
||||||
|
|
||||||
|
Visit OpenZFS release page https://github.com/openzfs/zfs/releases/zfs-2.0.1::
|
||||||
|
|
||||||
|
# Linux: compatible with 3.10 - 5.10 kernels
|
||||||
|
|
||||||
|
If compatible, update kernel with::
|
||||||
|
|
||||||
|
pacman -S $INST_LINVAR $INST_LINVAR-headers archzfs-dkms
|
||||||
|
|
||||||
|
Do not update if the kernel is not compatible
|
||||||
|
with OpenZFS.
|
||||||
|
|
||||||
|
Check Live Image Compatibility
|
||||||
|
------------------------------
|
||||||
|
#. Choose a mirror::
|
||||||
|
|
||||||
|
https://archlinux.org/mirrorlist/all/
|
||||||
|
https://gitea.artixlinux.org/packagesA/artix-mirrorlist/src/branch/master/trunk/mirrorlist
|
||||||
|
|
||||||
|
#. Check the build date of the
|
||||||
|
latest Arch Linux live image::
|
||||||
|
|
||||||
|
https://mirrors.dotsrc.org/archlinux/iso/latest/
|
||||||
|
https://mirrors.dotsrc.org/artix-linux/iso/
|
||||||
|
# archlinux-2021.01.01-x86_64.iso
|
||||||
|
|
||||||
|
#. Check the kernel version of the live image::
|
||||||
|
|
||||||
|
https://archive.archlinux.org/repos/2021/01/01/core/os/x86_64
|
||||||
|
https://archive.artixlinux.org/repos/2021/01/01/system/os/x86_64
|
||||||
|
# linux-5.10.3.arch1-1-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
#. Check latest archzfs package version::
|
||||||
|
|
||||||
|
https://archzfs.com/archzfs/x86_64/
|
||||||
|
# zfs-dkms-2.0.1-1-x86_64.pkg.tar.zst
|
||||||
|
# zfs-linux-2.0.1_5.10.10.arch1.1-1-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
#. Visit OpenZFS release page https://github.com/openzfs/zfs/releases/tag/zfs-2.0.1::
|
||||||
|
|
||||||
|
# Linux: compatible with 3.10 - 5.10 kernels
|
||||||
|
|
||||||
|
- If compatible, download the latest live image::
|
||||||
|
|
||||||
|
https://mirrors.dotsrc.org/archlinux/iso/latest/archlinux-2021.01.01-x86_64.iso
|
||||||
|
https://mirrors.dotsrc.org/artix-linux/iso/artix-base-openrc-20210101-x86_64.iso
|
||||||
|
|
||||||
|
- If not compatible, use an older live image and verify that it contains
|
||||||
|
a supported kernel using the above method::
|
||||||
|
|
||||||
|
https://mirrors.dotsrc.org/archlinux/iso/
|
||||||
|
https://iso.artixlinux.org/archived-isos.php
|
||||||
|
|
||||||
Root on ZFS
|
Root on ZFS
|
||||||
-----------
|
-----------
|
||||||
|
|||||||
Reference in New Issue
Block a user