Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Faster boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Mon Jun 28, 2004 7:01 pm    Post subject: Faster boot Reply with quote

My HTPC takes waaay too long to boot. As nothing changes everytime it starts up, is there anyway I can make it start faster?
It takes roughly 2 minutes now, I'd like to cut that down to about one fourth of that if it's possible.

I could use some tricks like starting freevo after, say network, to make things seem a bit faster. It doesn't matter if samba, nfs and so on is started after X, does it?
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Mon Jun 28, 2004 7:23 pm    Post subject: Re: Faster boot Reply with quote

Raniz wrote:
My HTPC takes waaay too long to boot. As nothing changes everytime it starts up, is there anyway I can make it start faster?
It takes roughly 2 minutes now, I'd like to cut that down to about one fourth of that if it's possible.

I could use some tricks like starting freevo after, say network, to make things seem a bit faster. It doesn't matter if samba, nfs and so on is started after X, does it?


how about the filesystem checks on mount? my system runs journal checks on all my partitions on boot; this takes pretty long, but as i rarely reboot, i hardly care about that. (FYI, the dump/pass bit in fstab tells you this).
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Mon Jun 28, 2004 7:27 pm    Post subject: Reply with quote

How do I turn it off then?

edit:
found it in the manpage...
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
MagnusBerg
Guru
Guru


Joined: 07 Oct 2003
Posts: 370
Location: Stockholm, Sweden

PostPosted: Mon Jun 28, 2004 7:33 pm    Post subject: Reply with quote

In the fstab. Set the last number in the row to zero.

from man fstab:
If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Mon Jun 28, 2004 7:39 pm    Post subject: Reply with quote

As I stated in my post (edit) I found it in the manpage ;)
But thx anyway...

Though I doubt this will lower my startup-time as much as I want it to...
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
Monkeywrench
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: Florida

PostPosted: Mon Jun 28, 2004 8:44 pm    Post subject: Reply with quote

In /etc/conf.d/rc you can set this:

Code:
# Set to "yes" if you want the rc system to try and start services
# in parallel for slight speed improvement.

RC_PARALLEL_STARTUP="yes"


and this:

Code:
# Set to "yes" if you want to save /dev to a tarball on shutdown
# and restore it on startup.  This is useful if you have a lot of
# custom device nodes that udev do not handle/know about.
# (ONLY used by UDEV enabled systems!)

RC_DEVICE_TARBALL="no"


Also, in /etc/init.d/checkfs, I commented out all the stuff related to usb support:

Code:
depend() {
        need checkfs
}

start() {
        # Mount local filesystems in /etc/fstab.
        ebegin "Mounting local filesystems"
        mount -at nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null
        eend $? "Some local filesystem failed to mount"

#       # Make sure we insert usbcore if its a module
#       if [ -f /proc/modules ]
#       then
#               # >/dev/null to hide errors from non-USB users
#               modprobe usbcore &>/dev/null
#       fi
#       
#       # Check what USB fs the kernel support.  Currently
#       # 2.5+ kernels, and later 2.4 kernels have 'usbfs',
#       # while older kernels have 'usbdevfs'.
#       local usbfs="$(grep -Fow usbfs /proc/filesystems ||
#               grep -Fow usbdevfs /proc/filesystems)"
#
#       if [ -n "${usbfs}" ] && \
#          [ -e /proc/bus/usb -a ! -e /proc/bus/usb/devices ]
#       then
#               ebegin "Mounting USB device filesystem (${usbfs})"
##              # Fetch usb gid from /etc/group; fixes bug 35860
##              usbgid=$(awk -F: '/^usb:/{print $3; exit}' /etc/group)
##              mount -t ${usbfs} ${usbgid:+-o devmode=0664,devgid=$usbgid} \
#               mount -t ${usbfs} none /proc/bus/usb &>/dev/null
#               eend $? "Failed to mount USB device filesystem"
#       fi

        # Swap on loopback devices, and other weirdnesses
        ebegin "Activating (possibly) more swap"
        /sbin/swapon -a &>/dev/null
        eend 0
}


