Speeding up boot process

  • Follow


Hello, i wanted to spped up my boot (it takes 40 seconds to get to the
console login), what can i do other than removing useless init scripts?
Does using modules instead of compiling everything with the kernel help?
0
Reply erixal1 (32) 5/13/2005 11:19:53 PM

On Fri, 13 May 2005 23:19:53 GMT, Erix staggered into the Black Sun and
said:
> I wanted to spped up my boot

Spped is subsittute fo acuracy?

> (it takes 40 seconds to get to the console login). What can i do other
> than removing useless init scripts?

Tell us which version of which distro you're using, so we can offer you
concrete advice instead of generalities.  Disable kudzu if you have a
distro that uses that.  Start init scripts in parallel instead of
sequentially if possible--you can do this on Gentoo, but it may be
difficult on Redhat-derived things.  Make sure the network is set up
properly if you're starting things like sendmail or sshd.  Provide the
RAM, CPU, and disk-where-/-is specs, since a P150 with 48M and a 3000
RPM disk will boot more slowly than an Athlon XP 2500 with 1G and a
7200 RPM disk no matter what you do.

If you have a SCSI card, say so.  Some SCSI BIOSes take 15-30 seconds to
get their act together.  Since those things run before the bootloader
gets control, there's nothing you can do about it except poke around the
menus of the SCSI BIOS itself.

> Does using modules instead of compiling everything with the kernel
> help?

No.  It could actually make things slower, since depmod -a is run during
sysinit on many distros.  You should usually use modules, though,
because some useful things like PPP compression, PCMCIA-cs, and the evil
binary-only 3D modules for various graphics cards *can't* be compiled
into the kernel.

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /                Hire me! 
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
0
Reply danSPANceswitTRAPhcrows (1928) 5/13/2005 11:48:59 PM


Dances With Crows wrote:
> Start init scripts in parallel instead of
> sequentially if possible--you can do this on Gentoo

yeah i'm uing gentoo how do you start init script in parallel?
0
Reply erixal1 (32) 5/13/2005 11:59:26 PM

Erix wrote:
> Hello, i wanted to spped up my boot (it takes 40 seconds to get to the
> console login), what can i do other than removing useless init scripts?
> Does using modules instead of compiling everything with the kernel help?

The BIOS on my motherboard has an option for this, called Quick Boot Mode.
"If enabled, this feature will speed up the POST (Power On Self Test)
routine after the computer is turned on. The settings are _Enabled_ and
Disabled. If Disabled, the POST routine will run at normal speed. I normally
reboot only when I decide to run a new kernel (which I get every month or
two, when the power fails longer than the 45 to 90 minutes my UPS will hold
the machine up (happened once in about a year), or if I need to open the box
to fiddle with things (which is very rare). Since I reboot so seldom, I
disabled the Quick Boot Mode and let it run a (slightly) more thorough test.

I suppose removing useless init scripts would help slightly, but it might be
immeasurable. You can have all the scripts you want in /etc/rc.d/init.d
(that's where they are in Red Hat, anyway), but they do not matter at all.
What might matter is the links in /etc/rc.d/rc-123456].d , but even there I
doubt that would matter much, since links to useless scripts in .../init.d
should not be there. In any case, if you decide to do this, just remove the
links in case you regret your action.

The biggest delays I get are setting up my two scsi controllers, and I
really think that should be allowed. Since I have 4 SCSI drives on one, I
have it set up to start one at a time so as not to annoy the power supply,
and it waits until one drive is up to speed before starting the next. This
can take a while for 10,000rpm drives.

I also have two IDE controllers and it rummages around there looking for
devices, too. I cannot remember for sure, but my two NIC interfaces may need
to be programmed as well when the BIOS runs.

-- 
  .~.  Jean-David Beyer          Registered Linux User 85642.
  /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
 /( )\ Shrewsbury, New Jersey    http://counter.li.org
 ^^-^^ 20:15:00 up 19 days, 13:53, 4 users, load average: 4.26, 4.25, 4.12
0
Reply jdbeyer (1220) 5/14/2005 12:28:33 AM

On Fri, 13 May 2005 23:59:26 GMT, Erix staggered into the Black Sun and
said:
> Dances With Crows wrote:
>> Start init scripts in parallel instead of sequentially if
>> possible--you can do this on Gentoo
> Yeah, I'm uing gentoo. How do you start init scripts in parallel?

/etc/conf.d/rc , read the comments.  There are other things you can do
with rc-update ; use that to remove the things you don't need from the
default runlevel.  Actually, if you went through the Gentoo docs on
install, you should have only added the things you wanted to the default
runlevel anyway.

If you're running a 2.6 kernel, it might try to probe for IDE devices
that don't exist.  Appending "hdN=noprobe" to your /boot/grub/menu.lst
command line for your kernel image for all of N that don't have devices
connected may speed things up.  There are almost certainly some
things in rc itself or the boot or sysinit runlevels that can be
modified as well.  I don't care much about boot speed though; I reboot
my machines about every 3 months (power failures, needing 'Doze for some
reason on my laptop, etcetera.)

What about the machine specs I asked for?  

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /                Hire me! 
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
0
Reply danSPANceswitTRAPhcrows (1928) 5/14/2005 1:22:33 AM

(Erix <erixal@n0sp4m.gmail.com>) scribbled:

> yeah i'm uing gentoo how do you start init script in parallel?

.... so, are ya using a binary install? mine boots
in about 15-20 seconds, stock ... stage1 install.

-- 
<<  http://michaeljtobler.homelinux.com (Garbage - Temptation Waits)  >>
Health nuts are going to feel stupid someday, lying in hospitals dying
of nothing. - Redd Foxx
0
Reply mjtobler2 (1042) 5/14/2005 3:41:23 AM

mjt wrote:

> (Erix <erixal@n0sp4m.gmail.com>) scribbled:
> 
>> yeah i'm uing gentoo how do you start init script in parallel?
> 
> ... so, are ya using a binary install? mine boots
> in about 15-20 seconds, stock ... stage1 install.
> 

mine used to boot in 15-20 seconds after install (stage1) but since i added
some services (cupsd, lm-sensors, dhcpd, ntpd, etc) it's getting more. It
doesn't lag on any single service though.
0
Reply erixal1 (32) 5/14/2005 8:59:50 AM

Dances With Crows wrote:
>> Yeah, I'm uing gentoo. How do you start init scripts in parallel?
> 
> /etc/conf.d/rc , read the comments.

thanks

> There are other things you can do 
> with rc-update ; use that to remove the things you don't need from the
> default runlevel.  Actually, if you went through the Gentoo docs on
> install, you should have only added the things you wanted to the default
> runlevel anyway.

In fact i did.
> 
> What about the machine specs I asked for?
> 

Pentium IV 3.0 GHz HT, 1 gigabyte of DDR400 RAM, 4 Maxtor hard disks, which
i suppose to be 7200 RPM, two ide and two sata.
0
Reply erixal1 (32) 5/14/2005 9:06:18 AM

(Erix <erixal@n0sp4m.gmail.com>) scribbled:

> > ... so, are ya using a binary install? mine boots
> > in about 15-20 seconds, stock ... stage1 install.
> > 
> 
> mine used to boot in 15-20 seconds after install (stage1) but since i added
> some services (cupsd, lm-sensors, dhcpd, ntpd, etc) it's getting more. It
> doesn't lag on any single service though.

http://forums.gentoo.org/

use "speeding boot" (not quoted) for the search string - some
great articles returned:

http://forums.gentoo.org/viewtopic-t-331844-highlight-speeding+boot.html
http://forums.gentoo.org/viewtopic-t-286621-highlight-speeding+boot.html
http://forums.gentoo.org/viewtopic-t-239365-highlight-speeding+boot.html
http://forums.gentoo.org/viewtopic-t-190446-highlight-speeding+boot.html

:) http://forums.gentoo.org/viewtopic-t-309752-highlight-speeding+boot.html

-- 
<<  http://michaeljtobler.homelinux.com (Garbage - Temptation Waits)  >>
"I went into a general store, and they wouldn't sell me anything
specific". - Steven Wright 
0
Reply mjtobler2 (1042) 5/14/2005 3:15:36 PM

Erix <erixal@n0sp4m.gmail.com> wrote:
>mjt wrote:
>
>> (Erix <erixal@n0sp4m.gmail.com>) scribbled:
>>
>>> yeah i'm uing gentoo how do you start init script in parallel?
>>
>> ... so, are ya using a binary install? mine boots
>> in about 15-20 seconds, stock ... stage1 install.
>>
>
>mine used to boot in 15-20 seconds after install (stage1) but since i added
>some services (cupsd, lm-sensors, dhcpd, ntpd, etc) it's getting more. It
>doesn't lag on any single service though.

Edit the rc files which start those services, and change them
all to run asynchronously.  You don't need to wait for cups,
lm_sensors and ntpd to be running before logging in.  With dhcpd
it depends...  but for console logins it can still be churning
away too.

For example, if you have something like this:

   if [ -x /etc/rc.d/rc.cupsd ] ; then
     /etc/rc.d/rc.cupsd start
   fi

Change that to

   if [ -x /etc/rc.d/rc.cupsd ] ; then
     /etc/rc.d/rc.cupsd start &
   fi

Once you've tried it and found that it does work, you'll have
the messages from however many of commands you change all
showing up in random order...  which you probably don't want.
So either send the output to /dev/null or put it into a log
file.

   if [ -x /etc/rc.d/rc.cupsd ] ; then
     /etc/rc.d/rc.cupsd start  >> /var/log/boot.log 2>&1 &
   fi


Since you probably are not comfortable with editing rc files
yet...  do them one or two at a time, and reboot to see what the
effects of your editing are.  If you make a mistake and it fails
to give you a login prompt, invoke the boot sequence to get a
single user login.  With the lilo boot loader, as an example, if
your kernel is labled "linux", then type in "linux single" and
hit <RETURN>.  Then back out of the last change you made.

Just be sure to edit only rc files that are run *after* the
system begins the multi-user init sequence!  Not that you can't
recover from a mistake in the initial single user sequence too,
but it gets a bit more complex and you don't want to go there
this week.

-- 
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com
0
Reply floyd (1027) 5/14/2005 4:59:17 PM

Erix wrote:
> Hello, i wanted to spped up my boot (it takes 40 seconds to get to the
> console login), what can i do other than removing useless init scripts?
> Does using modules instead of compiling everything with the kernel help?

If you just want a shell console prompt, it's very simple.

Considering your init is 3, you start your daemons in /etc/rc3.d/:

1) backup everything what is in /etc/rc3.d/
2) remove everything from /etc/rc3.d
3) create one symlink there: /etc/rc3.d/S99local, which would point for 
example to /etc/rc.d/rc.local
4) in /etc/rc.d/rc.local, do:

#!/bin/bash
/etc/rc.d/rc.other &

5) in /etc/rc.d/rc.other, put all daemons which you originally started 
in /etc/rc3.d/


This way you will get a really fast console access, and the daemons will 
load in the background.


-- 
Tomek

0
Reply tch1 (11) 5/14/2005 6:14:56 PM

Floyd L. Davidson wrote:
> Just be sure to edit only rc files that are run *after* the
> system begins the multi-user init sequence!  Not that you can't
> recover from a mistake in the initial single user sequence too,
> but it gets a bit more complex and you don't want to go there
> this week.
> 

Thanks for the help!
(however with the installation cd i can boot and eventually restore
everything, so there's no need to be so careful ;) )

Thanks everybody for the help
0
Reply erixal1 (32) 5/14/2005 6:16:44 PM

In comp.os.linux.misc mjt <mjtobler@removethis_mail.ru>:
> (Erix <erixal@n0sp4m.gmail.com>) scribbled:

>> yeah i'm uing gentoo how do you start init script in parallel?

> ... so, are ya using a binary install? mine boots
> in about 15-20 seconds, stock ... stage1 install.

Not that bad, need 5-8 seconds including tftping kernel + initrd
until you get a graphical login from power on. OK, this is a thin
client (LTSP 4.x) net-booting kernel 2.6, still amazed how fast it
comes up compared to older LTSP versions on the same tc, you
can't read much on the screen, just to fast flying by.;)

Still some work concerning hotplug some USB storage to the thin
client. Mounting the device somewhere to users homedir works fine
already through sshfs.;)

-- 
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 244: Your cat tried to eat the mouse.
0
Reply USENET22 (5462) 5/14/2005 6:18:08 PM

Erix <erixal@n0sp4m.gmail.com> wrote in news:tCahe.894521$b5.39383314@news3.tin.it:

> Hello, i wanted to spped up my boot (it takes 40 seconds to get to the
> console login), what can i do other than removing useless init scripts?
> Does using modules instead of compiling everything with the kernel help?

Why do you reboot so much?   If it is a dual boot system then that's okay but otherwise Linux is not like 
Windows where the first remedy is to reboot, the second is to reinstall software and the third is to reinstall 
Windows.

-- 

Sincerely,

Tris Orendorff
[Two antennae meet on a roof, fall in love and get married. The ceremony wasn't much, but the reception 
was excellent.]

0
Reply triso (301) 5/14/2005 6:33:13 PM

Tris Orendorff wrote:

> Erix <erixal@n0sp4m.gmail.com> wrote in
> news:tCahe.894521$b5.39383314@news3.tin.it:
> 
>> Hello, i wanted to spped up my boot (it takes 40 seconds to get to the
>> console login), what can i do other than removing useless init scripts?
>> Does using modules instead of compiling everything with the kernel help?
> 
> Why do you reboot so much?   If it is a dual boot system then that's okay

it is :-)

and i have nasty issues with the nvidia video driver so every time a new
version of the kernel comes out i recompile to see if it gets solved
automagically... ;)
0
Reply erixal1 (32) 5/14/2005 10:59:28 PM

Erix <erixal@n0sp4m.gmail.com> wrote in
news:kpvhe.1386138$35.51745327@news4.tin.it: 

> Tris Orendorff wrote:
> 
>> Why do you reboot so much?   If it is a dual boot system then that's
>> okay 
> 
> it is :-)
> 
> and i have nasty issues with the nvidia video driver so every time a
> new version of the kernel comes out i recompile to see if it gets

You have my deeepest sympathies.  I have an old gForce2 so I never need to install a new driver since I 
know that they aren't making changes for that card.  If it works, it works--I haven't changed it in over a year 
now.  It may be slow (25 fps in q3test) but it works.


-- 

Sincerely,

Tris Orendorff
[Two antennae meet on a roof, fall in love and get married. The ceremony wasn't much, but the reception 
was excellent.]

0
Reply triso (301) 5/20/2005 5:54:34 PM

15 Replies
31 Views

(page loaded in 0.19 seconds)


Reply: