You are not logged in.

#26 2014-04-04 08:45:22

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

Okay, I succeeded to mount the lv this way, without "MyStorage":

mount /dev/mapper/main-syst /mnt/syst

Then, after have mounted all lvs, I tryed chroot in it:

mount --bind /dev /mnt/syst/dev
cd /mnt/syst
chroot . /bin/bash
chroot: failed to run command /bin/bash: No such file or directory

Which confused me because I can find it in /bin. I try also, with same result : /bin/sh, /bin/zsh, /usr/bin/bash, /usr/bin/sh, /usr/bin/zsh


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#27 2014-04-04 11:21:35

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

I think that you want to mount /dev/mapper/main-syst as follows:

mount /dev/mapper/main-syst /mnt

But mount all the others as:

mkdir /mnt/home
mount /dev/mapper/main-home /mnt/home

Then try:

arch-chroot /mnt /bin/bash

Last edited by clfarron4 (2014-04-04 11:21:47)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#28 2014-04-04 11:39:17

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

umount -l /mnt/syst
mount /dev/mapper/main-syst /mnt
mount --bind /dev /mnt/dev
arch-chroot /mnt /bin/bash
mount: udev is already mounted or /mnt/dev busy
==> ERROR: failed to setup API filesystems in chroot /mnt

Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#29 2014-04-04 11:56:17

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

I only said to mount the Logical Volumes! Don't mount --bind anything, because you don't need to.

I repeat, only mount the logical volumes, as I said in my previous reply, then arch-chroot.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#30 2014-04-04 12:16:10

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

Oups ! I had the use of chroot = mount --bin the /dev. So I did this step each time.
I started from zero then, it works.
Now, I can focus on /etc/mkinitcpio.conf
You said "encrypt" before "lvm2".
Does this line correct ?

HOOKS="base udev autodetect modconf block filesystems keyboard fsck encrypt lvm2"

Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#31 2014-04-04 12:23:13

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

I believe the Wiki for LVM on LUKS advises something like this:

HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck"

Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#32 2014-04-04 12:47:22

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

I lost myself with many howtos open...
Ok. I edited mkinitcpio.conf, then I launched mkinitcpio -p linux, but I didn't manage /boot.

mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
     -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
     -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'

Edit: in chroot, I mounted sda1 on /boot and launched again the procedure. It worked. Reboot...
The system asked me the luks password, ok, but dropped me again to the recovery shell.
It says now:

Error: Root device mounted successfully, but /sbin/init does not exist.
Bainling out, you are on your own. Good luck.

sh: can't access tty; job control turned off

Last edited by OlaffTheGreat (2014-04-04 13:03:11)


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#33 2014-04-04 15:18:29

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

Suggested here, I checked and confirmed systemd-sysvcompat is installed. Also, I confirmed /sbin/init has a symlinc pointing to /usr/lib/systemd/systemd.


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#34 2014-04-04 16:34:34

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

OlaffTheGreat wrote:

main-syst
main-usr
main-var
main-home
main-srv
main-opt
main-swap
main-olaff

So I just looked at this again...

Because you have a separate /usr (located at /dev/mapper/main-usr), you need to chroot in again (yup, I said chroot in again), and ( according to this) you need to add the usr and shutdown hooks at the very least:

HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck usr shutdown"

Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#35 2014-04-04 17:04:26

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

I'm happy to have found the solution from this link.
As waldowoc suggests in the june 11th, 2013 comment, I did what you suggest too: add usr and shutdown hooks because of /usr is separated.
I also, as it is said in the same post, add "init=/usr/lib/systemd/systemd" in the GRUB_CMDLINE_LINUX_DEFAULT line, in /etc/default/grub.
So finaly, I succeeded (just now) to boot back again! Yippi! => Solved

Anyway, I thank you very much to have helped me until the end, and cool to see we arrived to the same point eventualy.
Now, I'm going to write a summary of what happened here, if it can help. You are welcome to add any comment (or correct what I say !)


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#36 2014-04-04 17:30:59

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

OlaffTheGreat wrote:

Anyway, I thank you very much to have helped me until the end, and cool to see we arrived to the same point eventualy.
Now, I'm going to write a summary of what happened here, if it can help. You are welcome to add any comment (or correct what I say !)

No worries about it, I've learnt from it as well.

The main point I've released with LVM and LUKS setups is that when you're in the LiveCD, if lsblk returns all partitions (no LVs), chances are you're using LVM on LUKS.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#37 2014-04-04 17:43:43

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

That's the point I want to clarify.
How else I can determine my configuration ?
Since the /boot is separated, according to the wiki, I'd suppose to have LUKS on LVM.

You tell, if lsblk returns all partitions, I'd have the opposite: LVM on LUKS.

The guy who made me the config didn't follow the wiki. e.g. I was surprise to see he didn't edit the /etc/cryptab, as it is suggested in the wiki. But it worked anyway...


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#38 2014-04-04 18:36:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

OlaffTheGreat wrote:

The guy who made me the config didn't follow the wiki. e.g. I was surprise to see he didn't edit the /etc/cryptab, as it is suggested in the wiki. But it worked anyway...


