Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

When run manually, GRUB2 leaves me in BusyBox

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Ellen1910
Posts: 63
Joined: 2006-09-30 13:49

When run manually, GRUB2 leaves me in BusyBox

#1 Post by Ellen1910 »

Linux ellen 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux

Here's where GRUB2 leaves me when run manually (set root=(hd0,msdos6); linux; initrd; boot) which is my primary linux installation:

Code: Select all

mount: can't find /root in /etc/fstab
Target filesystem doesn't have requested /sbin/init
Begin: Running /scripts/local-bottom .  .  .  done
Begin: Running /scripts/init-bottom .  .  . mount: mounting /dev on /root/dev failed
: No such file or directory
done
No init found. Try passing init=bootarg.

BusyBox
/bin/sh: can't access tty; job control turned off
[Note. there are, then, a few modprobes for usb related modules which I'm not including; no usb device is plugged in]

Here's the only script in /init-bottom GRUB presumably runs and complains about:

Code: Select all

#!/bin/sh -e

PREREQS=""

prereqs() { echo "$PREREQS"; }

case "$1" in
    prereqs)
    prereqs
    exit 0
    ;;
esac

# Stop udevd, we'll miss a few events while we run init, but we catch up
udevadm control --exit

# move the /dev tmpfs to the rootfs
mount -n -o move /dev ${rootmnt}/dev

# create a temporary symlink to the final /dev for other initramfs scripts
nuke /dev
ln -s ${rootmnt}/dev /dev
This isn't a real problem for me. Normal booting is fine (I use grub, not lilo). More a curiosity though I'd like to understand what the problem is and correct it.

Can anyone tell me what GRUB's hangup is?

Puzzles: Why does GRUB think /etc/fstab should contain "/root" -- it contains "/". If it's looking for udev files, it should be looking in /etc/init, not in /sbin/init.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: When run manually, GRUB2 leaves me in BusyBox

#2 Post by Head_on_a_Stick »

The error messages seem to suggest that you have not told the kernel where the root filesystem is.

I don't use the GRUB command line so I may be missing something but for a menu entry I would add a root=/dev/whatever parameter after the linux location.

EDIT: my current grub.cfg:

https://raw.githubusercontent.com/Head- ... r/grub.cfg
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: When run manually, GRUB2 leaves me in BusyBox

#3 Post by debiman »

how do you run grub manually?
to my knowledge, it always runs automatically during early boot.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: When run manually, GRUB2 leaves me in BusyBox

#4 Post by Head_on_a_Stick »

debiman wrote:how do you run grub manually?
GRUB menu screen wrote:Press c for a command line
;)
deadbang

Ellen1910
Posts: 63
Joined: 2006-09-30 13:49

Re: When run manually, GRUB2 leaves me in BusyBox

#5 Post by Ellen1910 »

Here's an idea. GRUB reports it ran "scripts/local-bottom" without complaint. "Begin: Running /scripts/local-bottom . . . done" Here are the possibilities for where GRUB is looking.

Code: Select all

ellen@ellen:~$ locate local-bottom
/etc/initramfs-tools/scripts/local-bottom
/usr/share/initramfs-tools/scripts/local-bottom
/usr/share/initramfs-tools/scripts/local-bottom/ntfs_3g
If GRUB runs the only available script, this is it.

Code: Select all

#!/bin/sh

set -e

case "${1}" in
	prereqs)
		exit 0
		;;
esac

if [ "${ROOTFSTYPE}" = ntfs ] || [ "${ROOTFSTYPE}" = ntfs-3g ] || \
   [ "${LOOPFSTYPE}" = ntfs ] || [ "${LOOPFSTYPE}" = ntfs-3g ]
then
	mkdir -p /run/sendsigs.omit.d
	pidof mount.ntfs >> /run/sendsigs.omit.d/ntfs-3g
	pidof mount.ntfs-3g >> /run/sendsigs.omit.d/ntfs-3g
fi

exit 0
I don't know what that all means, but the file system on the partition I'm booting (hd0,msdos6) is ext4. The file system on (hd0, msdos1) is ntfs. GRUB should never, if it does, get anywhere near that script. Yes?

BTW here are my keyboard entries:

grub>set root=(hd0,msdos6)
grub>linux /boot/vmlinuz-3.16.0-4-amd64
grub>initrd /boot/initrd.img-3.16.0-4-amd64
grub>boot

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: When run manually, GRUB2 leaves me in BusyBox

#6 Post by p.H »

GRUB just loads the kernel and initramfs, and hands over the boot process to them. Job done.
GRUB does not leaves you in busybox.
GRUB does not run scripts.
GRUB does not complain about anything.
GRUB does not care about /etc/fstab.
The initramfs init script does, because you did not specify a root= parameter in the linux command line.
Look at /boot/grub/grub.cfg for what is expected.

Ellen1910
Posts: 63
Joined: 2006-09-30 13:49

Re: When run manually, GRUB2 leaves me in BusyBox

#7 Post by Ellen1910 »

Okay. Adding "root=/dev/hdd6" to the linux line gets me to the login screen. Success.

And I guess it makes sense that the operating system doesn't understand GRUB's idiomatic terminology and needs to be instructed in its own language.

Are you saying the OS started its part of the boot process with no idea where it was going? Did it guess that it was on the first partition? That can't be. It was running linux scripts and must have gotten them from (hd0,6) so it knew something.

Very confusing.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: When run manually, GRUB2 leaves me in BusyBox

#8 Post by p.H »

Those messages are from the initramfs, which was loaded by GRUB's initrd command.
The initramfs contains an initial root filesystem loaded in memory. Its purpose is to mount the final root filesytem and hand over the boot process to its /sbin/init process.
Debian's initramfs uses the kernel command line root= parameter to identify the root filesystem. Other distributions may differ.

Post Reply