Linked by Tony Steidler-Dennison on Wed 30th Jul 2008 18:54 UTC
Linux "On those infrequent occasions when you need to reboot Linux, you may find that the process takes longer than you'd like. Jack Wallen shares a number of tricks you can use to reduce boot times." While these tips are intended to shorten Linux boot times, some can also increase the security of your system. Speed and security in ten tips, both well-known and obscure.
Order by: Score:

Some mistakes
by WereCatf on Wed 30th Jul 2008 19:38 UTC
WereCatf
Member since:
2006-02-15

#2: Disable unnecessary kernel modules:

Most distros ship with those kernel modules compiled as modules, not built-in, so they don't make booting time any worse or better. The system just checks if it needs a module for some hardware and initializes that module, it doesn't load all of them!

#7: Avoid dhcp:

This one I was wondering what the heck was the author thinking? The answer to dhcp requests arrives in milliseconds (unless there's something terribly wrong with your system) and it allows for much more flexibility.

#6: Use an OpenBIOS:

There's a saying "Don't fix what isn't broken". Especially when it's the bios. If OpenBIOS doesn't work on your motherboard or if the flash procedure goes hayways then you're fscked. I wouldn't have included this in the list, even though it will boost boot-up time _if_ it works.

RE: Some mistakes
by fretinator on Wed 30th Jul 2008 20:01 UTC in reply to "Some mistakes"
fretinator Member since:
2005-07-06

[q#7: Avoid dhcp: This one I was wondering what the heck was the author thinking? The answer to dhcp requests arrives in milliseconds (unless there's something terribly wrong with your system) and it allows for much more flexibility. [/q]

On my systems it takes sometimes a few seconds to get an address, especially wirelessly. If it fails to get an address (for whatever reason), it may take 30 seconds or so before it gives up. Depending on the OS/Distro, if these task are done serially that can be a significant slowdown.

To me, the biggest speed-up is for most of these tasks to be done in parallel - thus our case of a failed dhcp request wouldn't matter.

RE[2]: Some mistakes
by WereCatf on Wed 30th Jul 2008 22:48 UTC in reply to "RE: Some mistakes"
WereCatf Member since:
2006-02-15

On my systems it takes sometimes a few seconds to get an address, especially wirelessly. If it fails to get an address (for whatever reason), it may take 30 seconds or so before it gives up. Depending on the OS/Distro, if these task are done serially that can be a significant slowdown.

To me, the biggest speed-up is for most of these tasks to be done in parallel - thus our case of a failed dhcp request wouldn't matter.


Hmm, well, I haven't tried too many different distros but Mandriva does dhcp in the background and so does Ubuntu (not that I use the latter one..). The whole point is that _if_ it happens to take some time to get a response then the process can just idle in the background, it does not need to be blocking other services from starting up. Especially since it consumes virtually no CPU time.

RE[2]: Some mistakes
by Isolationist on Thu 31st Jul 2008 07:06 UTC in reply to "RE: Some mistakes"
Isolationist Member since:
2006-05-28

[q#7: Avoid dhcp: This one I was wondering what the heck was the author thinking? The answer to dhcp requests arrives in milliseconds (unless there's something terribly wrong with your system) and it allows for much more flexibility.


[q#7: On my systems it takes sometimes a few seconds to get an address, especially wirelessly. If it fails to get an address (for whatever reason), it may take 30 seconds or so before it gives up. Depending on the OS/Distro, if these task are done serially that can be a significant slowdown.

To me, the biggest speed-up is for most of these tasks to be done in parallel - thus our case of a failed dhcp request wouldn't matter.


If you are using something like ifplugd then this isn't an issue

Edited 2008-07-31 07:08 UTC

Recompile?
by MattPie on Wed 30th Jul 2008 19:40 UTC
MattPie
Member since:
2006-04-18

If your desktop is wired to the Ethernet, you don’t need to have a wireless kernel module loaded. This task is a bit more difficult and will require a kernel recompilation, which is not the easiest task to undertake.

When was the last time, if *ever*, that a wireless module was compiled into a kernel? She even says 'module' in the previous sentence!

Not sure about #2
by TaterSalad on Wed 30th Jul 2008 19:41 UTC
TaterSalad
Member since:
2005-07-06

One statement about #2: Disable unnecessary kernel modules got me thinking. I thought the point of modules was that they are only loaded when needed. Am I wrong in thinking that or just misunderstanding how modules work?

Not enitrely practical
by Michael on Wed 30th Jul 2008 19:47 UTC
Michael
Member since:
2005-07-01

#3 Change your desktop

#5 Change your OS

#6 Change your hardware

#10 is the only interesting one and it isn't explained at all.

RE: Not enitrely practical
by davidgurvich on Wed 30th Jul 2008 22:21 UTC in reply to "Not enitrely practical"
davidgurvich Member since:
2005-11-13

#10 is not that interesting and doesn't improve boot speeds by much. In fact, the only interesting one is the most dangerous. The entire article seems pointless, other than the obvious "Don't run services you don't need".

RE: Not enitrely practical
by tyrione on Wed 30th Jul 2008 23:41 UTC in reply to "Not enitrely practical"
tyrione Member since:
2005-11-21

#3 Change your desktop

#5 Change your OS

#6 Change your hardware

#10 is the only interesting one and it isn't explained at all.


From /etc/init.d/rc on Debian SID


# Specify method used to enable concurrent init.d scripts.
# Valid options are 'none', 'shell' and 'startpar'. To enable the
# concurrent boot option, the init.d script order must allow for
# concurrency. This is not the case with the default boot sequence in
# Debian as of 2008-01-20. Before enabling concurrency, one need to
# check the sequence values of all boot scripts, and make sure only
# scripts that can be started in parallel have the same sequence
# number, and that a scripts dependencies have a earlier sequence
# number. See the insserv package for a away to reorder the boot
# automatically to allow this.
CONCURRENCY=none


INNSERV configuration is at /etc/insserv.conf

/usr/share/doc/insserv/README.Debian which explains the whole thing:


To test dependency based reordering of the boot sequence, install the
package, enable parallel booting, and run update-bootsystems-insserv
to make a backup of the boot sequence and reorder the boot scripts.
Be careful to verify the boot sequence before rebooting, as an
incorrect boot sequence can render the system completely unbootable.

In short:

# Enable parallel booting
echo CONCURRENCY=shell >> /etc/default/rcS

# Update boot sequence
update-bootsystem-insserv

# At this point, I recommend examining the order in /etc/rcS.d/ and
# /etc/rc2.d/ carefully, to verify that the configuration actually
# will boot. Update /etc/insserv/overrides/ or
# /usr/share/insserv/overrides/ with better dependency information
# if the boot order is incorrect, and run insserv -v to update the
# boot order.

# Ready to reboot
shutdown -r now

The next boot should then start services in parallel, as early as
possible during the boot process based on the dependency information
provided.

To monitor the boot sequence, the bootchart project is a good choice.
Debian packages are available in etch and sid. The project itself is
available from http://www.bootchart.org/.

Background info on alternative boot systems in Debian is available from
http://alioth.debian.org/docman/view.php/30730/38/debconf2-initscri....


In a nutshell, if you're not interested in getting down into the weeds I wouldn't fix what isn't broken.

Quantify the result
by DRIQ on Wed 30th Jul 2008 19:51 UTC
DRIQ
Member since:
2008-04-28

Could he please quantify the result?

I always say to friends "get the OS that does what you want".

Booting time is not a concern to me. What is the maximum time your NIX takes to boot? 60 seconds?

My FreeBSD and Debian are always on. I have not rebooted them for over a year now.

RE: Quantify the result
by sgibofh on Wed 30th Jul 2008 20:47 UTC in reply to "Quantify the result"
sgibofh Member since:
2007-03-31

the unix I work with may take > 30 minutes... depending on the version and hardware of HP-UX/server... ;-)

RE[2]: Quantify the result
by dimosd on Wed 30th Jul 2008 21:09 UTC in reply to "RE: Quantify the result"
dimosd Member since:
2006-02-10

the unix I work with may take > 30 minutes... depending on the version and hardware of HP-UX/server... ;-)


Oh yeah, I've heard about that... Care to explain why it takes so much time?

Comment by cerbie
by cerbie on Wed 30th Jul 2008 20:00 UTC
cerbie
Member since:
2006-01-02

1. Yes, we know. We knew that before we even knew what Linux was. But, with extra functionality comes extra services to be loaded, many during boot. What would be great, IMO, would be for service scripts to have their own dependency tree, and automatically run concurrently when possible, rather than requiring manual tuning for it, or basing it on some arbitrary factor (as the Debian example in 10).

2. *scratching head* This is usually automagically done for you, is it not (except maybe for drive controllers)?

3. Meh, until you get into ones that are really minimal. E17 may start up faster than KDE or Gnome, but XFCE takes about the same time, and can take longer. On my box, it's 8 seconds to KDE dekstop, just over 10 to XFCE's.

4. *shrug*

5. Bingo. I couldn't get X running (that was after days before it got to compiling) the last time I was reloading SMGL, so I went Arch. It's nice.

6. That would be really cool...but, even if I could, I don't have the balls for it. First, video inits, and you have your POST, then two fake-RAID drive controllers search for plugged in devices (I'm using drives plugged into both), then GRUB can do its thing. Speeding this up would be great.

If this is a concern, and you're going to build a new machine, get a motherboard with modern onboard video, and no frills.

7. *shrug*
8. *shrug* (udev)
9. Neat.

10. yup, been doing that for ages, in whatever way the distro I use allows. It's not just Debian that has this ability hidden in plain sight. Couldn't it be done better, though?

Edited 2008-07-30 20:12 UTC

Terrible
by SlackerJack on Wed 30th Jul 2008 20:01 UTC
SlackerJack
Member since:
2005-11-12

Article, Hotplug?, no we use Udev and HAL now.

Since when did GNOME or KDE take along time to load, they are both pretty quick at under 10 seconds.

My Boot time is about just over 20 seconds on Linux Mint without any tweaking, this person should update their knowledge of Linux boot process.

Rare occasions?
by hornett on Wed 30th Jul 2008 20:11 UTC
hornett
Member since:
2005-09-19

Undoubtedly I will be downvoted for saying this, but I'm getting really tired of blanket statements like "Linux rarely needs to be rebooted" at the start of articles like this.

Frankly it's a myth for most desktop Linux users, and server boot times don't really mean much anyway.

Every time you update a kernel, or graphics drivers in Linux, you have to reboot and, since suspend doesn't seem to work anymore you have to shut down everytime you pop to the office with your laptop*. If you don't install the kernel security updates then you might as well run one of those other 'insecure' operating systems anyway.

* I have 4 different laptops currently with Linux installed, none resume reliably from suspend or hibernate.

The main content of the article is useful, however!

/rant ;-)

