You are not logged in.

#1 2021-02-05 16:43:41

bradw
Member
Registered: 2019-03-19
Posts: 11

[Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

First time in stalling newest release. I get to grub ok and then message stating starting version 247.3-1-arch. Then I drop to rescue shell and receive following:

Error device 'dev/mapper/cryptroot' not found. skipping fsck
mount: /new root: no file system type specified. You are now being dropped into emergency shell. Sh cant access tty,
job control turned off.
[rootfs]#

I do not know what to do at this point. Up front I will say that I dont know anything about using rescue. I dont even no what commands to try to use or what went wrong. I tried to run crypt /dev/sda2 cryptroot and nothing happened. I also tried to run cryptsetup luksopen /dev/sda2 and nothing again.

I then tried to run mkdir /mnt and was able to do so with success. so then I ran mount mount /dev/sda2 /mnt and receive and error " mount:/mnt: unknown filesystem type 'crypto-luks'".

I really would like to learn arch and would like to learn to rescue this system but I just dont know enough. I could try re-installing but I dont want to. I would much rather learn to fix this. If anyone is willing to assist I would pretty much need directions to get the information you need to help me solve this. My setup is an older 2010 dell inspirion desktop and perhaps a 660 model. This is being typed on a manjaro desktop sitting next to arch desktop. My problem is my knowledge of arch and perhaps linux itself is nothing but I'm tired of other distros that do everything for me. How do I learn that way - I dont.

Any and all suggestions are welcomed and thankyou if you do try

Last edited by bradw (2021-02-07 07:01:05)

Offline

#2 2021-02-05 16:59:53

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 8,339

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

Post your mkinitcpio.conf

Offline

#3 2021-02-05 17:06:15

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

Scimmia wrote:

Post your mkinitcpio.conf

I dont know how to get to it. I assume I rebbot and use the usb drive and at a prompt try to mount my drives and if successful than cat it out and post results but I have not rebooted my pc and still at the rescue prompt.

Offline

#4 2021-02-05 17:10:15

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,173

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

Which instructions did you follow to install Arch?


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

#5 2021-02-05 17:19:10

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

I printed out and followed the installation guide and a section on lvm with encryption and then watched a few videos but felt that was cheating and maybe hurting my ability to learn so I did what I could with the wiki. It was my fourth attempt and boy did I get excited when I saw finally saw that grub prompt after the first three attempts failed but now realize I have failed again. It is ok I failed because failure has always taught me so I just keep trying. I will keep trying and succeed and most importantly learn along the way. I'm a little old but I dont care as my mind works and I'm having a blast.

I forgot to mention during the install when I ran "cryptsetup -y -v luksFormat /dev/sda2 I recieved and error that said WARNING: locking directory /run/cryptsetup is missing" but then it seemed to work as I was able to  run "cryptsetup open /dev/sda cryptroot and I could succesfully open it then I ran mkfs.ext4 /dev/mapper/cryptroot. Then I ran mkfs.ext4 /dev/mappercryptroot with success.

for efi partition I ran mkfs.fat -F32 /dev/sda1 and that was a success so then I mounted both after making a dir for sda1 using /mnt/boot and then ran mount /dev/sda1 /mnt/boot and then continued on with the install.

The warning mentioned above has me puzzled and a google search did not help with the warning. Perhaps I typed something wrong that produced the warning message but I dont know. I always check the commands before executing to make sure I typed what I wanted but perhaps I messed up. Re-installing is not what I want to do, I want to learn to fix it but I know my lack of knowledge is hurting me but I will keep trying. Do you know any part of the wiki I should focus on?

Also I do remember doing this for mkinitcpio
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck) where I inserted 'encrypt' without quotes as in the above line. Do I need to put lvm or lvm2 after the insertion of encrypt?

I found just now found a post that states :Of course it's always possible
to run `mkdir -m0700 /run/cryptsetup` prior to the first call to
`cryptsetup luksOpen` and wandering if this would do anything for me? Problem is I dont know where to create this directory but I'm guessing on /dev/sda2. What are your thoughts and of course I want to fix instead of reinstalling but can reinstall if you think creating this directory would help.
thank you

Last edited by bradw (2021-02-05 18:17:07)

Offline

#6 2021-02-06 12:33:35

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

