You are not logged in.

#1 2013-08-05 11:24:59

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

[UNSOLVED] Loading grub2 takes forever

After i recently upgraded grub to grub2, when booting the system,
the following message is visible for about 10 seconds:

GRUB loading.
Welcome to GRUB!

_

After that, there is the grub menu and everythings works just fine. It just takes too long load.
Before the upgrade i couldn't even read that message, because the menu was loaded almost instantly.

Last edited by MickeyKnox (2013-08-25 11:36:25)

Offline

#2 2013-08-06 01:52:54

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [UNSOLVED] Loading grub2 takes forever

I do see that message briefly but nothing like 10 seconds.

Are you booting in bios or efi mode? How did you install grub? What is your grub configuration?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-08-08 14:30:19

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

cfr wrote:

Are you booting in bios or efi mode?

In BIOS mode with MBR

cfr wrote:

How did you install grub?

with grub-install

cfr wrote:

What is your grub configuration?

My /boot/grub/grub.cfg looks like this:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
else
  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux-fallback.img
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# (2) Windows 7
menuentry "Windows 7" {
  set root="(hd1,1)"
  chainloader +1
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Offline

#4 2013-08-08 16:32:16

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [UNSOLVED] Loading grub2 takes forever

From your grub.cfg it shows you are not using the latest version. When did you do your last update?

Offline

#5 2013-08-08 21:51:45

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [UNSOLVED] Loading grub2 takes forever

MickeyKnox wrote:
cfr wrote:

How did you install grub?

with grub-install

What command did you issue?

Did you also regenerate grub.cfg?

cfr wrote:

What is your grub configuration?

My /boot/grub/grub.cfg looks like this:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux-fallback.img
}

What henk said. Though I do not think that will make the menu appear faster. I take it that sda1 is Arch and that you do not have a separate /boot partition. Is that correct?

# (2) Windows 7
menuentry "Windows 7" {
  set root="(hd1,1)"
  chainloader +1
}

And sdb1 is for Windows boot?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-08-09 04:08:25

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [UNSOLVED] Loading grub2 takes forever

Overlooked the following completely

# (2) Windows 7
menuentry "Windows 7" {
  set root="(hd1,1)"
  chainloader +1
}

@MickeyKnox, check the boot-order of the HDD'S in the bios. As far as I know Windows will not boot from the second harddisk if not configured properly.
Maybe Grub is searching on the wrong HDD.

Offline

#7 2013-08-09 13:44:18

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

henk wrote:

From your grub.cfg it shows you are not using the latest version. When did you do your last update?

I don't know exactly, maybe one or two month ago.
But i just ran an upgrade and two new issues arose:

1. In the grub loading screen before the menu, i get the following error:

 error: file '/boot/grub/locale/en.gmo' not found

I think i had a similar problem before and i think i solved it by renaming some file.
Apart from presenting me that error everything runs fine though.

2. Powering off the system takes forever now. Before it took like 2-3 seconds, but now
it takes like 30 seconds. After exiting X i'm on tty1, where nothing happens for 20-30
seconds, then there surfaces some text and the system powers off almost immediately.
It looks to me like it waits for something to time out.
I'm not sure if this is related, maybe i should open up another thread for this.

cfr wrote:

What command did you issue?

grub-install --recheck /dev/sda

cfr wrote:

Did you also regenerate grub.cfg?

Yes, with grub-mkconfig -o /boot/grub/grub.cfg

cfr wrote:

I take it that sda1 is Arch and that you do not have a separate /boot partition. Is that correct?
And sdb1 is for Windows boot?

That is correct.

henk wrote:

check the boot-order of the HDD'S in the bios. As far as I know Windows will not boot from the second harddisk if not configured properly.
Maybe Grub is searching on the wrong HDD.

Windows boots just fine. Curiously enough, in the BIOS i can't select sdb as a boot device.
(I have an Asus P5B Mainboard.) And i did some more testing. When i disconnect sdb, everything
stays the same, it doesn't go any faster. (Of course, selecting Windows in the grub menu results in an error.)
When i installed Windows, i disconnected sda so that the Windows installer can't touch it.
That also has the benefit that i can boot Windows without sda and grub.