RE: Rare occasions?
by parentaladvisory on Wed 30th Jul 2008 20:22 UTC in reply to "Rare occasions?"
parentaladvisory Member since:
2006-12-18

Well, for kernelupdates that is true, you have to reload the kernel to use new code, and folowing that sense, it is NOT true that you need to reboot to use and updated video-driver, you only need to reload the graphics system to use the new code, ie. xorg, which is usually done by changing to a lower runlevel and then back to a runlevel that starts the X system... Or as simple as stoping kdm/gdm via an rc-script and then restaring that service... This is for debian at least... BTW, ctrl-alt-delete restarts the x-server, but for at least the nvidia-driver X arent allowed to run while installing/updating the driver, so thats why you need to stop the service abnd restart it afterwards...

RE[2]: Rare occasions?
by melkor on Thu 31st Jul 2008 05:29 UTC in reply to "RE: Rare occasions?"
melkor Member since:
2006-12-16

Correct - if the video driver is a module, no reboot should be required. Kill X (btw, it's typically ^ meta backspace). Kill gdm/xdm/kdm. Load module. Restart gdm etc and startx if necessary. Voila, should have desktop.

Dave

RE[2]: Rare occasions?
by Soulbender on Thu 31st Jul 2008 05:55 UTC in reply to "RE: Rare occasions?"
Soulbender Member since:
2005-08-18

BTW, ctrl-alt-delete restarts the x-server


That's ctrl-alt-backspace and it doesn't restart the X server as much as just kills it.

RE: Rare occasions?
by whartung on Wed 30th Jul 2008 21:35 UTC in reply to "Rare occasions?"
whartung Member since:
2005-07-06

Undoubtedly I will be downvoted for saying this, but I'm getting really tired of blanket statements like "Linux rarely needs to be rebooted" at the start of articles like this.

Frankly it's a myth for most desktop Linux users, and server boot times don't really mean much anyway.


* I have 4 different laptops currently with Linux installed, none resume reliably from suspend or hibernate.


That's too bad, but to be fair that's one of the reasons I got a Mac is because sleep and hibernate DOES work reliably. We reboot when the random update comes down from Apple, both my tower and the laptop. Today, that's more and more rare since I still run 10.4 and my wife runs 10.3 on her iBook.

Other than that, just walk away from the machine and let it sleep, or close the laptop.

Seriously, this "instant on" and "instant off" ability is a poignant "quality of life" issue with computers for me nowadays. Having an "instantly" available computer combined with my "ubiquitous, always on" internet is major component to their value to me. If I had to boot up a machine to get on line, then it wouldn't happen. Power up...boot boot boot...web browser...shutdown...wait wait wait... Nope, sorry.

I do wish the Linux/BSDs/Solaris systems could get this part of the experience bullet proof.

Until then, when I get my next laptop, it's gonna be a Mac.

RE[2]: Rare occasions?
by hobgoblin on Thu 31st Jul 2008 02:34 UTC in reply to "RE: Rare occasions?"
hobgoblin Member since:
2005-07-06

get the hardware companies to test using the intel tester for acpi, and stop pulling of cazy stuff like foxconn was recently discovered doing, and it should be there in no time.

until then its like hunting submarines by throwing rocks from dingies...

RE[2]: Rare occasions?
by ba1l on Thu 31st Jul 2008 11:37 UTC in reply to "RE: Rare occasions?"
ba1l Member since:
2007-09-08

Power management actually works very well in Linux. If you run Linux on a Mac, without using any closed source drivers, it works as well as it does on a Mac running Mac OS X.

Where it falls down is closed-source drivers (particularly nVidia and ATI's video drivers), and buggy ACPI implementations on motherboards.

The last three laptops I've had all worked perfectly in Linux (except my Macbook's trackpad, which is unusable in anything but Mac OS), but a good half of the laptops I've looked at wouldn't have, either due to requiring closed-source drivers, or crappy ACPI.

My desktop machine crashes when waking from sleep though. Does the same running Windows, for that matter.

RE: Rare occasions?
by Soulbender on Thu 31st Jul 2008 06:03 UTC in reply to "Rare occasions?"
Soulbender Member since:
2005-08-18

I'm getting really tired of blanket statements like "suspend doesn't seem to work anymore". Frankly it's a myth for most desktop Linux users. Also, you really don't have to reboot when you install a new video driver.

The main content of the article is useful, however!

I found it mostly useless.

future
by antik on Wed 30th Jul 2008 20:20 UTC
antik
Member since:
2006-05-19

I'd like to see day when there would be only one chipset, only one type of hdd connectors (why we need drives at all is beyound me- petabytes of non-volatile RAM is available already), only one type of hot-swappable PSU, only one type of CPU cards that is upgradable just by throwing other(s) card(s) into ONE TYPE of socket, only one video card.

ONLY ONE F***** OS THAT WORKS!?

RE: future
by evangs on Wed 30th Jul 2008 20:41 UTC in reply to "future"
evangs Member since:
2005-07-07

That's called OS X.

RE: future
by DrillSgt on Wed 30th Jul 2008 21:19 UTC in reply to "future"
DrillSgt Member since:
2005-12-02

"I'd like to see day when there would be only one chipset, only one type of hdd connectors (why we need drives at all is beyound me- petabytes of non-volatile RAM is available already), only one type of hot-swappable PSU, only one type of CPU cards that is upgradable just by throwing other(s) card(s) into ONE TYPE of socket, only one video card.

ONLY ONE F***** OS THAT WORKS!?"


Can we throw World Peace in there too? ;)

