Linux Programmer | RHCE | RHCSA

Search This Blog

Diagnose and fix slow boot on ubuntu.

Method 1 :

very slow boot on Ubuntu to update GRUB so it passes this option to the kernel automatically on boot:


Edit the file

/etc/default/grub
so that string noresume is included in the
GRUB_CMDLINE_LINUX_DEFAULT
line, for example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume"
Run this command to update GRUB:
sudo update-grub
Reboot machine

Method 2 :

Try from “No splash screen to Kernel” to find which processes are taking the most time for booting.

A start job is running for Raise network interfaces (1min 20s / 6min 20s)

So, we need to reduce time for this process to save boot time. To do so,

You have to edit,
sudo nano /etc/systemd/system/network-online.target.wants/networking.service
Find,
TimeoutStartSec=5min
Change to,
TimeoutStartSec=5s
and
reboot

Method 3 :

You can configure the timeout for Start Job and Stop Jobs.

Edit /etc/systemd/system.conf with elevated privileges and change/add two lines that are commented by default from 90 seconds to 5 (or whatever you prefer) and uncomment it:
from:
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
to:
DefaultTimeoutStartSec=5s
DefaultTimeoutStopSec=5s
After that, apply the changes by update your initramfs with the command:
sudo update-initramfs -u

Method 4 :

Diagnose and fix very slow boot on Ubuntu Using fsck Disk Check

Remove
fsck.mode=skip
from
/etc/default/grub
,and do
sudo update-grub

check your file system first    1. Live boot your Ubuntu machine
    2. open a terminal
    3.
sudo fdisk -l


    4. identify the /dev/sdXX device name for your “Linux Filesystem”
    5. type ,
    sudo fsck -f /dev/sdXX
        replacing sdXX with the number you found earlier
    6. repeat the fsck command if there were errors
    7. reboot

No comments:

Post a Comment

SSH not working with password after upgrade ubuntu 22.04 or above

In recent upgrade of ubuntu 22.04 and above we are not able to login server with SSH password. but when we try to login with key then it all...