When you are dropped to the rescue shell what is the output of  `cat /proc/cmdline` and from the live media the output of `blkid`.

Offline

#7 2021-02-06 18:36:15

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

from rescue prompt of cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=UUID=85ca488e-f784-4b0f-e1f8d26ecbba rw cryptdevice-UUID-597b05dc-6b22-47d9-930f-95c411370c5
:cryptroot root=/dev/sda/mapper/cryptroot loglevel=3 quite

blkid from live media
/dev/sda1: UUID="DE53-B89E" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="0ac746f3-3663-4347-8f00-ec2a0365068f"
/dev/sda2: UUID="597b05dc-6b22-47d9-930f-95c411370c5" TYPE"crypto-LUKS" PARTLABEL="linux filesystem" PARTUUID="1cdc48ac-ded7-4c2f-baa5-3cd150650f79"
/dev/sdb1: BLOCK_SIZE="2048" UUID"2021-02-01-15-18-34-00" LABEL=ARCH_202102" TYPE="iso9660" PARTUUID="31323032-3230-4130-b131-303531383334"
/dev/sdb2: SEC-TYPE="msdos" LABEL_FATBOOT="ARCHISO_EFI" LABEL="ARCHISO_EFI" UUID="C3B0-B855" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Appended2" PARTUUID="31323032-3230-4130-b131-303531383334"
/dev/sdb3: PARTLABEL="Gap1" PARTUUID="31323032-3230-4130-b131-303531383334"
/dev/loop0: TYPE="squashfs"

When comparing the two I think I made a error when choosing the partition type for /dev/sda2. The output for /dev/sda2 from blkid on live media shows PARTLABEL="linux filesystem" and I think it should read something about lvm. It appears I did not change the type to lvm. Is this my mistake? If so is there a way to fix it without reinstalling. Not sure how to do it but I'm thinking along the lines of remounting all partitions, changing /dev/sda2 type to lvm, running dmprobe agian, running vgscan again, running vgchange -ay again and if this is correct order. When I do try to mount /dev/sda2 I get some error Not sure how to do it or if it will work or if this is really the problem.

If I may ask another question, why did this happen " when I ran "cryptsetup -y -v luksFormat /dev/sda2 I recieved and error that said WARNING: locking directory /run/cryptsetup is missing". Also where does a body go to learn about rescue? I'm thinking or hoping there my be a webpage or book or somewhere where someone with none to little experience can learn. After I post this I will see if there is a man page for rescue which I assume there is but looking for perhaps something broader.

Thank you for your time

Offline

#8 2021-02-06 18:55:31

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

bradw wrote:

I forgot to mention during the install when I ran "cryptsetup -y -v luksFormat /dev/sda2 I recieved and error that said WARNING: locking directory /run/cryptsetup is missing" but then it seemed to work as I was able to  run "cryptsetup open /dev/sda cryptroot and I could succesfully open it then I ran mkfs.ext4 /dev/mapper/cryptroot. Then I ran mkfs.ext4 /dev/mappercryptroot with success.

/dev/sda2: UUID="597b05dc-6b22-47d9-930f-95c411370c5" TYPE"crypto-LUKS" PARTLABEL="linux filesystem" PARTUUID="1cdc48ac-ded7-4c2f-baa5-3cd150650f79"

That entry looks fine to me for a LUKS container.  You did not mention running any LVM commands.  Did you forget to mention those or is the LUKS container formatted ext4 without using LVM?

Also what is the output of (make sure sda2 is still encrypted /home)

cryptsetup luksUUID /dev/sda2

The UUID should match

cryptdevice=UUID=597b05dc-6b22-47d9-930f-95c411370c5:cryptroot

I assume the - instead of equals was a transcription error

cryptdevice-UUID-597b05dc-6b22-47d9-930f-95c411370c5:cryptroot

Is

root=/dev/sda/mapper/cryptroot

instead of

root=/dev/mapper/cryptroot

a transcription error?

For rescuing a new installation I would suggest rereading the relevant wiki pages.  Also read other threads on the forums to see what commands were used.

Offline

#9 2021-02-06 19:55:25

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

output of cryptsetup luksUUID /dev/sda2 is 597b05dc-6b22-47d9-930f-95c411370c5 and not cryptdevice=UUID=597b05dc-6b22-47d9-930f-95c411370c5:cryptroot. So does this tell me I formatted the LUKS container ext4 without using LVM?

