LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   GRUB slow boot (https://www.linuxquestions.org/questions/slackware-14/grub-slow-boot-854866/)

diwljina 01-07-2011 01:16 PM

GRUB slow boot
 
Hi!

I have Lenovo S10e netbook with 4GB SSD and 160GB SATA disk. SSD had XP preinstalled, so I installed Slack on 15GB partition on SATA disk. Later, I installed Debian on SSD because I don't need Window$ and just wanted more then 4GB for Slack. I'm using Debian's GRUB for booting.

The problem is that it boots very slowly. Time needed for GRUB selection screen to show is taking too long. XP used to boot very fast, but now it is taking forever. I don't mind slow booting on desktop, because I don't turn in off very often, but it is important on mobile device to have a reasonable short boot time.

I tried to install Slack's LILO, but it didn't went OK. Uncomenting compat option removed long waiting period (the one with dots), but nothing else worked. Framebuffer didn't work, only vga = normal

After booting, X could't start in Slackware and Debian didn't work at all, so I reverted back to GRUB.

Executing /sbin/lilo gave me this:
Code:

Warning: LBA32 addressing assumed
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
Warning: The boot sector and map file are on different disks.
Added Slack-2.6.35.7 *
Added Slack-2.6.33.4
Added Debian
2 warnings were issued.

My lilo.conf
Code:

boot = /dev/sdb
compact 
  bitmap = /boot/slack.bmp
  bmp-colors = 255,0,255,0,255,0
  bmp-table = 60,6,1,16
  bmp-timer = 65,27,0,255
prompt
timeout = 50
vga = normal
image = /boot/vmlinuz-2.6.35.7
  root = /dev/sdc1
  label = Slack-2.6.35.7
  read-only  # Partitions should be mounted read-only for checking
image = /boot/vmlinuz-generic-2.6.33.4
  root = /dev/sdc1
  label = Slack-2.6.33.4
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
# Linux bootable partition config begins
image = /mnt/debian/boot/vmlinuz-2.6.26-2-686
  root = /dev/sdb1
  initrd=/mnt/debian/boot/initrd.img-2.6.26-2-686
  append="splash=silent"
  label = Debian
  read-only  # Partitions should be mounted read-only for checking
# Linux bootable partition config ends


One of the problems is that Debian is still using old kernel which maps SSD as /dev/hda, while Slack maps it as /dev/sdb and SATA disk is mapped as /dev/sdc. Another issue is that I had to use USB flash drive during installation (no cdrom on netbook), so installation process mapped USB stick as /dev/sda. It was major PITA during installation, I booted from USB several times until I hit right one in menu.lst.

I guess I could do the same until I hit right marks in lilo, but there would be still that problem with X.

So, is there anything I can do to speed up GRUB? Something like compat in LILO?

silvyus_06 01-07-2011 01:21 PM

then reinstall grub 2 ... with something like the RIPlinux live cd , has there an option to restore grub2 .

and edit your grub.cfg file from /boot and there where it has the setting of waiting time lower it to like 3 seconds , that's what i did , i only have ubuntu on my machine but need that to boot into another kernel if i want.

guanx 01-07-2011 01:25 PM

No experience in GRUB. LILO should work.

The framebuffer and X drivers are not inside the boot loaders. It is ridiculous to blame the boot loader for that.
If you really want to solve problems, please post your grub menu file.

For your hda/sda problem, just use UUID instead of device name.
.

diwljina 01-07-2011 01:50 PM

silvyus, I don't use grub2. It's Debian's grub legacy and Slackware also uses 0.97 version. It's not that wait period. As I sad, it is before grub selection screen. Message before that screen is
"Grub loading stage 1.5
grub loading please wait"
and is taking about 30 seconds.

@guanx
Yes, it is ridiculous, but never the less, framebuffer works with grub and not with lilo. It shouldn't be related, but X in Slack doesn't work when it is booted with lilo and works when it is booted with grub. Nothing else is changed. I don't have any explanation for this, hence this thread. :)

My menu.lst
Code:

default        0
timeout        5
color cyan/blue white/blue

title          Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/hda1 ro quiet
initrd          /boot/initrd.img-2.6.26-2-686

title          Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/hda1 ro single
initrd          /boot/initrd.img-2.6.26-2-686

title          Other operating systems:
root

title          Slackware Linux (Slackware 13.1) (on /dev/sdc1)
root            (hd1,0)
kernel          /boot/vmlinuz-huge-smp-2.6.33.4-smp root=/dev/sdc1
savedefault

title          Slackware 13.1 (2.6.35.7) (on /dev/sdc1)
root            (hd1,0)
kernel          /boot/vmlinuz-2.6.35.7 root=/dev/sdc1 i915.modeset=1
savedefault


diwljina 01-07-2011 01:54 PM

Quote:

Originally Posted by guanx (Post 4216680)
For your hda/sda problem, just use UUID instead of device name.

Thanks for the tip. Just googled a little about it and it's just what I need.

guanx 01-07-2011 02:32 PM

For the Slackware installation, you are using the huge kernel in grub and the generic kernel in lilo. Can you try the huge kernel in lilo?

diwljina 01-07-2011 02:44 PM

Actually, I don't use either. I use custom one, and huge is there in case something goes wrong with compiling. I copied generic by mistake during editing lilo.conf. It should be huge as well. As you can see, it misses initrd.

Edit:
Googling is not helping, but the best guess is that boot hanging has something with boot loader talking with bios. It checks something stupid, and later goes with defaults when it finds nothing. Just how to go straight to that defaults...?

guanx 01-07-2011 03:08 PM

Somewhat confused now ... Does your system not boot at all or boots but cannot run X? In either case, please record the error message.

You can start with the official 2.6.35.7 kernel. If that works, compile yours.
.

diwljina 01-07-2011 04:04 PM

System boots when I use grub. Everything works just fine, except for the long boot time.

When I tried with lilo, X dont work. There is no error message, just
"Starting up X11 session manager..." and it repeats after some time

"Starting up X11 session manager...
Starting up X11 session manager..." and so on.

BTW, I just tried UUID. Debian works with it, grub and fstab, but when I change Slack entry in menu.lst in failed to mount root partition. Tells me to use /dev/sdc1 or /dev/sdc2 or... followed by kernel panic. I thought I turned off something important in my custom kernel, but same goes for huge kernel.

guanx 01-07-2011 04:11 PM

As I asked you to do in my last post, please start with the official 2.6.35.7 kernel. For UUID mount, you need an initrd. Please man mkinitrd.

X may not start if you have an NVIDIA driver, for example, and forgot to recompile it after installing a new kernel.

diwljina 01-07-2011 06:09 PM

I tried with official 2.6.33.4 kernel and I made initrd. I went further this time. UUID is recognized but booting stoped. It asked me if I'm sure it is ext2 fs and then rebooted. Of course it is not. It it ext3, just as loaded module, so I don't know what is the problem this time. Nevermind, UUID is not a big problem as I already installed everything. Boot speed with grub and X with lilo are major issues.

This is netbook, so no nvidia here. Just good open source intel drivers.

T3slider 01-07-2011 07:21 PM

Quote:

Originally Posted by diwljina (Post 4216710)
My menu.lst
Code:

...
title          Slackware 13.1 (2.6.35.7) (on /dev/sdc1)
root            (hd1,0)
kernel          /boot/vmlinuz-2.6.35.7 root=/dev/sdc1 i915.modeset=1
savedefault


In LILO you should add an append line in your Slackware 2.6.35.7 stanza to pass that option to the kernel.
Code:

append=" i915.modeset=1"
That should at least get X working with your LILO setup.

syg00 01-08-2011 12:34 AM

The [hs]d[abc] issue is distro init-scripts/udev - blame Pat and the Debian devs. The BIOS (usually) always uses the same order - regardless of what "programming" makes it's way into the init-scripts.
The slow grub is likely a consequence of all this - what you installed to as hd0 is likely to be anywhere but. I prefer to go into command mode at the grub menu and do everything from there - at least that way you can get some idea of what the BIOS is passing to grub when in the actual boot sequence.
You can use the "geometry" command to get an idea of what order the disks are presented in - if you feel you want to skip a device (to avoid the probe delay), grub accepts a "hdbias"; see the description for the "root" (sub-)command.

guanx 01-08-2011 06:03 AM

Quote:

Originally Posted by diwljina (Post 4216894)
I tried with official 2.6.33.4 kernel and I made initrd. I went further this time. UUID is recognized but booting stoped. It asked me if I'm sure it is ext2 fs and then rebooted. Of course it is not. It it ext3, just as loaded module, so I don't know what is the problem this time. Nevermind, UUID is not a big problem as I already installed everything. Boot speed with grub and X with lilo are major issues.

This is netbook, so no nvidia here. Just good open source intel drivers.

You might want to edit /etc/mkinitrd.conf before running mkinitrd -F, or simply use proper command parameters to specify your root filesystem format. See man mkinitrd.

For the video problem, please refer to T3slider's reply.

diwljina 01-08-2011 06:59 AM

Quote:

Originally Posted by T3slider (Post 4216924)
In LILO you should add an append line in your Slackware 2.6.35.7 stanza to pass that option to the kernel.
Code:

append=" i915.modeset=1"
That should at least get X working with your LILO setup.

OMG, yes! How could I miss that? My custom kernel (2.6.35.7), huge-smp-2.6.33.4-smp and Debian (with UUID) are working now with lilo, but generic Slack with initrd and UUID is not.

I generate initrd with:
Code:

cd /boot
mkinitrd -c -k 2.6.33.4-smp -m ext3 -f ext3 -r /dev/sdc1

as in README.initrd on Slackware disc.

lilo.conf entry for generic Slack kernel:
Code:

image = /boot/vmlinuz-generic-smp-2.6.33.4-smp
 initrd = /boot/initrd.gz
 root="UUID=480f7a86-d229-4809-92aa-e4e3a19a734e"
 append="i915.modeset=1"
 label = Slack-generic
 read-only

Error message:
Code:

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2 filesystem (and not
swap or ufs or something else), then the superblock is corrupt, and you
might try running e2fsck with an alternate superblock:
  ef2csk -b 8193 <device>

An error occurred during the root filesystem check
You will now be given a chance to log into the system in single user mode to
fix the problem

If you are using the ext2 filesystem, running e2fsck -v -y <partition> might
help.

Did I miss anything?


Quote:

Originally Posted by syg00 (Post 4217076)
The [hs]d[abc] issue is distro init-scripts/udev - blame Pat and the Debian devs. The BIOS (usually) always uses the same order - regardless of what "programming" makes it's way into the init-scripts.
The slow grub is likely a consequence of all this - what you installed to as hd0 is likely to be anywhere but. I prefer to go into command mode at the grub menu and do everything from there - at least that way you can get some idea of what the BIOS is passing to grub when in the actual boot sequence.
You can use the "geometry" command to get an idea of what order the disks are presented in - if you feel you want to skip a device (to avoid the probe delay), grub accepts a "hdbias"; see the description for the "root" (sub-)command.

I tried command mode.
Code:

grub> geometry (hd0)
drive 0x80: C/H/S = 976/128/63, The number of sectors = 7880544, LBA
  Partition num: 0, Filesystem type is ext2fs, partition type 0x83

grub> geometry (hd1)
drive 0x81: C/H/S = 1023/255/63, The number of sectors =  312581808, LBA
  Partition num:0, Filesystem type is ext2fs, partition type 0x83
  Partition num:1, Filesystem type is unknown, partition type 0x82
  Partition num:4, Filesystem type is ext2fs, partition type 0x83
  Partition num:5, Filesystem type is ext2fs, partition type 0x83
  Partition num:6, Filesystem type is ext2fs, partition type 0x83

I'm not sure how to use hdbias. Should I use it in menu.lst like this:
Code:

title          Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0) 0
kernel          /boot/vmlinuz-2.6.26-2-686 root=UUID=6bc4c695-0272-4536-8f2f-d48b53dcccc2 ro quiet
initrd          /boot/initrd.img-2.6.26-2-686

It still hangs 30 sec before grub selection screen.


All times are GMT -5. The time now is 07:06 AM.