# vim:ts=4


These are all really small speed improvements though. :oops:
_________________
Folding@home -Join the Linux team (163)!
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1171
Location: Seattle

PostPosted: Mon Jun 28, 2004 9:40 pm    Post subject: Reply with quote

Check the modules script, I think its safe to comment out the modules_update call or something, so long as you do it after new kernels
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Tue Jun 29, 2004 3:33 pm    Post subject: Reply with quote

Seems like I've done almost all tweaks you guys come up with (I've found some of them in other threads on the forum...)

Haven't anyone got any radical suggestions? ;)
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1171
Location: Seattle

PostPosted: Tue Jun 29, 2004 4:58 pm    Post subject: Reply with quote

start removing things from runlevels and see what breaks :D
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Tue Jun 29, 2004 6:17 pm    Post subject: Reply with quote

I'll do that :)
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
Monkeywrench
Apprentice
Apprentice


Joined: 22 Jun 2004
Posts: 205
Location: Florida

PostPosted: Wed Jun 30, 2004 5:55 am    Post subject: Reply with quote

El_Presidente_Pufferfish wrote:
start removing things from runlevels and see what breaks :D


I absolutely loved doing that with Slackware when I had it.... haven't played with it much in gentoo, however. :(
_________________
Folding@home -Join the Linux team (163)!
Back to top
View user's profile Send private message
gnuageux
Veteran
Veteran


Joined: 17 Apr 2004
Posts: 1201

PostPosted: Wed Jun 30, 2004 11:44 am    Post subject: Reply with quote

You can remove unneeded startup services from /etc/runlevels/default by using rc-update. (much like other distros chk-config)

The syntax is rc-update del cupsd (or whatever demon) runlevel (default in most cases)
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sun Jul 11, 2004 8:50 pm    Post subject: Reply with quote

do what windows does: start servises after logging into X http://forums.gentoo.org/viewtopic.php?t=131142&start=25
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz


Last edited by teutzz on Sun Jul 11, 2004 9:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sun Jul 11, 2004 9:06 pm    Post subject: Reply with quote

also use reiser4, a love kernel, and gcc 3.4.1 with -fvisibility-inlines-hidden, and maybe just maybe give a try to prelink
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
DiskBreaker
Apprentice
Apprentice


Joined: 07 Oct 2003
Posts: 224

PostPosted: Fri Jul 23, 2004 1:15 pm    Post subject: Reply with quote

Raniz wrote:
Haven't anyone got any radical suggestions? ;)

One thing you could try is merge all your relevant startup scripts into one big rc file. Since all the different scripts start in their own bash shell and then start sourcing different configuration files a lot of unnecessary time is wasted.

This of course only works if you have a very static startup routine, but most people do. You will have to fix a lot of things and hava a good grasp of what is going on in order to do so. And you will lose all the advantages of the well-designed gentoo rc system.

I did this a few years ago on an old RedHat system and gained some 5 seconds of bootup time. I don't think this is worth doing on today's fast machines though... But since you were looking for more radical suggestions :lol:

Another thing to consider is also how much time gets wasted by your BIOS probing your hardware while linux will do the same thing again when it boots. To remedy this, you could try to flush your BIOS and run LinuxBIOS, a very minimalistic BIOS that just unpacks and loads your kernel image and lets the kernel take over. Just check if your motherboard is supported yet, many already are: http://www.linuxbios.org/status/index.html.

Is this radical enough for you? :wink:
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Sun Jul 25, 2004 5:18 pm    Post subject: Reply with quote

