Fix fstab by using a UUID for boot

This commit is contained in:
Kris Lamoureux 2022-10-27 01:16:57 -04:00
parent 3fffb1c169
commit 6658fbf36d
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 14 additions and 7 deletions

View File

@ -37,13 +37,19 @@ Due to [licensing concerns with OpenZFS and Linux](https://openzfs.github.io/ope
--graphics vnc,listen=127.0.0.1,port=5901 \ --graphics vnc,listen=127.0.0.1,port=5901 \
--boot uefi,loader=/usr/shar/OVMF/OVMF_CODE.fd --boot uefi,loader=/usr/shar/OVMF/OVMF_CODE.fd
``` ```
6. If dropped into initramfs 6. If dropped into UEFI shell
```
Shell> FS0:
FS0:\> EFI\debian\grubx64.efi
```
7. If dropped into initramfs
``` ```
zpool import -f rpool zpool import -f rpool
exit exit
``` ```
7. Enter rpool password 8. Enter rpool password
8. Login with root's password 9. Login with root's password
### License ### License
- DebianZFS is licensed under 0BSD, a public domain equivalent license; see the `LICENSE` file for more information - DebianZFS is licensed under 0BSD, a public domain equivalent license; see the `LICENSE` file for more information

View File

@ -32,8 +32,8 @@ swapoff --all
# Partition # Partition
sgdisk -n2:1M:+512M -t2:EF00 "$DISK" sgdisk -n2:1M:+512M -t2:EF00 "$DISK"
sgdisk -n3:0:+1G -t3:BF01 "$DISK" sgdisk -n3:0:+1G -t3:BF01 "$DISK"
sgdisk -n4:0:0 -t4:BF00 "$DISK" sgdisk -n4:0:0 -t4:BF00 "$DISK"
# Create boot pool # Create boot pool
zpool create -f \ zpool create -f \
@ -176,9 +176,10 @@ echo REMAKE_INITRD=yes > /etc/dkms/zfs.conf
# Install Grub for UEFI # Install Grub for UEFI
apt-get install -y dosfstools apt-get install -y dosfstools
echo REMAKE_INITRD=yes > /etc/dkms/zfs.conf echo REMAKE_INITRD=yes > /etc/dkms/zfs.conf
mkdosfs -F 32 -s 1 -n EFI "${DISK}2" mkdosfs -F 32 -s 1 -n EFI "\${DISK}2"
mkdir /boot/efi mkdir /boot/efi
echo "${DISK}2" /boot/efi vfat defaults 0 0 >> /etc/fstab BLKID_BOOT="/dev/disk/by-uuid/\$(blkid -s UUID -o value \${DISK}2)"
echo "\${BLKID_BOOT} /boot/efi vfat defaults 0 0" >> /etc/fstab
mount /boot/efi mount /boot/efi
apt-get install -y grub-efi-amd64 shim-signed apt-get install -y grub-efi-amd64 shim-signed
apt-get purge -y os-prober apt-get purge -y os-prober