Arch Linux: Multiple fixes for Root on ZFS guides

Signed-off-by: Maurice Zhou <ja@apvc.uk>
This commit is contained in:
Maurice Zhou
2021-02-20 16:14:35 +08:00
committed by Richard Laager
parent 6ab3d43847
commit 8e2cdf4f58
3 changed files with 58 additions and 22 deletions

View File

@@ -134,7 +134,12 @@ Prepare the Live Environment
#. Add archzfs repository::
tee -a /etc/pacman.conf <<- 'EOF'
[archzfs]
Include = /etc/pacman.d/mirrorlist-archzfs
EOF
tee -a /etc/pacman.d/mirrorlist-archzfs <<- 'EOF'
Server = https://archzfs.com/$repo/$arch
Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
@@ -149,16 +154,20 @@ Prepare the Live Environment
- Edit the following files::
/etc/pacman.d/mirrorlist
nano /etc/pacman.d/mirrorlist
Uncomment and move mirrors to
the beginning of the file.
- Update database::
pacman -Sy
#. Install ZFS in the live environment:
Check kernel variant::
LIVE_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
LIVE_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | sed 's|.img||g' | awk '{ print $1 }')
Check kernel version::
@@ -170,11 +179,11 @@ Prepare the Live Environment
Expand root filesystem::
mount -o remount,size=1G /run/archiso/cowspace
mount -o remount,size=2G /run/archiso/cowspace
Install archzfs-dkms::
Install zfs-dkms::
pacman -S archzfs-dkms
pacman -S zfs-dkms glibc
#. Load kernel module::
@@ -654,7 +663,12 @@ System Configuration
#. archzfs repository::
tee -a $INST_MNT/etc/pacman.conf <<- 'EOF'
[archzfs]
Include = /etc/pacman.d/mirrorlist-archzfs
EOF
tee -a $INST_MNT/etc/pacman.d/mirrorlist-archzfs <<- 'EOF'
Server = https://archzfs.com/$repo/$arch
Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch

View File

@@ -101,6 +101,7 @@ Change the service commands to the equivalent commands.
#. Boot the target computer from the prepared live medium.
#. At GRUB menu, select "From ISO: artix x86_64".
Prepare the Live Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -151,25 +152,35 @@ Prepare the Live Environment
#. Add archzfs repository::
tee -a /etc/pacman.conf <<- 'EOF'
[archzfs]
Include = /etc/pacman.d/mirrorlist-archzfs
EOF
tee -a /etc/pacman.d/mirrorlist-archzfs <<- 'EOF'
Server = https://archzfs.com/$repo/$arch
Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch
EOF
#. Select mirror:
- Edit the following files::
/etc/pacman.d/mirrorlist
/etc/pacman.d/mirrorlist-arch
nano /etc/pacman.d/mirrorlist
nano /etc/pacman.d/mirrorlist-arch
Uncomment and move mirrors to
the beginning of the file.
- Update database::
pacman -Sy
#. Install ZFS and tools in the live environment::
pacman -Sy --noconfirm gdisk dosfstools archzfs-dkms
pacman -Sy --noconfirm gdisk dosfstools zfs-dkms glibc
#. Load kernel module::
@@ -539,9 +550,9 @@ Package Installation
#. Install base packages::
basestrap $INST_MNT base vi mandoc grub connman connman-openrc openrc
basestrap $INST_MNT base vi mandoc grub connman connman-openrc openrc elogind-openrc
#. Install kernel headers and archzfs-dkms package:
#. Install kernel headers and zfs-dkms package:
Check kernel version::
@@ -559,10 +570,11 @@ Package Installation
curl https://github.com/openzfs/zfs/releases/zfs-${DKMS_VER} \
| grep Linux
# Linux: compatible with 3.10 - 5.10 kernels
echo $INST_LINVER
If the kernel is supported:
- Install archzfs-dkms::
- Install zfs-dkms::
basestrap $INST_MNT zfs-dkms ${INST_LINVAR} ${INST_LINVAR}-headers
@@ -577,7 +589,7 @@ Package Installation
- Check kernel version::
INST_LINVER=$(curl https://archive.artixlinux.org/repos/${DKMS_DATE}/core/os/x86_64/ \
INST_LINVER=$(curl https://archive.artixlinux.org/repos/${DKMS_DATE}/system/os/x86_64/ \
| grep \"${INST_LINVAR}-'[0-9]' \
| grep -v sig \
| sed "s|.*$INST_LINVAR-||" \
@@ -586,10 +598,10 @@ Package Installation
- 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}/${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::
- Install zfs-dkms::
basestrap $INST_MNT zfs-dkms
@@ -659,7 +671,12 @@ System Configuration
#. archzfs repository::
tee -a $INST_MNT/etc/pacman.conf <<- 'EOF'
[archzfs]
Include = /etc/pacman.d/mirrorlist-archzfs
EOF
tee -a $INST_MNT/etc/pacman.d/mirrorlist-archzfs <<- 'EOF'
Server = https://archzfs.com/$repo/$arch
Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
@@ -677,8 +694,8 @@ System Configuration
artix-chroot $INST_MNT /usr/bin/env DISK=$DISK INST_UUID=$INST_UUID bash --login
#. If a swap partition has been created:
Enable cryptsetup services for crypt-swap::
#. If a swap partition has been created,
enable cryptsetup services for crypt-swap::
rc-update add device-mapper boot
rc-update add dmcrypt boot

View File

@@ -28,7 +28,12 @@ Import archzfs GPG key::
Add the archzfs repository::
tee -a /etc/pacman.conf <<- 'EOF'
[archzfs]
Include = /etc/pacman.d/mirrorlist-archzfs
EOF
tee -a /etc/pacman.d/mirrorlist-archzfs <<- 'EOF'
Server = https://archzfs.com/$repo/$arch
Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch
@@ -51,7 +56,7 @@ For other kernels or distros, use `archzfs-dkms package`_.
Check kernel variant::
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | sed 's|.img||g' | awk '{ print $1 }')
Check compatible kernel version::
@@ -77,7 +82,7 @@ Check kernel compatibility
Check kernel variant::
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | awk '{ print $1 }')
INST_LINVAR=$(sed 's|.*linux|linux|' /proc/cmdline | sed 's|.img||g' | awk '{ print $1 }')
Check kernel version::