DiskBreaker wrote:
Another thing to consider is also how much time gets wasted by your BIOS probing your hardware while linux will do the same thing again when it boots. To remedy this, you could try to flush your BIOS and run LinuxBIOS, a very minimalistic BIOS that just unpacks and loads your kernel image and lets the kernel take over. Just check if your motherboard is supported yet, many already are: http://www.linuxbios.org/status/index.html.

Is this radical enough for you? :wink:

That truly is radical ;)
Though I doubt it'll make any good, my biosscreen flashes by in an instant and then grub takes over. So I don't think it'll make any noticeable difference :/
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
Raniz
l33t
l33t


Joined: 13 Sep 2003
Posts: 961
Location: Lund, Sweden

PostPosted: Sun Jul 25, 2004 5:18 pm    Post subject: Reply with quote

DiskBreaker wrote:
Another thing to consider is also how much time gets wasted by your BIOS probing your hardware while linux will do the same thing again when it boots. To remedy this, you could try to flush your BIOS and run LinuxBIOS, a very minimalistic BIOS that just unpacks and loads your kernel image and lets the kernel take over. Just check if your motherboard is supported yet, many already are: http://www.linuxbios.org/status/index.html.

Is this radical enough for you? :wink:

That truly is radical ;)
Though I doubt it'll make any good, my biosscreen flashes by in an instant and then grub takes over. So I don't think it'll make any noticeable difference :/
_________________
#312470 @ http://counter.li.org/
Back to top
View user's profile Send private message
blaster999
l33t
l33t


Joined: 09 May 2004
Posts: 902
Location: Between keyboard and chair

PostPosted: Mon Jul 26, 2004 12:49 pm    Post subject: Reply with quote

Inspect your scripts. For example, I have pppoe connection, so I changed the line
Quote:

start-stop-daemon --start --quiet --exec /usr/sbin/adsl-start

to
Quote:
start-stop-daemon --start --quiet --exec /usr/sbin/adsl-start >/dev/null &

And I don't have to wait some 6 seconds while the link is being established. I edited many scripts and now my system taked about 1 minute to boot (I am using KDE, so 1 minute is a good result).
_________________
60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
http://forums.gentoo.org/viewtopic.php?p=1896734#1896734
Back to top
View user's profile Send private message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Mon Jul 26, 2004 1:40 pm    Post subject: Reply with quote

blaster999 wrote:
Inspect your scripts. For example, I have pppoe connection, so I changed the line
Quote:
start-stop-daemon --start --quiet --exec /usr/sbin/adsl-start

A while ago, that line used to read:
Quote:
start-stop-daemon --start --quiet --background --exec /usr/sbin/adsl-start

I've never quite understood why it was changed (nothing appears to depend on pppoe, seeing as how it gets started approximately last in the boot sequence), so I've kept it that way. No problems here, but YMMV.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
dilandau
Guru
Guru


Joined: 24 May 2003
Posts: 485
Location: germany

PostPosted: Tue Dec 07, 2004 10:20 am    Post subject: Reply with quote

just to note: the parallel execution at boot time messes up my system and results in numerous unreproduceable errors. the --background option didnt do anything and i used an & char appended to the adsl-start command in the local.start file instead. that did it.
_________________
gentoo linux - amd duron stalebred 1600 - elsa gladiac 311 (nvidia) - elitegroup k7s5a (sis, lan) - 256mb ram - wintv pci fm - airstar2 dvb-t pci - ide cdwriter - hp psc 1110
Back to top
View user's profile Send private message
castorilo
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 157

PostPosted: Tue Dec 07, 2004 8:38 pm    Post subject: Reply with quote

check out this thread and search for my posts in there.

I have written several patches for improving boot speed. Also check out this bugs I made that contains patches and information.

don't do modules-update if not necesary
Make parallel startup really parallel
start X sooner

And this bug keeps track of the other ones and future ones. Specifically, check out comment #19 where you can clearly see the progress I have made in this area so far. Just to make it clear, you don't have to install bootchart, just emerge librsvg to view the charts I posted there.

radical enough? :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum