Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#39370 - [mkinitcpio] Rescue Shell tries to mount non-functional root parameter even after mounting /new_root
Attached to Project:
Arch Linux
Opened by Mateus Rodrigues Costa (CharlesAtum) - Wednesday, 12 March 2014, 19:13 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 13 March 2014, 03:29 GMT
Opened by Mateus Rodrigues Costa (CharlesAtum) - Wednesday, 12 March 2014, 19:13 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 13 March 2014, 03:29 GMT
|
DetailsDescription: Having base and udev on your initramfs try to boot Arch Linux with some of the root command-line parameters listed below.
It will first try to mount the root parameter, after failing it'll drop you to a rescue shell. After mounting your root partition and typing exit, it will try again to mount the root parameter and only by exiting again the rescue shell it'll mount the correct partition and continue boot. Additional info: * package version(s): linux 3.13.6-1, mkinitcpio 16-2 root parameters tested: a. Don't even set root b. Set root to a partition that doesn't exist (e.g. root=/dev/sda8 rw on a disk with only 6 partitions) c. Set root to the partition Unique Identifier without adding "PARTUUID=" or "UUID=" before it d. Set root to something that isn't even a partition (e.g. root=abc rw) Steps to reproduce: 1. Have base and udev on your mkinitcpio 2. Edit your bootloader entry temporarily and boot with a, b or c as your root; (Optional step) If using systemd you can also add emergency to the end of the entry to reboot and try another root parameter without waiting the full boot process 3. It will try to mount the root parameter and, after failing, will drop you to a rescue shell 4. Mount your root partition to /new_root 5. Use exit 6. It will try to mount the root value and you will get a new rescue shell 7. Exit again 8. Boot process will go as normal Also, if you boot with root parameter d, instead of trying to mount whatever you typed it will try to mount /dev/root first and also won't try to mount it again after you mounted the root partition |
This task depends upon
Closed by Dave Reisner (falconindy)
Thursday, 13 March 2014, 03:29 GMT
Reason for closing: Not a bug
Additional comments about closing: Nothing to do here. The early userspace shell is intentionally limited, and made up edge cases will not be coded around.
Thursday, 13 March 2014, 03:29 GMT
Reason for closing: Not a bug
Additional comments about closing: Nothing to do here. The early userspace shell is intentionally limited, and made up edge cases will not be coded around.
Your analysis is incorrect. You land in the rescue shell initially because $root can't be found. No attempt has been made to mount the filesystem.
Because of the way processes work, you have no ability to update the value of "root" in the parent process of the rescue shell (PID 1 at the time). I'm not really sure what you're expecting. This sounds like a pretty clear case of garbage in, garbage out.
Only on situation d, after exiting, it will switch_root to the new_root partition; on all other situations it'll again try to use the $root value and I'll have to exit a second time before it switch_root to the new_root partiton.
Once I accidentally done situation c with systemd on my initram and it didn't had any functional rescue mode to fix it, and I also didn't think about looking at the bootloader at the time.
I also didn't read the entire init file, only the relevant part about switching root to /new_root.
Can you explain me then if using $root again instead of switching root to /new_root is intended behavior, limitation or bug? And also why situation d is different from the others?
Not really sure what you're asking. You can't substitute a device ($root) for a mount point (/new_root) in most scenarios, especially those pertinent to early userspace.
> And also why situation d is different from the others?
'c' and 'd' are identical scenarios. 'b' is special because it's a /dev path which can be waited on to show up (assuming udev is present). 'a' probably has strange behavior because /init expects that root is set.
Also I found another root parameter for testing:
e. Set root to anything that is not a partition and also is not "abc"
Using e you will get what you wrote on $root on the error message. Using d would make the rescue shell show "/dev/root" and also it probably skips one of the tests used on the init file.
Let me try again to explain what happens and what I think is the issue:
Let's say I booted with any of the five options.
IT would load fine until it needs the root partition.
If it was b init would wait 10 seconds for the partiton before the error happens.
For any of them I will get a error saying what it couldn't find/mount
If it was a it will show what it tried to use as ''. If it was d it will show '/dev/root'. If it any other option it will show the $root value.
At this point I get to a rescue shell
Here I mount my btrfs root partition to /new_root using "mount /dev/sda4 /new_root"
Then I use 'exit' and expect the boot process to go as usual
If it was d the boot process will go as usual (possibly this abc option somehow skips one of the tests). If it was anything else you will g
t another error.
This error says it's trying again to use the $root value and then you'll be back to a rescue shell.
I use exit on this rescue shell.
Boot will go as normal for all the other options.
The issue is that second error. I have already given it the right value (/init uses the /new_root mount point when it runs switch_root), why is it not trying to use it instead of trying the same value that didn't work? And why does it leave to only try the mount point I set when, if I otherwise didn't mount it, it would cause kernel panic?