LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Optimize slack boot process / init scripts ? (https://www.linuxquestions.org/questions/slackware-14/optimize-slack-boot-process-init-scripts-525364/)

H_TeXMeX_H 02-03-2007 08:28 PM

Optimize slack boot process / init scripts ?
 
I've heard it can be very beneficial to change and optimize the init / boot scripts to make Slackware boot faster.

1) Where can I look to get some specific guidance on how to do this ? Or is this a bad idea ?

It's just that Slackware seems to take kinda long to boot up.

While I'm here, I'd like to also ask this (still about Slackware boot process):

2) I installed Slackware on an old VAIO computer, specs are approximately:

Pentium III M - 1.3 Ghz
128 MB RAM
16 MB ATI Radeon - M :(
40 GB HDD

The problem is it takes forever to boot. It gets really slow in the early booting process, when it is "Checking BIOS integrity" and then the dots '.............................................' appear really really really slow.

Why ? What is it doing that is taking this long ? I've always though it's loading the kernel into RAM ... is this so ? How can I make it boot faster, if at all possible ? Of course, changing the init scripts will also be helpful, cuz that takes a while too.

Thanks.

Th3_J3st3R 02-03-2007 10:18 PM

Have you recompiled your kernel selecting specific options to reflect your hardware?
I had the same thing when I would recompile and select options that my system didnt support, as for specifics I couldnt tell you. What kernel are you using? Or which one did you select when you installed?

H_TeXMeX_H 02-03-2007 10:49 PM

Kernel on both my current machine and the older one is huge26.s.

I was thinking of recompiling, but I usually don't like to unless I really have to.

They are both laptops.

I was thinking of trying a 2.4.x kernel to see if it would speed things up, but it has a usb mouse, and I've had problems with the 2.4.x kernel and usb mice. Maybe I'll try. I don't have access to the older computer right now, so I can't do much there. But I can optimize things here on my newer laptop.

(I'm not going to recompile a 2.4.x kernel, I would like to use a 2.6.x kernel for many many reasons ... maybe I'll recompile that, but not right now)

H_TeXMeX_H 02-04-2007 12:30 PM

To clarify, the slowest part is when it says:

Code:

Loading Linux......................................................
(right before the BIOS integrity verified or whatever)

Each dot takes 5 seconds to appear ... which is insane if you ask me.

So any ideas on why it would boot so slow ? Is this when it is loading the kernel into RAM ? If so, maybe the HDD is really slow at being read, or the RAM isn't working properly ? (I'll check that RAM with memtest when I next have access to that computer, and I'll check the HDD to make sure DMA is enabled if that matters)

jschiwal 02-04-2007 12:36 PM

Do you maybe have the "nodma" or "noacpi" boot options?

zetabill 02-04-2007 12:43 PM

Let us know how the memory and the HD are but I tend to think that if you don't have any problems except loading the kernel then it might be something with the kernel. This is where the kernel is loaded into RAM, yes. You might have to check around your kernel config to see if there's anything funky in there.

In my honest opinion you might have to recompile the kernel if for any reason to have a slimmer kernel so that it's not loading as much information into RAM. It's not completely impossible that there's some driver in there that might be "confusing" things when drivers get loaded for the disk or the processor.

You may also want to
Code:

lilo -t -v
This will do a dry run of lilo and let you know if there are any errors in the bootloading process.

EDIT: jschiwal brings up a good point. What's being passed to the kernel at boot?

H_TeXMeX_H 02-04-2007 12:58 PM

Quote:

Originally Posted by zetabill
Let us know how the memory and the HD are but I tend to think that if you don't have any problems except loading the kernel then it might be something with the kernel. This is where the kernel is loaded into RAM, yes. You might have to check around your kernel config to see if there's anything funky in there.

In my honest opinion you might have to recompile the kernel if for any reason to have a slimmer kernel so that it's not loading as much information into RAM. It's not completely impossible that there's some driver in there that might be "confusing" things when drivers get loaded for the disk or the processor.

You may also want to
Code:

lilo -t -v
This will do a dry run of lilo and let you know if there are any errors in the bootloading process.

EDIT: jschiwal brings up a good point. What's being passed to the kernel at boot?

I have no boot options being passed to kernel.

I'll do the following when I get there and post back results (note that it will take ~ 1 mo. to get back to the other computer ... it's at my other house)

1) Check RAM with memtest
2) Check HDD for DMA enabled
3) Dry run lilo and see if it reports errors
4) Recompile kernel :( (I'll probably try 2.4.x and see if usb mouse works, if so then I'll use that)

duryodhan 02-04-2007 01:18 PM

The fact that it is hangin on boot.......... shows there is something wrong on your kernel compilation. Seriously, stay away from huge26.s!!! I use it only when I want to find out what modules I need for specific hardware. Just recompile kernel (it hardly takes 15-20 mins) and it will save you many many hours if you configure it correctly.
If you don't want to recompile the kernel, use 2.6.18 kernel packages from the DVD/testing.

Changing the boot scripts won't make any difference in above.

But anyways , see my thread http://www.linuxquestions.org/questi...d.php?t=499631 . There is a pretty long discussion there , I got my boot-up time right now to 25 secs which is pretty okay (and I have included all of what I need).


Prefer 2.6 for kernel recompilation, no need to make dependencies etc. (much much easier).

to check for dma : hdparm /dev/hda | gerp dma

And btw, you used the word "optimize", that can only be done with kernel recompile. Other methods may just reduce no. of services etc.(like sendmail/httpd/mysqld)

H_TeXMeX_H 02-04-2007 02:38 PM

Quote:

Originally Posted by duryodhan
But anyways , see my thread http://www.linuxquestions.org/questi...d.php?t=499631 . There is a pretty long discussion there , I got my boot-up time right now to 25 secs which is pretty okay (and I have included all of what I need).

Thanks for the link, I'll go through it later today and see what I can do.

Ok, I'll recompile the kernel. Only one question ... this is a laptop, and I don't know much about the hardware inside, I only have what standard hardware probing commands can provide. How would I go about compiling a kernel with only exactly what I need compiled in ? Is there any way to get specific info, or as much info as I need on the hardware of this computer and which parts of the kernel go with which hardware ? (I had problems doing this the last time I wanted to compile a minimal kernel like this ... I must have left some things out or put other things in)

H_TeXMeX_H 02-04-2007 04:01 PM

Update: thanks again for that link and info ... that literally cut my boot time in half ... about 20 sec now :D (ok, more like 38 sec (because it must load hplip and nvidia kernel module otherwise it would be less than 30 sec), but it's a lot faster than before ... it took about 1 min + before)

What I did was move '/sbin/ldconfig' and '/usr/X11R6/bin/fc-cache' calls from 'rc.M' to 'rc.local_shutdown' ... does the same thing really, only at shutdown not startup. Also commented out 'atd' and 'gpm' as they take long to startup and I rarely use them, if I need them I start them manually. Made hotplug un-executable as it is not really needed by anything. And I put an '&' after dhcpcd call, which was also a slow starter ... seems to work just fine (and I see no reason why it shouldn't ... I don't care when it sorts out my dynamic IP, it's probably gonna be before I use the internet anyway). Now for the kernel ...

pdw_hu 02-04-2007 06:31 PM

Quote:

Originally Posted by H_TeXMeX_H
I only have what standard hardware probing commands can provide. How would I go about compiling a kernel with only exactly what I need compiled in?

First part: lspci, lsusb, dmesg. These command will tell you more than you want to know about hardware. You can just google for the hardware name for the correct drivername.

Second: For options not related to drivers it's basicly googleing, and trial and error. Read the help available during menuconfig. Those "if unsure say Y/N" messages are really helpful for newbs.

H_TeXMeX_H 02-04-2007 06:44 PM

ok, thanks ... seems like it's gonna take a while to get down exactly what I need ... well, I'll work on it when I have time and tweak it until I get it ... seems that's the only way.

Thank you all for your responses :D

GrapefruiTgirl 02-04-2007 06:56 PM

Also, look up the exact motherboard model number by Google, check out the hardware it comes with.
Use the 'compact' option in LILO if your system will allow it.
and third, append 'idebus=66' into your LILO as well, if you see in dmesg "assuming idebus is 33Mhz" and you know that your IDE bus can go faster than that.
When I changed my IDE bus to boot at 66Mhz, it lopped better than 60% off by boot time.

H_TeXMeX_H 02-04-2007 07:07 PM

Quote:

Originally Posted by GrapefruiTgirl
Also, look up the exact motherboard model number by Google, check out the hardware it comes with.

It's a laptop ... so how do I get the MB number ? I can't open it ... it'll fall apart :(

Quote:

Use the 'compact' option in LILO if your system will allow it.
and third, append 'idebus=66' into your LILO as well, if you see in dmesg "assuming idebus is 33Mhz" and you know that your IDE bus can go faster than that.
When I changed my IDE bus to boot at 66Mhz, it lopped better than 60% off by boot time.
Not sure about compact, but I feel the 'idebus=xxx" might be a tad unsafe. Especially without detailed info on my system.

But good news, I recomplied my kernel and now it's 1/3 the size it was before ... 1MB as opposed to 3MB. This greatly increases boot up time. Now the entire boot process takes 45 sec from the time I hit the on button. I feel that maybe I can get it even lower, but that maybe the time invested it such an action may be too much right now. Maybe during spring break or the summer I'll mess around with it.

duryodhan 02-04-2007 09:01 PM

for compiling your kernel and about how to check your hardware etc. etc. see :
http://www.kroah.com/lkn/

And also look at Shilo's guide - Making it scream.


All times are GMT -5. The time now is 12:04 PM.