RE: future
by pixel8r on Thu 31st Jul 2008 02:50 UTC in reply to "future"
pixel8r Member since:
2007-08-11

I'd like to see day when there would be only one chipset, only one type of hdd connectors (why we need drives at all is beyound me- petabytes of non-volatile RAM is available already), only one type of hot-swappable PSU, only one type of CPU cards that is upgradable just by throwing other(s) card(s) into ONE TYPE of socket, only one video card.

ONLY ONE F***** OS THAT WORKS!?


would you also like there to be only ONE type of house, ONE type of car, ONE phone.

competing standards aren't all bad. All of these things do interoperate so they're not completely incompatible. Sure your scenario makes life easier for IT support techs, but life would be very dull.

Re suspend
by TechGeek on Wed 30th Jul 2008 22:09 UTC
TechGeek
Member since:
2006-01-14

The code is at least there. Its mainly a problem with the hardware makers and bios makers not using a standard. I have a dell M1330 laptop and with Fedora 8 and 9 it worked flawlessly. Both suspend and hibernate. That is while using the Nvidia drivers. I would think it would work using generic video drivers.

heh...
by helf on Thu 31st Jul 2008 01:15 UTC
helf
Member since:
2005-07-06

This reads like a PC World "10 tips to making XP faster!" article...

