Kernel Panic | LUKS on a partition | Arch-aarch64 | QEMU arm

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

Kernel Panic | LUKS on a partition | Arch-aarch64 | QEMU arm

Postby michaelvanstraten » Sun May 29, 2022 6:46 pm

Hello, I have a problem encryption my root partition using LUKS.

I am running on a QEMU 6.2 Virtual machine running on a m1 max mac (Arm CPU).

I started by following this guide https://wiki.archlinux.org/title/Installation_guide#Mount_the_file_systems but I got a Kernel Panic after Booting Arch from Grub:

$this->bbcode_second_pass_code('', '
Booting `Arch Linux'

Loading Linux Image ...
[ 0.654655] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.656247] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.16.13-1-aarch64-ARCH #1
[ 0.657798] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
[ 0.659168] Call trace:
[ 0.659804] dump_backtrace+0x0/0x1cc
[ 0.660299] show_stack+0x18/0x24
[ 0.660858] dump_stack_lvl+0x68/0x84
[ 0.661630] dump_stack+0x18/0x34
[ 0.662024] panic+0x138/0x308
[ 0.662746] mount_block_root+0x14c/0x1fc
[ 0.663473] mount_root+0x150/0x170
[ 0.663870] prepare_namespace+0x134/0x174
[ 0.664399] kernel_init_freeable+0x20c/0x244
[ 0.664772] kernel_init+0x28/0x140
[ 0.665033] ret_from_fork+0x10/0x20
[ 0.665453] SMP: stopping secondary CPUs
[ 0.666465] Kernel Offset: disabled
[ 0.667305] CPU features: 0x00,00000102,96604ec0
[ 0.668416] Memory Limit: none
[ 0.669138] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
')

I have literally reinstalled arch 20 times over the last two days, but I could fix this issue.

This is what I have already tried:

Disk setup


$this->bbcode_second_pass_code('', '
Disk /dev/vda: 134217728 sectors, 64.0 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 3FBBB709-CD8A-4AB4-B261-700218A9037C
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 134217694
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 411647 200.0 MiB EF00 EFI system partition
2 411648 134215679 63.8 GiB 8300 Linux filesystem
')

These are the blkid's.

$this->bbcode_second_pass_code('', '
// blkid
/dev/vdb2: UUID="85c1d1f2-fb63-41e9-84a9-d158e16fbdfe" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="crypto-luks" PARTUUID="b84f9c4e-653f-4ae7-8b34-90562f46cf31"
/dev/vdb1: UUID="628B-DDDB" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="esp" PARTUUID="5ca1f6a9-3da5-49c0-b59f-8bbe2c0f6482"
/dev/mapper/luks: UUID="2d091f55-2649-4e8a-88b4-002b017ece09" BLOCK_SIZE="4096" TYPE="ext4"
/dev/vda2: UUID="d5f8048b-e91d-4265-82b7-100ce418ec13" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="fdd1bb89-1407-4f20-8602-3171179884f2"
/dev/vda1: UUID="1C49-CF7A" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="e7bae034-4e57-443b-b4a6-b769aeac2b39"
')

Encrypting the disk

$this->bbcode_second_pass_code('', '
crpytsetup luksFormat /dev/vda2
crpytsetup open /dev/vda2 luks
')

Creating the File Systems

$this->bbcode_second_pass_code('', '
mkfs.ext4 /dev/mapper/luks
mkfs.fat32 -F32 /dev/vda1
')

Mounting

$this->bbcode_second_pass_code('', '
mount /dev/mapper/luks /mnt
mkdir -p /mnt/boot
mount /dev/vdb1 /mnt/boot
')

Installing Arch


I have tried:
$this->bbcode_second_pass_code('', '
wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt
')

and

$this->bbcode_second_pass_code('', '
pacstrap /mnt base linux-aarch64 linux-firmware
')

with the same result.


Configuration

$this->bbcode_second_pass_code('', '
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt

cat /etc/fstab
# /dev/mapper/luks
UUID=2d091f55-2649-4e8a-88b4-002b017ece09 / ext4 rw,relatime 0 1

# /dev/vda1
UUID=1C49-CF7A /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 2
')

I add encrypt, keyboard and keymap to /etc/mkinitcpio.conf in the hooks section.
$this->bbcode_second_pass_code('', '
HOOKS=(base udev autodetect [b]keyboard[/b] [b]keymap[/b] consolefont modconf block [b]encrypt[/b] filesystems fsck)
')

I have tried:
$this->bbcode_second_pass_code('', '
mkinitcpio -p linux-aarch64
')
and
$this->bbcode_second_pass_code('', '
mkinitcpio -P
')

Bootloader

I have tried both Grub and Systemd-boot, both resulted in the same thing, that's why I only listed the Grub configuration.

$this->bbcode_second_pass_code('', '
grub-install --target=arm64-efi --efi-directory=/boot --bootloader-id=GRUB
')

I edited /etc/default/grub:
$this->bbcode_second_pass_code('', '
GRUB_CMDLINE_LINUX="crtyptdevice=UUID=d5f8048b-e91d-4265-82b7-100ce418ec13:luks root=/dev/mapper/luks"
')
here I also tried using the more unstable approach, but that did not work either.
$this->bbcode_second_pass_code('', '
GRUB_CMDLINE_LINUX="crtyptdevice=/dev/vda2:luks root=/dev/mapper/luks"
')

In both cases I ran
$this->bbcode_second_pass_code('', '
grub-mkconfig -o /boot/grub/grub.cfg
')
Afterwords.

Exit

$this->bbcode_second_pass_code('', '
exit
umount -a
reboot
')

I would be very grateful if somebody could help me with this.
michaelvanstraten
 
Posts: 1
Joined: Tue May 24, 2022 4:10 pm

Return to ARMv8

Who is online

Users browsing this forum: No registered users and 47 guests