Reduce boot time in X86 arch

I am using GENERIC configuration kernel.
With that kernel FreeBSD is taking 28sec to boot from boot0 to entire control switch to user.
I striped off auto boot by specifying #autoboot_wait="0" in loader.conf file.
Even-though it is taking 28sec .
Please help me to reduce the booting time further, probable less-than 10sec.

Thanks in advance
 
Boot time depends on 2 things.
1)Number of devices on system that need probing.
2)Speed of /root storage device in loading modules into memory.

For #1 On my server board I have 48CPU's. Because of this it takes much longer to boot up.
Serverboards typically have many PCI devices and buses. They all take longer to setup.

#2 - You can defiantly decrease your boot time with a fast disk subsystem.
 
I don't think a kernel slimming really makes a system boot much quicker. Kernel is only ~28MB but look at all the modules.
Another area to start with is services. Do you really need vi-recover.
Checkout running services with service -e. All have a knob in /etc/rc.conf to disable.
Checkout the prototype in /etc/default/rc.conf
 
Most servers spend a LOT of time in POST initializing SAS/SATA cards and such. This alone takes more time than loading the biggest, fattest kernel you could possible have.
 
Just out of interest, is there a facility within FreeBSD which show how long it takes to boot? ie can you set some sort of automatic timer?
 
Strip the kernel, remove all non-essential devices. Load additional modules with kld_list in rc.conf. Set the interface to DHCP instead of SYNCDHCP.

What kind of disk does the NUC have? If it's a relatively slow 5400 RPM 2.5" disk you could replace that with an SSD.

There isn't anything more you can do to speed things up.
 
Boot time depends on 2 things.
1)Number of devices on system that need probing.
2)Speed of /root storage device in loading modules into memory.

For #1 On my server board I have 48CPU's. Because of this it takes much longer to boot up.
Serverboards typically have many PCI devices and buses. They all take longer to setup.

#2 - You can defiantly decrease your boot time with a fast disk subsystem.
Number of devices on system that need probing:
I commented most of the device which is not needed for Intel NUC platform
If I run buildworld and buildkernel for that config file, in the destination directory I am not seeing all the file in /etc folder, so that I am unable to boot newly configured kernel in other plaform. It is asking for some files for eg: rc.subr.
 
Strip the kernel, remove all non-essential devices. Load additional modules with kld_list in rc.conf. Set the interface to DHCP instead of SYNCDHCP.

What kind of disk does the NUC have? If it's a relatively slow 5400 RPM 2.5" disk you could replace that with an SSD.

There isn't anything more you can do to speed things up.
In NUC
already I am using SSD
 
If I run buildworld and buildkernel for that config file, in the destination directory I am not seeing all the file in /etc folder, so that I am unable to boot newly configured kernel in other plaform. It is asking for some files for eg: rc.subr.
Files in /etc/ are not installed with install{kernel,world}. You need to use mergemaster(8) for that.
 
Files in /etc/ are not installed with install{kernel,world}. You need to use mergemaster(8) for that.
If I kernel install{kernel, world} command.
It is ending with an error called install symboliclink -> c ../POSIX no such file or directory (in some path it is serching for POSIX file, sorry i forgot that path)
I can't run that command successfully
 
It's not a specific command. The correct procedure to do a source update is:
Code:
cd /usr/src
make clean
make buildworld buildkernel
make installkernel
(reboot to single user mode)
mergemaster -p
make installworld
mergemaster -U
(reboot)
 
Just out of interest, is there a facility within FreeBSD which show how long it takes to boot? ie can you set some sort of automatic timer?
I am searching for that facility also, but still I didn't find any solution for RTC
I am using my phone to calculate time, it is an approximate time
 
It's not a specific command. The correct procedure to do a source update is:
Code:
cd /usr/src
make clean
make buildworld buildkernel
make installkernel
(reboot to single user mode)
mergemaster -p
make installworld
mergemaster -U
(reboot)
This is the procedure to build kernel in own pc. If I reboot, our newly build kernel will upon run. But I need to run that in different platform
If I need to build kernel for different platform, whether I need to specify any destination directory ?
If I specify that destination directory , is that enough to run newly build kernel successfully?
 
What exactly do you mean by "different platform"? Different architecture? Or just a another machine (but the same architecture as the build server)?
 
It's not a specific command. The correct procedure to do a source update is:
Code:
cd /usr/src
make clean
make buildworld buildkernel
make installkernel
(reboot to single user mode)
mergemaster -p
make installworld
mergemaster -U
(reboot)
I created a directory in /root called geskern
I executed command %make TARGET_ARCH=amd64 KERNCONF=GESKERN DESTDIR=/root/geskern buildworld buildkernel installkernel
until this command, it executes fine.

In above procedure, next step is to reboot and enter into the single user mood and execute mergemaster -p
If I do this, whethter it will after the host system or it will affect only the DESTINATION directory, which I specified while building?
 
In my experience, the biggest hang-ups during the boot procedure is typically large number of CPUS/cores, (in the past) large amount of memory, number of disk controllers/drives, followed by network initialization (more so when connect to Cisco switch with spanning-tree enabled). I imagine a fully spec'd Intel NUC with 8G DDR3-1600 and one SSD drive, probably gets from BIOS to network init pretty darn fast (even with GENERIC kernel) and hangs up there for 10-15 seconds. Would be curious if things improve if you try a booting with a blank or stripped down /etc/rc.conf.
 
Back
Top