My /boot/grub/grub.cfg now looks like this:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
else
  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c rw  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c' {
	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  e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	else
	  search --no-floppy --fs-uuid --set=root e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c
	fi
	echo	'Loading Linux core repo kernel ...'
	linux	/boot/vmlinuz-linux root=UUID=e9ef3ee2-1a86-47fa-a8cf-bc860dc58b9c rw  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initramfs-linux-fallback.img
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/40_custom.pacsave ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# (2) Windows 7
menuentry "Windows 7" {
  set root="(hd1,1)"
  chainloader +1
}
### END /etc/grub.d/40_custom.pacsave ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###

Offline

#8 2013-08-09 14:29:01

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [UNSOLVED] Loading grub2 takes forever

A few things I notice:

### END /etc/grub.d/40_custom.pacsave ###

Check your /etc/grub.d folder for .pacsave files. This wiki page will explain how to deal with them.
Edit: checked the wikipage for grub; seems I was wrong about the msdos thingie.
Why Windows as a custom entry?

Last edited by henk (2013-08-09 14:41:09)

Offline

#9 2013-08-14 09:15:17

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

henk wrote:

Check your /etc/grub.d folder for .pacsave files. This wiki page will explain how to deal with them.

I did merge these files. However, this is rather cosmetic because it doesn't really change
anything; in effect it just removes some comments from /boot/grub/grub.cfg.

henk wrote:

Why Windows as a custom entry?

That was the suggested way in the wiki.

I found that somebody else had a similar problem with missing files, i'm not sure though
if that has been solved: https://bbs.archlinux.org/viewtopic.php?id=165821

The second problem about the system taking forever to poweroff just resolved itself. Weird.

The grub loading screen before the menu still appears too long though.

Offline

#10 2013-08-14 15:50:37

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [UNSOLVED] Loading grub2 takes forever

MickeyKnox wrote:

When i installed Windows, i disconnected sda so that the Windows installer can't touch it.
That also has the benefit that i can boot Windows without sda and grub.

This is just a thought, maybe it doesn't matter at all, maybe I'm all wrong.
But with installing Windows in this way didn't you create a MBR on the disk
with Windows on it?  Which would hold the information for booting Windows.
I'm wondering how your windows entry in Grub would look like if you used os-prober
to detect it.

But again, this is just a thought.

Edit: fixed some typos

Last edited by henk (2013-08-14 15:52:08)

Offline

#11 2013-08-14 20:55:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [UNSOLVED] Loading grub2 takes forever


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2013-08-17 11:22:35

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

I really don't think that loading grub takes so long because of my windows installation.
When i disconnect the harddrive with windows on it grub takes the same time to load.

Offline

#13 2013-08-17 17:30:23

henk
Member
From: Weert, Netherlands
Registered: 2013-01-01
Posts: 334

Re: [UNSOLVED] Loading grub2 takes forever

It's not your windows installation that is the problem. The place on the harddisk where the information for booting
your windows installation is stored, could be of importance.
This part of the Grub wiki page does a good job of explaining:

 It is the system partition that has bootmgr, not your "real" Windows partition (usually C:).

Your Grub points to the real windows partition, hd1,1 where in fact it should point to the MBR of hd1. To look at it very simply, Grub searches hd1,1 doesn't find boot
information, searches on, eventually seems to find the MBR on hd1 and is ready.
the same goes when you disconnect hd1. GRUB has an entry to search for, now finds nada and continues.

Offline

#14 2013-08-19 11:37:08

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

Ok. I commented the Windows section in /etc/grub.d/40_custom,
regenerated the config file and reinstalled grub. Apart from not
having a windows entry in the grub menu, everything was the same.
Grub still took as long to load as before.

Offline

#15 2013-08-19 22:45:05

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [UNSOLVED] Loading grub2 takes forever

The missing locale error is supposed to have been fixed (https://bugs.archlinux.org/task/35937) if I'm reading the bug report correctly.

There used to be information on addressing this manually in the wiki, I think, but I can't seem to find anything on either the Beginners' Guide or the GRUB wiki pages. (Maybe because it is meant to have been fixed?)

Basically, you can copy a file from /usr/share/locale/en@quot/LC_MESSAGES/grub.mo  to whatever name and location grub expects. (Are you sure it is .gmo and not .mo?)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#16 2013-08-21 11:13:30

MickeyKnox
Member
Registered: 2010-02-27
Posts: 169

Re: [UNSOLVED] Loading grub2 takes forever

Thanks cfr, the error message went away. And yes, i'm sure it was .gmo.

The grub loading screen still appears way too long though.

Offline

Board footer

Powered by FluxBB