You are not logged in.
I recently updated my system and turned off my machine before leaving on vacation. When I returned, my machine will no longer boot up.
The error:
ERROR: device '/dev/mapper/root' not found. Skipping fsck.
mount: /new_root: no filesystem type specified.
You are now being dropped into an emergency shell.
sh: can't access tty: job control turned offI have a vfat boot partition(at least I believe it is meant to be a boot partition since my fstab mounts it at /boot; it's been a while since I set this up) and an encrypted btrfs partition with root and home subvolumes. I can decrypt and mount the devices from a live USB:
# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
|-sda1 vfat ****
|-sda2 crypto_LUKS ****
|-<mapped name> btrfs ****These are the contents of sda1:
# ls /mnt
boot EFI grub intramfs-linux-fallback.img intrams-linux.img loader proc run sys tmp vmlinuz-linuxThe boot directory is empty; not sure if that is notable.
I've read a bunch of other posts with somewhat similar issues and various answers have involved chrooting in to update pacman or running mkinitcpio or other things. I've started on a few of these paths but run into different roadblocks and instead of breadth-first-searching my way through them I want to ask if anyone can tell me what the right thing to do is, or let me know what other information I can post that would be useful. Thanks in advance.
Last edited by 0112358 (2018-01-09 02:14:55)
Offline
If sda1 is meant to be mounted on /boot then the 'boot' directory within it is odd, but not nearly so odd as 'proc', 'run', 'sys', and 'tmp'. What is in those?
Oh, wait, did you try to chroot into sda1? That might explain those - though the chroot would fail and those should have been cleaned up if your were using arch-chroot. Did you make those directories manually in order to chroot?
Last edited by Trilby (2018-01-06 17:48:59)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
They are empty. As I mentioned I was mucking around with other solutions and may have created them as mount points for a chroot (likely doing it wrong I'm sure).
Edit in reply to your edit: yes I was trying to manually chroot.
Edit2: does that mean a proper choot for this system should use the btrfs root subvolume as the chroot target, and sda1 should be mounted on the chroot's /boot?
Last edited by 0112358 (2018-01-06 17:57:58)
Offline
Trying a correct chroot:
#mount /dev/mapper/btrfs /mnt
#ls /mnt
home root
#mount /dev/sda1 /mnt/root/boot
# cd /mnt
# mount -t proc proc proc/
# mount --rbind /sys sys/
# mount --rbind /dev dev/
# mount --rbind /run run/
# chroot /mnt/rootNow attempting mkinitcpio I get this error:
# mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/intramfs-linux.img -S autodetect
==> Starting build: 4.14.4-1-ARCH
...
==> ERROR: failed to detect root filesystem
...
==> Image generation successfulOffline
I've just realised you're using btrfs subvolumes. The correct procedure for setting up a chroot would be...
mount /dev/mapper/btrfs /mnt -o subvol=root
mount /dev/mapper/btrfs /mnt/home -o subvol=home
mount /dev/sda1 /mnt/boot
cd /mnt
mount -t proc proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
mount --rbind /run run/
chroot /mntThe line for mounting /home isn't necessary in this situation, I just included it for clarity.
Last edited by Slithery (2018-01-06 19:14:28)
Offline
Thank you, that helps with the chroot.
I can now run mkinitcpio successfully, however the original problem on boot is unchanged.
Should I try to update my system with pacman -Syu? So far I haven't been able to establish a network connection to try this.
Last edited by 0112358 (2018-01-06 19:15:45)
Offline
Okay, so I managed to get the network up in the chroot by tethering to my phone, ran pacman -Syu and mkinitcpio -p linux. Unfortunately none of this has had any effect on my initial problem. I am absolutely stumped at this point. Other than reinstalling the OS (which I really, really don't want to do) I have no ideas. Can anyone help?
Edit: actually the second line of my error message is in fact slightly different now, so I guess there was some effect:
ERROR: device '/dev/mapper/root' not found. Skipping fsck.
mount: /new_root: special device /dev/mapper/root does not exist.
You are now being dropped into an emergency shell.
sh: can't access tty: job control turned offLast edited by 0112358 (2018-01-09 00:41:17)
Offline
Looks like I was able to fix the immediate problem. I did several things, one or all of which may have provided the fix:
1. added encrypt and btrfs to the HOOKS section of /etc/mkinitcpio.conf
2. modified /etc/default/grub to include
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"and uncommented
GRUB_ENABLE_CRYPTODISK=yThen I ran
# grub-mkconfig -o /boot/grub/grub.cfg
# mkinitcpio -p linuxIt's not clear what exactly happened here since my system has been running fine for a couple of years without that stuff, but I guess that's life on the bleeding edge...
Offline