My favorite: tip 1 (runlevels/services)
by Darkelve on Thu 31st Jul 2008 05:57 UTC
Darkelve
Member since:
2006-02-06

I've used the runlevels/services with pretty good success over the years.

For example, I don't have a printer connected, so cupsd can go. And I don't have any use for ssh either; plus a couple of other things I disabled. Be careful though, since most of the things you *will* need. This lets me shave off a second or 5 from my boot time.

As a bonus, (Open)SUSE makes it very easy to change this using its Yast module.

Comment by zugu
by zugu on Thu 31st Jul 2008 14:47 UTC
zugu
Member since:
2007-08-28

"10 Ways To Make Linux Boot Faster"

What's this, Digg?

RE: Comment by zugu
by Isolationist on Thu 31st Jul 2008 17:30 UTC in reply to "Comment by zugu"
Isolationist Member since:
2006-05-28

"10 Ways To Make Linux Boot Faster"

What's this, Digg?


I have been thinking that myself, it seems I read an article on Digg then it shows up a day later on OSNews

Comment by silix
by silix on Thu 31st Jul 2008 20:32 UTC
silix
Member since:
2006-03-01

the author has forgotten a potentually very useful one ( for those with ext3 boot partitions at least)

11. use fcache (http://lkml.org/lkml/2006/5/15/46) - after a first boot in which data is sequentially copied to a frontend cache in read order, having the system read from the cache on subsequent boots minimizes head seeks and, overall, boot time

So basically . . .
by dreamlax on Sat 2nd Aug 2008 09:00 UTC
dreamlax
Member since:
2007-01-04

Most of these steps are the Linux equivalent of deleting keys in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

RE: So basically . . .
by ichi on Sat 2nd Aug 2008 15:51 UTC in reply to "So basically . . . "
ichi Member since:
2007-03-06

Most of these steps are the Linux equivalent of deleting keys in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run


Ermm not at all. Deleting keys there only prevents some stuff from running at boot... if anything that would only be remotely similar to disabling services (#1).

RE[2]: So basically . . .
by dreamlax on Sun 3rd Aug 2008 04:41 UTC in reply to "RE: So basically . . . "
dreamlax Member since:
2007-01-04

Hmmm, perhaps I was too subtle. What I meant was, if you want your Windows machine to boot faster you delete keys from HKLM\Blah\blah\blah\Run. Sometimes you go into the Services thingy and disable some service startups, but mostly it's the registry thing.

In Linux, a lot of people already disable unnecessary services after an install in much the same way they would go into HKLM\Blah\blah\blah\Run on a Windows machine after a fresh re-image using a manufacturer's recovery disc (because it installs all that extra crap nobody really likes/uses anyway).

I know that in actuality the HKLM\Blah\blah\blah\Run thing and disabling services in Linux are entirely different approaches but they are usually the first steps taken on a Windows or Linux system (respectively) to get it to boot faster.

Things like using another Window manager is not dissimilar from disabling nVidia nView etc.