So you didn't install the system yourself? That explains a lot...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#39 2014-04-04 18:59:43

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

Well, I it installed myself, but guided by someone.
The aim was to learn, and I do.
Even if I am still in the fog, I already learnt a lot.
But I do find some weird stuff here and there!


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#40 2014-04-04 19:03:54

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

OlaffTheGreat wrote:

Since the /boot is separated, according to the wiki, I'd suppose to have LUKS on LVM.

Nope, you can have a separate /boot with either LUKS on LVM or LVM on LUKS. You can even do it with non-encrypted installations.

Just for clarification here:
When we say LVM on (top of) LUKS, I mean that you have a LUKS partition that has to be unlocked to get at the LVM.
When we say LUKS on (top of) LVM, I mean that you have LVM, where you set-up LUKS-encrypted partitions in the Logical Volumes.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#41 2014-04-04 19:06:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [solved] last kernel upgrade - dropped to recovery shell

OlaffTheGreat wrote:

Well, I it installed myself, but guided by someone.
The aim was to learn, and I do.
Even if I am still in the fog, I already learnt a lot.
But I do find some weird stuff here and there!

Then perhaps, in future threads, you would state at the start that you didn't install it yourself, as a courtesy to those trying to help. Seeing a LVM/LUKS issue, most of us would assume that you had at least some familiarity with the underlying concepts. As it turned out, you do not. You are fortunate indeed that clfarron4 is so patient and was willing to persevere with you.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#42 2014-04-04 20:16:04

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

I'm sorry if it confused some people, and much if I made loose some time. Perhaps indeed, I should have been clearer on the point I had help to install arch, with luks, lvm on ssd.
However, beeing not totaly familiar with all concepts are one of the reason why I posted on the "Newbie corner".
As I expressed in the Official Hello thread, I don't have the high techie skills. What I expose in this topic demonstrates my level.
I am fortunate indeed clfarron4 is patient to help me, and I thank him again.
Since the installation of Arch, I already learnt a lot by myself as well with the help of some good wills in forums...
But please, do not believe I did not any research on those topics. That's one reason why I don't post a lot because I try to solve problems by myself, by reading docs, wiki and man pages.
Anyway, once again, I thank everybody for their help, and I'll give a summary of the problem with the procedure I followed to fix it.


Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

#43 2014-04-04 21:51:23

OlaffTheGreat
Member
Registered: 2013-06-03
Posts: 107

Re: [solved] last kernel upgrade - dropped to recovery shell

I summarize here the problem I had and how we solved it, thanks to clfarron4.

Context:
The problem appeared after upgrade the kernel up to 3.13.8-1-ARCH.

The system is an encrypted volume on lvm on /dev/sda2,
with a separated /boot part on /dev/sda1.

On reboot the system dropped on the recovery shell with this message:

ERROR : device UUID=322d1dd7-5902-45e8-afe4-b5f912967b28 not found. Skipping fsck
ERROR : unable to find root device UUID=322d1dd7-5902-45e8-afe4-b5f912967b28
you are beeing dropped to a recovery shell
type 'exit' to try and continue booting
can't access tty, job control turned off

Preparation:
- Boot from Archlinux installer

- Open the luks device:

cryptsetup open --type luks /dev/sda2 MyStorage

- Check logical volumes:

lsblk

which gave me:
    MyStorage, main-syst, main-usr, main-var, main-home, main-srv, main-opt, main-swap, main-olaff

- Create mount points:

cd /mnt && mkdir usr var home srv opt olaff

- Mount the root:
    clfarron4 indicates to mount it on /mnt

mount /dev/mapper/main-syst /mnt

- Mount other volumes, e.g.:

mount /dev/mapper/main-usr /mnt/usr

- Chroot the system:

arch-chroot /mnt /bin/bash

- Mount /boot:

mount /dev/sda1 /boot

Actions:
- Edit mkinitcpio.conf to had hooks.

vim /etc/mkinitcpio.conf

Edit the HOOKS line like so (line 53 for me):

HOOKS="base udev autodetect modconf block encrypt lvm2 shutdown usr filesystems keyboard fsck"

- Regenerate initramfs:

mkinitramfs -p linux

- Edit /etc/default/grub
  At the line GRUB_CMDLINE_LINUX_DEFAULT, add "init=/usr/lib/systemd/systemd"
Which looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet cryptdevice=/dev/sda2:root cryptkey=/dev/disk/by-uuid/7ea4a77e-b639-4862-9503-4d8d612aaa7a:ext2:/key init=/usr/lib/systemd/systemd allow-discards root_trim=yes"

- And update grub:

grub-mkconfig
grub-update

Lenovo Thinkpad x230 i5-3320M 2.6GHz 250GB SSD (M4) 16GB
SSD | SeaBIOS | GPT | BTRFS | OpenRC | Xfce4 | Zsh | Tmux | Spacemacs
* "Aware Newbie" *
Ibus IM for language script support (e.g. 日本語 - 中文)

Offline

Board footer

Powered by FluxBB