You are not logged in.
I'm fairly new to linux but decided to dive right in with arch-linux 2021.06.01 to become familiar with everything.
Unfortunatelly I can't even finish the installation - shame on me.
The error while booting after setting arch up is:
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.I went for btrfs on luks on lvm
The layout looks like this
sda
|- sda1 512MB fat32 /boot
`- sda2 remaining lvm
|- cryptswap 4GB swap
|- crypttmp 2GB tmp /tmp
`- cryptroot remaining btrfs
|- @ /
|- @home /home
|- @snapshots /.snapshots
|- @log /var/log
|- @cache /var/cache
`- @tmp /var/tmpThose are the commands and configurations I used to setup arch:
dd status=progress if=/dev/zero of=/dev/sdagdisk /dev/sdaoboot partition
n
↵
↵
+512M
ef00lvm partition
n
↵
↵
↵
8e00wsetup lvm
pvcreate /dev/sda2
vgcreate vg1 /dev/sda2
lvcreate -L 4G -n cryptswap vg1
lvcreate -L 2G -n crypttmp vg1
lvcreate -l 100%FREE cryptroot vg1setup encryption
cryptsetup luksFormat /dev/vg1/cryptroot
cryptsetup open /dev/vg1/cryptroot rootmake filesystems
mkfs.fat -F32 -n BOOT /dev/sda1
mkfs.btrfs --label ROOT /dev/mapper/rootcreate btrfs subvolumes
mount /dev/mapper/root /mnt
cd /mnt
btrfs subvolume create @
btrfs subvolume create @home
btrfs subvolume create @snapshots
btrfs subvolume create @log
btrfs subvolume create @cache
btrfs subvolume create @tmp
cd ..
umount /mntmount btrfs subvolumes and BOOT partition
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@ /dev/mapper/root /mnt
mkdir /mnt/home
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@home /dev/mapper/root /mnt/home
mkdir /mnt/.snapshots
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@snapshots /dev/mapper/root /mnt/.snapshots
mkdir /mnt/var
mkdir /mnt/var/log
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@log /dev/mapper/root /mnt/var/log
mkdir /mnt/var/cache
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@cache /dev/mapper/root /mnt/var/cache
mkdir /mnt/var/tmp
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@tmp /dev/mapper/root /mnt/var/tmp
mkdir /mnt/boot
mount /dev/sda1 /mnt/bootpacstrap /mnt base linux linux-firmware lvm2 btrfs-progs amd-ucode vimgenfstab -L /mnt > mnt/etc/fstabarch-chroot /mntbasic configuration
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
vim /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
echo "KEYMAP=de-latin1" >> /etc/vconsole.conf
echo "devstation" >> /etc/hostname
vim /etc/hostsvim /etc/mkinitcpio.confthe mkinitcpio.conf content:
MODULES=(btrfs)
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block lvm2 encrypt filesystems fsck)mkinitcpio -p linuxbootctl installecho "default arch" > /boot/loader/loader.confvim /boot/loader/entries/arch.confthe arch.conf content
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID={/dev/vg1/cryptroot uuid inserted here}:root root=/dev/mapper/root rwexitumount -apoweroffPulling the arch installation medium out of the computer and starting it.
The booting output
:: running early hook [udev]
Starting version 248.3-2-arch
:: running hook [udev]
:: Triggering uevents...
:: running hook [keymap]
:: Loading keymap...done.
:: running hook [encrypt]
A password is requires to acces the root volume:
Enter passphrase for /dev/mapper/vg1-cryptroot: {inserting passphrase}
:: performing fsck on '/dev/mapper/root'
:: mounting '/dev/mapper/root' on real root
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.
sh: can't access tty; job control turned off
[rootfs ]#Obviously I didn't setup cryptswap and crypttmp, yet. Those will be setup with crypttab and fstab. I am just mentioning this, and highly doubt it is part of the problem.
So.. what is the problem here? ![]()
Thanks for your time/help and reading this through.
Addition:
Going back in via the installation medium entering the following commands
cryptsetup open /dev/vg1/cryptroot root
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@ /dev/mapper/root /mnt
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@home /dev/mapper/root /mnt/home
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@snapshots /dev/mapper/root /mnt/.snapshots
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@log /dev/mapper/root /mnt/var/log
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@cache /dev/mapper/root /mnt/var/cache
mount -o noatime,compress=lzo,space_cache=v2,discard=async,subvol=@tmp /dev/mapper/root /mnt/var/tmp
mount /dev/sda1 /mnt/boot
arch-chroot /mntls -l /sbin/inityields
lrwxrwxrwx 1 root root 22 May 18 12:32 /sbin/init -> ../lib/systemd/systemdand
ls -l /sbin/../lib/systemd/systemdyields
-rwxr-xr-x 1 root root 1710216 May 18 12:32 /sbin/../lib/systemd/systemdLast edited by VVishion (2021-06-16 10:13:48)
Offline
Adding
rootflags=subvol=@to /boot/loader/entries/arch.conf like so
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID={/dev/vg1/cryptroot uuid inserted here}:root root=/dev/mapper/root rootflags=subvol=@ rwdid the trick.
If someone knows why I saw many videos (6 months to 1 year old) where this flag was not necessary to add, but for me - I am curious to know.
Offline
Hello,
if no subvolumes are specified, the default subvolume is mounted. The default subvolume is configurable and it is the root subvolume (/) by default. The /sbin/init (and rest of the os) is under @ so you got that error. Changing the default subvolume to @ would also solve this problem and
rootflags=subvol=@would not be necessary.
Offline
Thanks for that explanation. I've watched many different videos over 2 days to get an idea of possible layouts and technologies (luks, lvm, btrfs) for my setup. But I can't imagine I've missed every time they've set rootflags or made @ the default subvolume.
Is the default subvolume the btrfs subvolume container (all other btrfs subvolumes lay one level below inside the container) or is the default subvolume a subvolume '/' created with btrfs subvolume create /mnt/ which may or may not exist?
Last edited by VVishion (2021-06-16 10:58:27)
Offline
Indeed, running
btrfs subvolume get-default /mntwith the btrfs fs mounted at /mnt like
mount /dev/mapper/root /mntyields the btrfs subvolume container
ID 5 (FS_TREE)Sry, for asking questions I can answer myself. Have a great day.
Last edited by VVishion (2021-06-16 10:58:38)
Offline