View Full Version : How I Modified Fedora To Boot In Under 25 Seconds
ghenry
27th July 2005, 09:07 AM
Very nice read (I will be trying this out later):
http://www.improvedsource.com/content/view/13/2/
Everyone wants a quick boot time, from the beginner user to the advanced user, this is a issue that bothers us all. As Linux has advanced it has increasingly become slower to boot. I have tested on my machine 4 Linux distributions: Linspire, Fedora 3 & 4, Suse 9.2 & 9.3, and Debian. And on average between all these distributions Linux needs around a minute to 1 and half minutes to go from boot loader to graphical login screen. So I decided to look into reducing the time it takes to boot my current setup, which is Fedora 4. In doing so I was able to reduce the boot time of my Fedora 4 installation to less than 25 seconds (just above 24 seconds on average). Below I have documented what I did, and what you can use to potentially reduce your boot up time for Linux.
imdeemvp
27th July 2005, 09:28 AM
I am pretty sure I saw some similiar info ealier.......thanks for sharing.
EDITED: i was correct here it is: http://forums.fedoraforum.org/showthread.php?t=66751
handy
27th July 2005, 02:31 PM
Hmm this early login wasn't any difference for me
sgjanssens[old]
27th July 2005, 02:39 PM
Thanks for the nice article! Inspecting my services did make quite a difference. Didn't have the courage to start recompiling my kernel (yet).
Unfortunately, I found out that X is still started twice: Once early in the boot process, once at the very end, so it seems early-login wasn't enabled. I ran the chkconfig commands as root. Did people manage to get it working?
weinerdogus
27th July 2005, 02:51 PM
Enabling early login made no difference for me. Perhaps the key is recompiling the kernel?
ghaefb
27th July 2005, 03:54 PM
About that early-login... I think the author of the article forgot one important thing :)
After all the chkconfig you need to add a 'early-login' to the kernel line in /etc/grub.conf
My grub.conf:
title Fedora Core 4(2.6.12-1.1398_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1398_FC4 ro root=/dev/hda3 vga=0x318 early-login
initrd /initrd-2.6.12-1.1398_FC4.img
A-fil
27th July 2005, 04:17 PM
Lets say I disable wine at bootup, then how do I enable it again? (while running)
sgjanssens[old]
27th July 2005, 04:19 PM
ghaefb: Thanks, that did it. It costs me the graphical boot progress screen but I don't consider that a terrible loss.
A-fil: I thought you can just type wine file.exe at the shell prompt.
hiberphoptik
27th July 2005, 04:29 PM
interesting... my system boots up waaaaaaaaaaaaaay under 1 minute, if it took 1 minute i would probly assume something was broken!
i am not sitting at the machine now but i would guess it takes about 15-20 seconds.
only services i need are network, cron, and a couple others so my bootup is lightning fast, im sure a fast processor is a huge help too :)
ThijsH
27th July 2005, 05:03 PM
Great :-) It works, but it can work better. The X-server tries to start 3 times. The first 2 times it crashed, because xfs isn't loaded yet. The third time the X-server starts without problems, because xfs is started then. How can I make xfs start earlier ?
- Thijs
ghaefb
27th July 2005, 05:13 PM
Great :-) It works, but it can work better. The X-server tries to start 3 times. The first 2 times it crashed, because xfs isn't loaded yet. The third time the X-server starts without problems, because xfs is started then. How can I make xfs start earlier ?
- Thijs
Here are some more details about early-login and xfs:
http://www.redhat.com/archives/fedora-test-list/2005-April/msg00416.html
Well this is the important part anyway:
Next thing you'll want to do is to change the chkconfig: line
in /etc/init.d/xfs to
# chkconfig: 2345 08 97
and also change the chkconfig: line in /etc/init.d/syslog to
# chkconfig: 2345 07 98
then run
/sbin/chkconfig xfs on
/sbin/chkconfig syslog on
/sbin/chkconfig --add gdm-early-login
/sbin/chkconfig --add gdm-allow-login
/sbin/chkconfig gdm-early-login on
/sbin/chkconfig gdm-allow-login on
to regenerate the symlinks in /etc/rc5.d
The last thing that needs to be changed is grub.conf. It should be
modified such that the kernel cmdline has "early-login" in it.
For instance, it might look like this:
kernel /vmlinuz-2.6.11-1.1208_FC4 ro root=/dev/VolGroup00/LogVol00 quiet
vga=0x317 early-login
ThijsH
27th July 2005, 05:16 PM
Thank you !
CuCullin
27th July 2005, 06:16 PM
As a side note, another idea would probably be LinuxBIOS (http://www.linuxbios.org/index.php/Main_Page). I don't remember what mag, but there was a recent article on very quick boot times using some minor tweaks and LinuxBIOS together. I'll see if I can find the mag tonight (post NYLUG).
x94scorp
27th July 2005, 07:16 PM
I will enable this. What if I need to revert back? What do I change these setting to ?
/etc/init.d/xfs to
# chkconfig: 2345 08 97 <-----------
and also change the chkconfig: line in /etc/init.d/syslog to
# chkconfig: 2345 07 98 <-----------
then run
/sbin/chkconfig xfs on <-----------
/sbin/chkconfig syslog on <-----------
/sbin/chkconfig --add gdm-early-login <-----------
/sbin/chkconfig --add gdm-allow-login <-----------
/sbin/chkconfig gdm-early-login on <-----------
/sbin/chkconfig gdm-allow-login on <-----------
to regenerate the symlinks in /etc/rc5.d
ghaefb
27th July 2005, 07:22 PM
I will enable this. What if I need to revert back? What do I change these setting to ?
/etc/init.d/xfs to
# chkconfig: 2345 08 97 <-----------
and also change the chkconfig: line in /etc/init.d/syslog to
# chkconfig: 2345 07 98 <-----------
Simply backup the /etc/init.d/xfs and /etc/init.d/syslog files somewhere, and replace them afterwards...
then run
/sbin/chkconfig xfs on <-----------
/sbin/chkconfig syslog on <-----------
/sbin/chkconfig --add gdm-early-login <-----------
/sbin/chkconfig --add gdm-allow-login <-----------
/sbin/chkconfig gdm-early-login on <-----------
/sbin/chkconfig gdm-allow-login on <-----------
That would be:/sbin/chkconfig xfs off
/sbin/chkconfig syslog off
/sbin/chkconfig --del gdm-early-login
/sbin/chkconfig --del gdm-allow-login
/sbin/chkconfig gdm-early-login off
/sbin/chkconfig gdm-allow-login off
x94scorp
27th July 2005, 07:45 PM
Thanks ghaefb,
I'll back them up just in case. :)
komi
27th July 2005, 07:55 PM
All this stuff really helps!
I had a boottime (from grub to loginscreen) from about one minute.
Now I did:
recompile kernel - just things in I really need, features I need (ext3, usb, ...) compiled in
disabled all services I don't need
enabled early-login
now I have a boottime from 21 seconds!!!
regards komi
x94scorp
27th July 2005, 10:37 PM
how do I know this is working?
I followed the directions listed, but I don't think it's working?
looks like X is starting twice still- should I be able to see my services starting?
do I leave the # in # chkconfig: 2345 08 97 in /etc/init.d/xfs and the
# in # chkconfig: 2345 07 98/etc/init.d/syslog ?
strikeforce
28th July 2005, 03:05 AM
Thats just showing you the command prompt.
The command is chkconfig blahblah the rest of it :P
Melio
28th July 2005, 08:10 AM
wow, my boottime improved alot just from taking down useless services and skipping the hardware dectection alone.
I'm going to research this further. I would really like a faster boottime. . even tho I rarly reboot. . . sometimes I do. :P like when I'm testing boot speed :P
imdeemvp
28th July 2005, 09:51 AM
About that early-login... I think the author of the article forgot one important thing :)
After all the chkconfig you need to add a 'early-login' to the kernel line in /etc/grub.conf
My grub.conf:
I dont accomplish 25 but it boots in 30 secs....any ideas why because I disable some of the suggested apps?
BTW, this is my laptop I have not tried in desktop.
Firewing1
28th July 2005, 07:21 PM
Yeah.. .about the X starting twice (or 3 times), it's cause you have the rhgb keyphrase at the end of your kernel boot line in /etc/grub.conf. it makes the graphical boot screen. remove the rhgb (stands for redhat graphical boot) and then it'll give you the classic startup (just text Service ..... [OK]) and then at the end you'll get a graphical logon, starting X only once.
Also, why the big worry over 5 seconds? I can understand foir the big part, but what I'm going to do is just the early-logon and also take of rhgb, disable services, and then that's it. That should bring my boottime to about 1 min to 30 secs, give or take. I won't bother spending the time of looking into the kernel modules needed, recompiling it, then you just spend more time researching and recompilign than you save!
Firewing1
kosmosik
28th July 2005, 07:47 PM
I don't use GDM or any X based login manager... what I do is my system runs in runlevel 3 - when it is completely booted it drops mingettys (with zsh) on 1~10th console - with autologin... so early-login (X) don't really bothers me... when I wan't X i type x (which is alias of startx) and my WindowMaker pops in like 3 seconds... this is quite nice...
now my boot time is quite long - it is 55 sec. - I've measured it with boot chart:
http://misc.kosmosik.ath.cx/varia/bootchart-notebook.png
It looks like most of the time taken on boot is due to:
1. udev and its stuff (udevd, pccardd, usb..., kgameportd (**** I do not have gameport in my laptop) - it takes like 20 seconds :( old Fedoras were faster (with devfs)...
2. dhcp-client - it is stupid, it stops entire boot sequence looking for IP :( it should go into background... 5 seconds.
3. cupsd - another 10 seconds - it is so heavy or what?
other things look like normal - they take some time but not as long...
so If I could somehow (but without seriously wrecking the system thou) change udev with devfs back. make dhcp-client fork into background. change or make CUPS lighter. I could have like 15 seconds less on boot... that would be 40 seconds - quite normal. the machine is P3 1Ghz with laptop (not too fast) harddrive and fair amount of ram (256MB)...
but there are some issues - with FC1 I've used LPRng instead of CUPS - it was way faster - but with FC4 almost everything is integrated with CUPS so I see problems here... also changing udev to devfs means ripping entire distro up/down... changing dhcp-client behaviour is probably easier as you need to modify only one init script... I guest I'll just stick with this boottime, get some coffe during it and that will be it... ;)
any insight on that?
Firewing1
28th July 2005, 10:27 PM
WoW! I'm very impressed. I timed my computer from the second I pressed the power button to when my HD monitor on my Gnome Panel showed no activity after I loged in. It took 2:51. I disabled all services I didn't need, but kept the optional ones on cause I like options and freedom, but I took off the ones I really don't need. I disables RHN since it doesn't work anyway, and installed yumex instead. Then, I took of rhgb, and added early logon. Rebooted, time is now 1:51. Saved me a minute!!! (BTW > I run a server, that's why my boot time is so much longer.)
Firewing1
kosmosik
28th July 2005, 10:51 PM
fire: I also run some servers on my laptop (look at bootchart) namely httpd and mysql... what is your hardware? 2 minutes is far too much IMHO... try to:
1. disable more services
2. make bootloader load faster (less time to boot I use 0 seconds)
3. disable kudzu
4. tweak filesystem
5. disable SELinux
hlfmanhlfamzng
29th July 2005, 03:52 AM
What do you mean tweak filesystem?
cybrjackle
29th July 2005, 04:14 AM
18 seconds on my laptop, dropped from 1 minute and 20 seconds.
How-To here
http://forums.fedoraforum.org/showthread.php?p=319950#post319950
There are things that work/dont so use at your own risk........!
axel
29th July 2005, 11:11 AM
Is there a possibility to do something like early-login in FC3?
wowbagger42
29th July 2005, 12:52 PM
Along different lines, I do this (http://geetduggal.com/mdash/bootfaster.html) on my comuter. See if it improves your boot time any more.
ghaefb
29th July 2005, 12:58 PM
Is there a possibility to do something like early-login in FC3?
Well I think the early-login is a gdm 2.6.0 feature, check the version of gdm on your fc3:
rpm -q gdm
You can try...
BandC
29th July 2005, 04:06 PM
Interesting stuff. Even though I reboot my computer everyday, I don't care much if it reboots in 25 seconds or 2 minutes. The performance while using it matters more to me. In any case, the question is if there were no side effects to this why didn't Fedora Developers enable this early login by default? They would want people say that Fedora boots really fast wouldn't they? Maybe there is a good reason we don't know.
ThijsH
29th July 2005, 05:17 PM
Maybe there is a good reason we don't know.
I don't think there are reason... Maybe the Fedora-developers didn't know or something, maybe it wasn't stable enough.
But early-login by default is on the FC5Future-page: http://fedoraproject.org/wiki/FC5Future
zivagolee
29th July 2005, 09:57 PM
Does this work with Twinview? I have Twinview but only 1 monitor comes up...
axel
30th July 2005, 12:47 PM
Well I think the early-login is a gdm 2.6.0 feature, check the version of gdm on your fc3:
rpm -q gdm
You can try...
[root@aeris ~]# rpm -qa|grep gdm
gdm-2.6.0.5-6
[root@aeris ~]# chkconfig --add gdm-early-login
error reading information on service gdm-early-login: No such file or directory
Any ideas..?
cybrjackle
30th July 2005, 03:14 PM
[root@aeris ~]# rpm -qa|grep gdm
gdm-2.6.0.5-6
[root@aeris ~]# chkconfig --add gdm-early-login
error reading information on service gdm-early-login: No such file or directory
Any ideas..?
FC4
$ rpm -qa | grep gdm
gdm-2.6.0.8-16
The early-login patches are in fc4
http://cvs.fedora.redhat.com/viewcvs/rpms/gdm/FC-4/
gdm-early-login.init
gdm requires enough deps that it would be eaiser to just upgrade to 4 imho.
micha
2nd August 2005, 03:27 AM
Well, it works for me, my laptop is ready in 26s (see attached bootchart image).
My specs : Dell Inspiron 8600, P-M 1,7GHz, 1Go DDR, HDD 60Go 7200rpm
cardinal II
4th August 2005, 07:50 AM
How the hell do I install this bootchart? I've tried to follow the docs on the page, no useful links on google either. Can someone give me the heads up? I've got the source rpm, I also have jpackage set up as a repo. The documentation on the site is dreadful by the way.
Edit: I worked it out. I guess people assume that all people running FC should know how to execute a script - I didn't.
micha
4th August 2005, 05:23 PM
How the hell do I install this bootchart? I've tried to follow the docs on the page, no useful links on google either. Can someone give me the heads up? I've got the source rpm, I also have jpackage set up as a repo. The documentation on the site is dreadful by the way.
Edit: I worked it out. I guess people assume that all people running FC should know how to execute a script - I didn't.
First you need to install jakarta-common-cli rpm package from Jpackage repository. Then, download the source rpm of Bootchart and compile the rpms:
rpmbuild --rebuild bootchart-0.8-1.src.rpmYou will find the rpm packages in /usr/src/redhat/RPMS/noarch/.
I have attached the compiled Bootchart rpm packages in the attached zip file.
fedoric
6th August 2005, 12:39 PM
Hmm, I don't think its only the rhgb in /etc/grub.conf. I didn't have it because I removed it when installing the NVidia drivers.
But after I enabled the early-login stuff (without changing the startup of xfs or syslog), I also could see X starting 2-3 times.
I am reluctant to change my xfs/syslog, but still the early-login gives a nice speedup already.
Fedoric
Firewing1
9th August 2005, 03:28 AM
Hey,
I have a small problem. I didn't wanna double post so if people could please view this
http://www.fedoraforum.org/forum/showthread.php?p=342076#post342076
thread I would really appreciate it.
Firewing1
ogetbilo
10th September 2005, 09:03 AM
I tried early logon
It completely disabled my network connection on the first boot
On the second boot (and on the consecutive boots) X didn't start.
I had to reset everything
and yes, kdm is gone. No matter what I do, I have to use gdm even after resetting.
jimtss
10th September 2005, 05:59 PM
If you want a fast boot-up and a very quick OS, try Puppy Linux. Go here: http://www.goosee.com/puppy/
Puppy Linux
REInvestor
15th September 2005, 04:22 AM
OK... let's get back on topic...
I have a project that a few of you might be able to help with. Thanks to this and other Forums, I was able to reduce the boot time of my Thinkpad 600 from 3:30 from power switch to login to 1:30. The main improvement has been achieved by getting initng working.
While this is a huge improvement, I still want more. First off, once I am fully up, I need to turn PCMIA on and retart my network to get to the internet. Second, I haven't yet "hacked" the kernel to optimize it for this machine. Lastly, it still takes one full minute to go from Login to fully ready, does anyone know how I can trim this time?
System Specs:
266Mhz - 64MB + 256MB expansion memory
60GB Toshiba HDD
CD Rom Drive
Fedora Core 4
Should I post a new thread to get help, or can we keep adding on here?
Clunixchit
15th September 2005, 01:20 PM
Can i disable the service auditd ??
Firewing1
9th November 2005, 01:29 PM
Hey,
I can't figure it out. Even though I have set XFS to start priority 07 and the display manager 10, XFS still starts WAY after display manager, causein errors.
Help!
Firewing1
Firewing1
12th November 2005, 08:13 PM
I'v still very confused:
/etc/init.d/xfs
...
# chkconfig: 2345 05 98
...
/etc/init.d/syslog:
...
# chkconfig: 2345 07 98
...
/etc/init.d/gdm-early-login:
...
# chkconfig: 5 10 91
...
yet syslog starts before, and XFS starts WAY after display manager. Confused.
EDIT: OK, it works now.. did this:
chkconfig --add xfs
chkconfig xfs on
even though it was already there and on, but it work now.,..
Firewing1
Firewing1
2nd January 2006, 09:06 PM
I've had people ask me about what services to disable recently... So, I've made a list of the basic services and what you need to do extra stuff (The basic isn't really basic; but what you need for day-to-day use.):
-- BASIC --
acpid
anacron
atd
auditd
autofs
crond
cups
cups-config-daemon
gdm-allow-login
gdm-early-login
haldaemon
iptables
messagebus
netfs
network
nvidia-glx
NOTE: nvidia-glx is only for people who have installed the nvidia driver from Livna
pcmcia
syslog
xfs
xinetd
-- MORE SERVICES --
apmd: for laptop's battery monitor
bluetooth: needed for bluetooth wireless things to work
cpuspeed: dynamic CPU speed daemon
gpm: Mouse support in terminals (runlevel 3)
httpd: Apache's Web server
mysqld: MySQL's database server
kudzu: hardware probe at startup
nfs + nfslock: NFS server
smb: Samba server
rhnsd: Red Hat server check for updates, no longer useful in FC4 as the Red Hat Network is disabled.
sendmail: Mail server
sshd: remote SSH login
I like to use system-config-services to edit my bootup services, it has a nice, easy-to-use GUI. It can be installed with
shell#$: yum install system-config-services
Personally, I have the basic services plus a few more, and my system boots in 34 seconds :p
Hope it helps out,
Firewing1
jim
2nd January 2006, 09:09 PM
there is a wiki page for possible service to be axed in FC5
http://fedoraproject.org/wiki/DefaultServices
multescugeorge@
3rd August 2006, 04:55 PM
I managed to clock about 30 seconds from power button to surfing the net.
The only thing is i use the hibernate feature in the kernel. I also recompiled the latest kernel, along with a low latency desktop patch, and i really enjoy my startup time.
Not sure how it will behave on different computers, as it's a hardware dependant thingy(ACPI comes to mind).
Dan
3rd August 2006, 07:10 PM
For perspective...
Several decades ago, on a bright Saturday morning, I sat down at my makeshift desk with a cup of coffee, freshly nuked in our brand new 800 watt Radar-Range, and chunked the Workbench 1.3 floppy into the side of my spanking new Amiga 500, admiring the sound as it chugged away, loading the entire OS from a 700K DS-DD floppy disk.
My lovely wife came and put her arms around my neck and admired the Blue and Orange 640 X 400 Workbench screen with me. I lifted my cup in a salute to the good life and said, "Hon, If I ever complain that the computer takes too long to boot, and it takes too long to nuke my coffee, please inform me that life is moving way too fast."
How could we have known?
Dan
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.