Help - Search - Members - Calendar
Full Version: faster bootups?
Neowin Forums > *nix Customization & Support > Customizing your *nix Desktop
blizzardtweaker
i'm not sure if this is possible, but i'm sure everyone noticed the slow bootup time of linux, even without hotplug. i just came up with a theory that might beable to significantly decrease bootup time. I noticed during bootup, linux runs one command at a time (even with bootsplash or initrd), however in x server, u can run multiple 'konsoles' and terminals, doing many differnt times at one time. So, if i'm not mistaken, bootsplash requires a small startup ram disk, and 'runs' x, so why not include a 'terminal' in that ram disk and when running bootsplash, run multiple terminals in the background, each performing only a portion of the booting all at the same time?
what do ya'll think? possible?
markjensen
IBM has written something up on this before.
http://www-106.ibm.com/developerworks/linu...nxw09BootFaster

Also remember that Linux fully detects your hardware at boot, where Windows takes shortcuts and makes assumptions that it is running on the same basic chipset archetecture as it was when it was installed. It won't boot if you move the hard drive from one PC to another with a very different motherboard. This is one speedup to avoid.

Plus, I don't find that Linux boots up that slowly. It seems pretty fast on my box. My wife may get her XP login prompt faster (she is running a faster CPU than I have), but stuff is still loading and her system is pathetically slow when she logs in immediately. It takes a bit longer for her to have her system running at 'normal' speeds.

It would be nice to see improvements made all the time to Linux, even in the infrequent boot-ups. And, using a parallel startup of whatever apps/services that you can would be a good thing, I think.
LordHatrus
Yeah, the linux bootup is much less "parallel" than windows', for portabliity/compatiblity reasons.
But if you need a fast bootup, why not try hibernating to hard disk, or going to a standby mode, and leaving linux in the RAM?
ichi
There're some tricks to speed up the boot process. These ones are based on a Gentoo linux distro installation, but should work for other distros as well (maybe with slight changes):

1) run modules-update only if necesary
Edit /etc/init.d/modules and look for this:
CODE

ebegin "Calculating module dependencies"
               /sbin/modules-update &>/dev/null
               eend $? "Failed to calculate dependencies"

put this instead:
CODE

if [ /etc/modules.d -nt /etc/modules.conf ]
   then
       ebegin "Calculating module dependencies"
       /sbin/modules-update &>/dev/null
       eend $? "Failed to calculate dependencies"
   else
       einfo "Module dependencies are up-to-date"
fi


2) Parallel mounting of locals
Edit /etc/init.d/localmount and look for this line:
CODE

mount -at nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null

put this line instead:
CODE

mount -aFt nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null


3) Run env-update only if necesary
Edit /etc/init.d/bootmisc and look for this piece of code:
CODE

if [ -x /sbin/env-update.sh ]
then
   ebegin "Updating environment"
   /sbin/env-update.sh >/dev/null
   eend 0
fi

put this instead:
CODE


if [ -x /sbin/env-update.sh ]
then
   if [ /etc/env.d -nt /etc/profile.env ]
   then
       ebegin "Updating environment"
       /sbin/env-update.sh >/dev/null
       eend 0
   else
       einfo "Environment up-to-date"
   fi
fi


4) Start services in parallel
Edit /etc/conf.d/rc and replace this:
CODE

RC_PARALLEL_STARTUP="no"

with this:
CODE

RC_PARALLEL_STARTUP="yes"


Other usefull tricks to improve performance:
-Use hdparm to check that you're actually taking advance of your HD capabilities.
-Use swsusp2 to suspend your computer instead of halting (if you feel like doing so).
-Use the Native POSIX Thread Library instead of the standard LinuxThreads, as the former can be 4x faster than the latter when it comes to creating new threads.


I've applied the 4 points above, and it takes now less than 1 minute to reboot (X session -> reboot -> X session).
hornett
^^ I use those settings on my Gentoo install, and boot up is very fast indeed (also see bug 69584).

QUOTE
Also remember that Linux fully detects your hardware at boot, where Windows takes shortcuts and makes assumptions that it is running on the same basic chipset archetecture as it was when it was installed. It won't boot if you move the hard drive from one PC to another with a very different motherboard. This is one speedup to avoid.


Sorry Mark, would you mind explaining what you mean for me? blush.gif Do you mean the kudzu tool the RedHat/Fedora uses? Or perhaps the startup of the kernel itself?

AFAIK my system just loads the modules I told it to when I set it up (and I only included those for my chipset anyway) biggrin.gif
markjensen
QUOTE(hornett @ Jan 6 2005, 15:14)
Sorry Mark, would you mind explaining what you mean for me?  blush.gif Do you mean the kudzu tool the RedHat/Fedora uses? Or perhaps the startup of the kernel itself?

AFAIK my system just loads the modules I told it to when I set it up (and I only included those for my chipset anyway) biggrin.gif [right][snapback]585244504[/snapback][/right]
As I have primary experience with Red Hat, I can't vouch for a streamlined Gentoo.

But, what I mean is the basic kernel boot. You should be able to to take your Linux hard drive built on an Intel Pentium, and move the drive to an AMD Athlon system (still ix86 family, but very different chipsets on the motherboard) and it will boot. Windows will not.
ichi
QUOTE(markjensen @ Jan 6 2005, 23:51)
As I have primary experience with Red Hat, I can't vouch for a streamlined Gentoo.

But, what I mean is the basic kernel boot.  You should be able to to take your Linux hard drive built on an Intel Pentium, and move the drive to an AMD Athlon system (still ix86 family, but very different chipsets on the motherboard) and it will boot.  Windows will not.


I'm not sure, but I don't think that would work if you strip the generic i386 support from the kernel and optimize it for your hardware huh.gif
Anyway with the kernels bundled with most distros then yeah, it would boot for sure on another machine.
Knight'
QUOTE(markjensen @ Jan 6 2005, 23:51)
As I have primary experience with Red Hat, I can't vouch for a streamlined Gentoo.

But, what I mean is the basic kernel boot.  You should be able to to take your Linux hard drive built on an Intel Pentium, and move the drive to an AMD Athlon system (still ix86 family, but very different chipsets on the motherboard) and it will boot.  Windows will not.
[right][snapback]585245611[/snapback][/right]


I think the reason why Redhat detects your hardware is because the kernel will have support for all the hardware it can, making it very big, whereas in Gentoo we generally build our own to be as small and efficient as possable. And as ichi said, the kernel will be built to run on generic processors, i386 and up, at the expense of all the optimisations a Pentium-4 or Althlon64 kernel would offer.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.