Bug 1031015 - dracut shell doesn't start
Summary: dracut shell doesn't start
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-15 13:33 UTC by Jaroslav Škarvada
Modified: 2018-05-29 07:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-02 08:39:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Škarvada 2013-11-15 13:33:01 UTC
Description of problem:
I recently upgraded my machine to f20 and dracut shell doesn't work anymore.

Version-Release number of selected component (if applicable):
dracut-034-19.git20131021.fc20.x86_64

How reproducible:
Always, but only on the affected machine

Steps to Reproduce:
1. dracut --force
2. Boot with rd.break rd.shell

Actual results:
Hang after dracut-pre-pivot: Warning: Break before switch_root

Expected results:
Dracut shell

Additional info:
rpm -qV dracut shows nothing, I didn't black list any modules. I tried the same on other machine and there it works correctly. The affected machine has filesystem on LVM in encrypted partition and I am asked for the password before the break. I am going to retry with rd.debug.

Comment 1 Harald Hoyer 2014-01-22 10:55:55 UTC
Is this still a problem?

Comment 2 Jaroslav Škarvada 2014-02-26 11:12:12 UTC
It still doesn't work for me.

kernel-3.13.3-201.fc20.x86_64
dracut-034-64.git20131205.fc20.1.x86_64

# rpm -qV dracut

# dracut -v --force
Executing: /sbin/dracut -v --force
*** Including module: bash ***
*** Including module: i18n ***
*** Including module: ifcfg ***
*** Including module: drm ***
*** Including module: plymouth ***
*** Including module: crypt ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: kernel-modules ***
*** Including module: lvm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 56-lvm.rules
Skipping udev rule: 60-persistent-storage-lvm.rules
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
*** Including module: systemd ***
*** Including module: usrmount ***
*** Including module: base ***
*** Including module: fs-lib ***
*** Including module: shutdown ***
*** Including modules done ***
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Resolving executable dependencies ***
*** Resolving executable dependencies done***
*** Pre-linking files ***
*** Pre-linking files done ***
*** Hardlinking files ***
*** Hardlinking files done ***
*** Stripping files ***
*** Stripping files done ***
*** Creating image file ***
*** Creating image file done ***

/boot/grub2/grub.cfg:
...
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (3.13.3-201.fc20.x86_64) 20 (Heisenbug)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3512db8f-4023-4f48-9221-604fb07a73ea' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  eb5f3263-8b2c-4f42-ab54-57d3ad78c4d4
	else
	  search --no-floppy --fs-uuid --set=root eb5f3263-8b2c-4f42-ab54-57d3ad78c4d4
	fi
	linux	/vmlinuz-3.13.3-201.fc20.x86_64 root=/dev/mapper/vg_dhcp30156-lv_root ro console=tty0 console=ttyS0,115200 LANG=cs_CZ.UTF-8
	initrd /initramfs-3.13.3-201.fc20.x86_64.img
}
....

# ll /boot/initramfs-3.13.3-201.fc20.x86_64.img
-rw-------. 1 root root 12249725 Feb 26 11:56 /boot/initramfs-3.13.3-201.fc20.x86_64.img

Timestamp match, so it gets regenerated.

# df | grep boot
/dev/sda1                           487652   115479  342477  26% /boot

I am using encrypted LVM which includes the root.

# lsblk 
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                             8:0    0 149,1G  0 disk  
├─sda1                                          8:1    0   500M  0 part  /boot
└─sda2                                          8:2    0 148,6G  0 part  
  └─luks-38babc64-c012-447d-b7ac-69c8877105a5 253:0    0 148,6G  0 crypt 
    ├─vg_dhcp30156-lv_root                    253:1    0    50G  0 lvm   /
    ├─vg_dhcp30156-lv_swap                    253:2    0   3,8G  0 lvm   [SWAP]
    └─vg_dhcp30156-lv_home                    253:3    0  94,7G  0 lvm   /home

When booting with the "rd.break rd.shell" it asks me for the password then continues for a while and then hangs with the dracut-pre-pivot warning:
dracut-pre-pivot [546] Warning: Break before switch_root

But no shell, the system doesn't respond to keyboard, only CTRL + ALT + DEL works to reboot the machine.

Could you provide me information how to debug this?

Comment 3 Harald Hoyer 2014-02-26 13:29:59 UTC
Does it work, if you add "plymouth.enable=0 rd.plymouth=0" ?

Comment 4 Jaroslav Škarvada 2014-02-27 10:32:48 UTC
(In reply to Harald Hoyer from comment #3)
> Does it work, if you add "plymouth.enable=0 rd.plymouth=0" ?

No, it seems to be worse. I tried:
rd.break rd.shell plymouth.enable=0 rd.plymouth=0
this didn't ask me for the LUKS password and I didn't see the "pre-pivot" message.

I have non-quiet boot and grub2 in text mode, i.e. there is the following line in my /etc/default/grub:
GRUB_TERMINAL="console"

I tried to add quiet to the kernel command line, so I tried:
quiet rd.break rd.shell
still no luck.

With:
quiet rd.break rd.shell plymouth.enable=0 rd.plymouth=0
I could only see:
"booting a command list"
and that was all.

I tried to swap rd.break and rd.sheel, but no luck.

Next, I am going to try to switch grub2 to the graphical mode.

Comment 5 Jaroslav Škarvada 2014-03-10 10:05:51 UTC
I figured it out, the following lines in /etc/default.d/grub are causing the problem:

GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"

So I guess the dracut shell is shown on the serial console. I haven't verified it, because the serial line was not connected. I think this is bug in dracut, because kernel, systemd and grub has no problem with this "dual" configuration and if the serial line is disconnected everything is shown on tty0.

Comment 6 Harald Hoyer 2014-04-02 08:39:17 UTC
dracut uses /dev/console . Can't change anything here.

Comment 7 Georg Sauthoff 2018-05-26 07:53:31 UTC
(In reply to Jaroslav Škarvada from comment #5)
[..]
> GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"
>
> So I guess the dracut shell is shown on the serial console. I haven't
> verified it, because the serial line was not connected. I think this is bug
> in dracut, because kernel, systemd and grub has no problem with this "dual"
> configuration and if the serial line is disconnected everything is shown on
> tty0.

I verified this with a connected serial console: with console=ttyS0,115200 put after console=tty0 the dracut shell is only displayed on the serial console.

Note that the order of the commands matters, i.e. with `console=ttyS0,115200 console=tty0` the dracut shell is displayed on the system console - and the serial console only gets a copy the log messages. (this is documented in the kernel docs: the last console= option specifies the console that is connected to /dev/console)

You would need to include something like getty or more of systemd into initramfs to get a dracut shell on both consoles.

Comment 8 Georg Sauthoff 2018-05-29 07:28:16 UTC
So I've created a small Dracut module (dracut-serial) that spawns gettys on both the system and the serial consoles. It also starts the password prompter (systemd-tty-ask-password-agent) on both consoles):

https://github.com/gsauthof/dracut-serial

Thus it helps in situations where one doesn't know a priori which console is available when the system boots and devices needs to be unlocked or the emergency shell is triggered.


Note You need to log in before you can comment on or make changes to this bug.