Your transcription assumptions are correct

Is

root=/dev/sda/mapper/cryptroot results in no suchj file or directory.

I will go read rescue or recovery wiki pages but I think my install is hosed

thank you

Offline

#10 2021-02-06 20:04:16

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

597b05dc-6b22-47d9-930f-95c411370c5 is the UUID for the luks container.  It tells you nothing about the contents of the container.  The only way to find the contents of the encrypted container is to open it.
If you can mount /dev/mapper/cryptroot directly then no LVM is in use.

cryptdevice=UUID=597b05dc-6b22-47d9-930f-95c411370c5:cryptroot

Tells the encryt hook to find a partition with that UUID and open it and use cryptroot for the mapping name which you then use in the root parameter root=/dev/mapper/cryptroot
Edit:
When you boot does the encrypt hook prompt you for a password to unlock cryptroot?

Last edited by loqs (2021-02-06 20:07:03)

Offline

#11 2021-02-06 20:15:27

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

If you can mount /dev/mapper/cryptroot directly then no LVM is in use. No I cannot mount it at rescue prompt. I get /dev/mapper/cryptroot: cant find in /etc/fstab

When you boot does the encrypt hook prompt you for a password to unlock cryptroot? Nope and I know it should after reading more, it just frops me to rescue prompt.

Offline

#12 2021-02-06 20:42:21

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

bradw wrote:

No I cannot mount it at rescue prompt. I get /dev/mapper/cryptroot: cant find in /etc/fstab

From the rescue prompt you need to do the same as for the installation media and supply a mount point.
Assuming the LUKS container has been mapped to /dev/mapper/cryptroot

mount /dev/mapper/crypotroot /mnt
bradw wrote:

When you boot does the encrypt hook prompt you for a password to unlock cryptroot? Nope and I know it should after reading more, it just frops me to rescue prompt.

From the live media,  chroot into the system ( remeber to mount the ESP ) then post the output of :

cat /etc/mkinitcpio.conf
lsinitcpio /boot/initramfs-linux.img

See the tip box from pastebin to pipe the outputs directly to a pastebin then you can post the links.

Offline

#13 2021-02-06 21:49:29

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

mount /dev/mapper/cryptroot /mnt resulted in mount:/mnt: no filesystem type specified and the second request I dont know how to do. I think Im going to resinstall. But why do I get this: "cryptsetup -y -v luksFormat /dev/sda2 I recieved and error that said WARNING: locking directory /run/cryptsetup is missing.

Is it critical or should I just ignore the message?

It is day three for me and I have installed arch a few years back but probably without encrypted lvm but I just cant remember. I think I need to read alot and try again. Im also going to try with release 12.2020 and I dont know if it will make a difference and/or bios install as I'm not sure this pc has efi support. Bios says it does but I remember reading something about old MB when efi just came out had issues of some sort.  Im going to leave this topic open for a few days just in case same thing happens. Thank you very much for helping me but I think I just dont know enough to assist you to assist me and I dont really think it is fair to you.

Offline

#14 2021-02-06 22:01:54

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

What version of the installation media is producing that message?

Offline

#15 2021-02-06 22:10:06

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

february 2021 is the answer to your question

Also a week or so I read on someone's site the following and can you explain it to me? Im thinking it has something to do with my install but once again dont know enough to tell.

Setup Grub and EFI
This step is vitally important. A mistake here will prevent your system from booting. Ask me how I know.

Start by editing the /etc/default/grub file. There are three changes to make here.

Uncommenting the GRUB_ENABLE_CRYPTODISK=y line
Adding cryptdevice=/dev/sda3:vg:allows-discards to the GRUB_CMDLINE_LINUX_DEFAULT line
Adding lvm to the GRUB_PRELOAD_MODULES line
The first change is made by removing the # at the beginning of the GRUB_ENABLE_CRYPTODISK=y line.

The second change is the trickiest. Edit the GRUB_CMNLINE_LINUX_DEFAULT line and add cryptdevice=/dev/sda3:vg:allow-discards to it. In my case I put it just before the quiet argument that was already there. A typo here, say spelling the argument cryptodevice will render the configuration inoperable. There won’t be any errors, but the machine will only boot to a grub prompt.

