You are not logged in.

#1 2018-01-06 17:44:08

0112358
Member
Registered: 2012-04-09
Posts: 38

[SOLVED] Can't boot after update: device not found, no filesystem type

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 off

I 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-linux

The 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

#2 2018-01-06 17:47:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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

#3 2018-01-06 17:49:33

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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

#4 2018-01-06 18:44:04

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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/root

Now 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 successful

Offline

#5 2018-01-06 18:50:56

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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 /mnt

The 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)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2018-01-06 19:06:20

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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

#7 2018-01-09 00:19:52

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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 off

Last edited by 0112358 (2018-01-09 00:41:17)

Offline

#8 2018-01-09 02:14:02

0112358
Member
Registered: 2012-04-09
Posts: 38

Re: [SOLVED] Can't boot after update: device not found, no filesystem type

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=y

Then I ran

# grub-mkconfig -o /boot/grub/grub.cfg
# mkinitcpio -p linux

It'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

Board footer

Powered by FluxBB