Fixes for Fedora; support Rocky Linux Live ISO

Signed-off-by: Maurice Zhou <jasper@apvc.uk>
This commit is contained in:
Maurice Zhou
2021-08-04 23:24:09 +08:00
committed by George Melikov
parent 9261cfb4f5
commit ae7c5d19f4
15 changed files with 146 additions and 126 deletions

View File

@@ -43,7 +43,7 @@ Preparation
#. Install helper script and partition tool::
dnf install -y arch-install-scripts gdisk
dnf install -y arch-install-scripts gdisk dosfstools
#. Target Fedora version::
@@ -94,6 +94,24 @@ Preparation
INST_VDEV=
This will create a single vdev with the topology of your choice.
It is also possible to manually create a pool with multiple vdevs, such as::
zpool create --options \
poolName \
mirror sda sdb \
raidz2 sdc ... \
raidz3 sde ... \
spare sdf ...
Notice the cost of parity when using RAID-Z. See
`here <https://www.delphix.com/blog/delphix-engineering/zfs-raidz-stripe-width-or-how-i-learned-stop-worrying-and-love-raidz>`__
and `here <https://docs.google.com/spreadsheets/d/1tf4qx1aMJp8Lo_R6gpT689wTjHv6CGVElrPqTA0w_ZY/>`__.
Refer to `zpoolconcepts <https://openzfs.github.io/openzfs-docs/man/7/zpoolconcepts.7.html>`__
and `zpool-create <https://openzfs.github.io/openzfs-docs/man/8/zpool-create.8.html>`__
man pages for details.
#. Set partition size:
Set ESP size::

View File

@@ -81,6 +81,10 @@ System Configuration
``systemd-firstboot`` have bugs, root password is set below.
#. Generate host id::
zgenhostid -f -o /mnt/etc/hostid
#. Install locale package, example for English locale::
dnf --installroot=/mnt install -y glibc-minimal-langpack glibc-langpack-en
@@ -95,6 +99,7 @@ System Configuration
disable SSH server::
systemctl disable sshd --root=/mnt
systemctl enable firewalld --root=/mnt
#. Chroot::
@@ -102,16 +107,16 @@ System Configuration
INST_LINVAR=$INST_LINVAR
INST_UUID=$INST_UUID
INST_ID=$INST_ID
unalias -a
INST_VDEV=$INST_VDEV" > /mnt/root/chroot
echo DISK=\($(for i in ${DISK[@]}; do printf "$i "; done)\) >> /mnt/root/chroot
arch-chroot /mnt bash --login
unalias -a
#. Source variables::
source /root/chroot
#. Relabel filesystem on next boot::
#. For SELinux, relabel filesystem on next boot::
fixfiles -F onboot

View File

@@ -54,9 +54,6 @@ Install GRUB
dracut --force --kver $kernel_version
done
#. When in doubt, install both legacy boot
and EFI.
#. Disable BLS::
echo "GRUB_ENABLE_BLSCFG=false" >> /etc/default/grub
@@ -70,6 +67,9 @@ Install GRUB
Boot environment-specific configuration (kernel, etc)
is stored in ``/boot/grub2/grub.cfg``, enabling rollback.
#. When in doubt, install both legacy boot
and EFI.
#. If using legacy booting, install GRUB to every disk::
for i in ${DISK[@]}; do
@@ -93,6 +93,7 @@ Install GRUB
#. For both legacy and EFI booting: mirror ESP content::
ESP_MIRROR=$(mktemp -d)
unalias -a
cp -r /boot/efi/EFI $ESP_MIRROR
for i in /boot/efis/*; do
cp -r $ESP_MIRROR/EFI $i

View File

@@ -21,13 +21,14 @@ This section is also applicable if you are in
#. On another computer, generate rescue image with::
pacman -S --needed mtools libisoburn grub
grub-install
grub-mkrescue -o grub-rescue.img
dd if=grub-rescue.img of=/dev/your-usb-stick
Boot computer from the rescue media.
Both legacy and EFI mode are supported.
Skip this step if you are in GRUB rescue.
Or `download generated GRUB rescue image <https://gitlab.com/m_zhou/bieaz/uploads/4a1b7cefb42723de6eb04f9dc485be3b/grub-rescue.img.7z>`__.
#. List available disks with ``ls`` command::
@@ -36,20 +37,6 @@ This section is also applicable if you are in
hd0 hd1 hd2 hd3
If you are dropped to GRUB rescue instead of
booting from GRUB rescue image, boot disk can be found
out with::
echo $root
# cryto0
# hd0,gpt2
GRUB configuration is loaded from::
echo $prefix
# (crypto0)/sys/BOOT/default@/grub
# (hd0,gpt2)/sys/BOOT/default@/grub
#. List partitions by pressing tab key:
.. code-block:: text
@@ -94,12 +81,10 @@ This section is also applicable if you are in
grub> ls (crypto0)/sys/BOOT
@/ default/ be0/
#. Instruct GRUB to load configuration from ``be0`` boot environment
then enter normal mode::
#. Instruct GRUB to load configuration from ``be0`` boot environment::
grub> prefix=(crypto0)/sys/BOOT/be0/@/grub
grub> insmod normal
grub> normal
grub> configfile $prefix/grub.cfg
#. GRUB menu should now appear.
@@ -188,7 +173,7 @@ Access system in chroot
#. chroot into the system::
fedora-chroot /mnt /bin/bash --login
arch-chroot /mnt /bin/bash --login
zfs mount -a
mount -a
@@ -202,21 +187,21 @@ it is relatively easy to perform a system backup and migration.
#. Create a snapshot of root file system::
zfs snapshot -r rpool/fedora@backup
zfs snapshot -r bpool/fedora@backup
zfs snapshot -r rpool/arch@backup
zfs snapshot -r bpool/arch@backup
#. Save snapshot to a file or pipe to SSH::
zfs send --options rpool/fedora@backup > /backup/fedora-rpool
zfs send --options bpool/fedora@backup > /backup/fedora-bpool
zfs send --options rpool/arch@backup > /backup/arch-rpool
zfs send --options bpool/arch@backup > /backup/arch-bpool
#. Re-create partitions and root/boot
pool on target system.
#. Restore backup::
zfs recv rpool_new/fedora < /backup/fedora-rpool
zfs recv bpool_new/fedora < /backup/fedora-bpool
zfs recv rpool_new/arch < /backup/arch-rpool
zfs recv bpool_new/arch < /backup/arch-bpool
#. Chroot and reinstall bootloader.

View File

@@ -34,9 +34,18 @@ see below.
dnf copr enable -y kwizart/kernel-longterm-5.4
dnf install -y kernel-longterm kernel-longterm-devel
# reboot to new LTS kernel
Reboot to new LTS kernel, then load kernel module::
modprobe zfs
It might be necessary to rebuild module::
ls -1 /lib/modules \
| while read kernel_version; do
dkms autoinstall -k $kernel_version
done
#. By default ZFS kernel modules are loaded upon detecting a pool.
To always load the modules at boot::