The third change is to add lvm to the list of preloaded modules. The list is space-delimited. I put lvm at the end of the list.

Here are those three lines after the edits. The rest of the file is not shown below.

...
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 cryptdevice=/dev/sda3:vg:allow-discards quiet"
...
GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"
...
GRUB_ENABLE_CRYPTODISK=y
...
Once the changes have been made and saved Grub can be installed

grub-install --target=x86_64-efi -efi-directory=/efi --bootloader-id=grub_uefi --recheck
Since I opted to put the EFI partition in a non-standard location, I needed to add the --efi-directory=/efi directive to the command.

Finally generate the grub configuration file

grub-mkconfig -o /boot/grub/grub.cfg

Offline

#16 2021-02-06 22:36:48

kermit63
Member
Registered: 2018-07-04
Posts: 69

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

bradw wrote:

WARNING: locking directory /run/cryptsetup is missing

You can ignore this warning if cryptsetup is successful unlocking your encrypted partition. I have seen this warning regardless of the monthly arch installer version over the past few months.

As for your other questions, I'll leave it to @loqs since he is more knowledgeable than me. He is also probably the most patient helper on this forum.

Offline

#17 2021-02-06 22:42:11

loqs
Member
Registered: 2014-03-06
Posts: 13,005

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

@kermit63 the issue I have with continuing to provide support in this thread is:

bradw wrote:

Also a week or so I read on someone's site the following and can you explain it to me? Im thinking it has something to do with my install but once again dont know enough to tell.

Setup Grub and EFI
This step is vitally important. A mistake here will prevent your system from booting. Ask me how I know.

Start by editing the /etc/default/grub file. There are three changes to make here.

Uncommenting the GRUB_ENABLE_CRYPTODISK=y line
Adding cryptdevice=/dev/sda3:vg:allows-discards to the GRUB_CMDLINE_LINUX_DEFAULT line
Adding lvm to the GRUB_PRELOAD_MODULES line
The first change is made by removing the # at the beginning of the GRUB_ENABLE_CRYPTODISK=y line.

The second change is the trickiest. Edit the GRUB_CMNLINE_LINUX_DEFAULT line and add cryptdevice=/dev/sda3:vg:allow-discards to it. In my case I put it just before the quiet argument that was already there. A typo here, say spelling the argument cryptodevice will render the configuration inoperable. There won’t be any errors, but the machine will only boot to a grub prompt.

The third change is to add lvm to the list of preloaded modules. The list is space-delimited. I put lvm at the end of the list.

Here are those three lines after the edits. The rest of the file is not shown below.

...
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 cryptdevice=/dev/sda3:vg:allow-discards quiet"
...
GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"
...
GRUB_ENABLE_CRYPTODISK=y

Some unsupported guide was used and the end result is a none functioning installation where bradw does not understand what the commands he has used do or even if the system uses LVM.

Last edited by loqs (2021-02-06 22:42:40)

Offline

#18 2021-02-06 22:42:33

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

Yes he is very patient and I noticed his time stamp is one hour ahead of mine so he must be close but unfortuantely not next door:). I just got a call from a friend installing 12.2020 and he got the same error a few minutes ago. Throws us new guys into a panic and then makes us think that is the cause of all our problems. Thank you for chiming in at least know I know to ignore the message and not panic.

Offline

#19 2021-02-06 22:53:38

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

@loqs. I have been very truthful with everyone here including you about my extreme lack of knowledge. I did not use an unsupported guide, and my most recent post stated it was just something I found on the net today. I'm trying to follow the wiki to the best of my ability but my lack of knowledge is making it extremely difficult. All I know if that Im tired of using distros that do everything for me because linux then becomes windows. Please do not feel that you need to continue to help me. I have appreciated the fact that you tried and like I said I was honest with you about my knowledge level or in my case lack thereof. I wish you well when you are 87 years young. Thank you again for what you have done thus far. I did appreciate it and in my opinion I was very honest with you.
Goodbye

Offline

#20 2021-02-07 06:59:07

bradw
Member
Registered: 2019-03-19
Posts: 11

Re: [Solved]dropped to rescue shell Error device /dev/mapper/cryptroot

I figured it out. Learned how to chroot into system and discovered error in my mkinitcpio.conf file. Took all day but I guess I'm starting to understand. Not bad for an old man.

Offline

Board footer

Powered by FluxBB