You are not logged in.

#1 2021-11-22 17:51:32

mizzunet
Member
Registered: 2021-11-17
Posts: 4

ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

Cannot boot into Arch after `grub-mkconfig -o /boot/grub/grub.cfg`

ERROR: device '/dev/mapper/arch--lvm-arch--root' not found
mount: /new_root: special device /dev/mapper/arch--lvm-arch--root does not exist.
You are now being dropped into an emergency shell.
sh: can't access tty; job control turned off
[rootfs ]#

I cannot type anything there, it was frozen

Could you please help me?

I have NOT encrypted it

I booted Arch installation media.

`lsblk`

NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                        8:16   0 223.6G  0 disk 
├─sda1                     8:17   0   512M  0 part 
└─sda2                     8:18   0 223.1G  0 part 
  ├─arch--lvm-arch--swap 254:0    0     5G  0 lvm  
  └─arch--lvm-arch--root 254:1    0 218.1G  0 lvm  

Here, `sda1` is the EFI partition


What I tried,

1. Mounted partitions

mkdir arch
mount /dev/arch-lvm/arch-root arch
mount /dev/sda1 arch/boot/efi

2. `arch-chroot`ed `arch` folder and from chroot, and I tried to regenerate `grub` and ramfs`

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

These command ran without any errors

Rebooted, but still the error persists

So, I ran `mkinitcpio` and `grub-mkconfig` after removing `/etc/lvm/lvm2` and then reinstalling `lvm2`, `pacman -S lvm2`

But still not fixed.


`/etc/mkinitcpio.conf`

...
HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)
...

`/etc/default/grub` file https://nekobin.com/nidowowagi

`/etc/fstab` file

# <file system> <dir> <type> <options> <dump> <pass>
UUID=a2c79af7-4a57-4090-bf2d-1f971f07377d /  ext4    defaults,noatime,commit=60  0 1

Thank you very much (:

Last edited by mizzunet (2021-11-22 17:54:44)

Offline

#2 2021-11-22 20:37:24

roccobaroccoSC
Member
Registered: 2021-10-04
Posts: 16

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

You formatted your drive with LVM, which splits your drive into 2 partitions: swap and root.
For your info, technically this is not necessary. You *could* have two normal partitions without LVM.

About your problem: To boot into an LVM root with GRUB, you need to configure it to load the LVM module as described in the Wiki: https://wiki.archlinux.org/title/GRUB#LVM

# /etc/default/grub
GRUB_PRELOAD_MODULES="... lvm"

You need to boot from an installation medium first, because your system is not bootable.
Mount your /dev/mapper/arch--lvm-arch--root under /mnt. arch-chroot into /mnt.
Then change your /etc/default/grub, line 8 should be changed to

GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"

Then regenerate the configuration with grub-mkconfig.

Last edited by roccobaroccoSC (2021-11-22 20:41:33)

Offline

#3 2022-10-15 17:01:30

ushajucda
Member
Registered: 2022-10-15
Posts: 3

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

roccobaroccoSC wrote:

Then change your /etc/default/grub, line 8 should be changed to

GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"

Then regenerate the configuration with grub-mkconfig.

I have the same problem and this doesn't help. I verified that "/boot/grub/grub.cfg" has "insmod lvm" in the corresponded menu entry. It suddenly happened yesterday, the system worked for a couple of years without a problem, regularly updating.

Offline

#4 2022-10-15 20:30:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

Did you reinstall grub as well as regenerating the config? See the news for details of why this is now recommended.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-10-15 21:02:21

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

If you're dropped to initramfs shell, then grub is no longer your problem (except if grub passed the wrong parameters)

In the initramfs shell, you can check `cat /proc/cmdline` (parameters set as expected?) and `cat /proc/partitions` to see if your storage devices got detected at all - for example if you're migrating from SATA SSD to NVME SSD with Clonezilla, it's possible for nvme module to be missing, and thus nvme device unavailable in initramfs stage. In this case you have to boot the fallback image and re-generate initcpio.

You can also try `lvm vgchange -a y` and `ls /dev/mapper/` to see what LVM is doing...

Offline

#6 2022-10-15 21:06:34

ushajucda
Member
Registered: 2022-10-15
Posts: 3

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

I found it. It was missing "lvm2" from HOOKS in "/etc/mkinitcpio.conf". I added and reinstalled lvm2, which regenerated the necessary files in "/boot". I have no idea how and why it worked before.

Offline

#7 2022-10-15 21:22:20

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

Well, without lvm hook, you can still use lvm, just not for the root partition... so if you didn't migrate that to LVM recently, you should have been using it...

Did you perhaps revert mkinitcpio.conf back to default during an update? Usually such files are stored as .pacnew instead to avoid clobbering your custom configs.

Offline

#8 2022-10-15 22:12:15

ushajucda
Member
Registered: 2022-10-15
Posts: 3

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

frostschutz wrote:

Did you perhaps revert mkinitcpio.conf back to default during an update? Usually such files are stored as .pacnew instead to avoid clobbering your custom configs.

Yes, probably that's what happened.

Offline

#9 2022-10-15 22:47:16

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

Please don't necrobump threads like this. Whatever caused difficulties for the OP last year, it wasn't missing the lvm2 hook because that's clearly shown in the initial post.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2022-10-15 23:08:04

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: ERROR: device '/dev/mapper/arch--lvm-arch--root' not found

The OP has not been back since May, so I am going to close this thread to prevent further derails.

ushajucda, please pay attention to the dates on threads and please do not necrobump.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB