A living page, mostly for my own reference of how to debug slow Ubuntu boot times view full post
Created with chatgpt + my own notes.
System Analysis
-
Check Boot Time:
- Use
systemd-analyze
to see the total boot time. - Use
systemd-analyze blame
to see which services take the longest to start. - Use
systemd-analyze critical-chain
to understand the critical path.
- Use
-
Check Boot Logs:
- Review the logs with
journalctl -b
to identify errors and warnings.
- Review the logs with
Hardware and BIOS/UEFI
-
Update BIOS/UEFI:
- Ensure your BIOS/UEFI is up to date.
- Check BIOS/UEFI settings for any boot-related options (e.g., Fast Boot).
-
Check Hardware:
- Ensure all hardware components (RAM, SSD/HDD) are functioning correctly.
Services and Applications
-
Disable Unnecessary Services:
- Use
systemctl disable <service>
to disable unneeded services. - Use
systemctl mask <service>
to prevent services from starting.
- Use
-
Remove Unnecessary Applications:
- Use
sudo apt-get remove <application>
to uninstall unneeded applications. - Use
sudo apt-get purge <application>
for a thorough cleanup.
- Use
File System and Storage
-
Check Disk Usage:
- Use
df -h
to check for any partitions that are almost full. - Use
du -sh /path/to/directory
to find large files and directories.
- Use
-
Optimize File System:
- Use
sudo e4defrag /
for ext4 file system defragmentation. - Use
sudo tune2fs -O fast_commit /dev/sdX
for ext4 optimizations.
- Use
-
Check for Disk Errors:
- Use
sudo fsck /dev/sdX
to check and repair filesystem errors.
- Use
Kernel and Drivers
- Update Kernel and Drivers:
- Use
sudo apt-get update
andsudo apt-get upgrade
to ensure you have the latest updates. - Use
ubuntu-drivers autoinstall
to install the recommended drivers.
- Use
Startup and Grub
-
Optimize GRUB:
- Edit
/etc/default/grub
and setGRUB_TIMEOUT
to a lower value (e.g., 2 seconds). - Run
sudo update-grub
after making changes.
- Edit
-
Reduce Kernel Load:
- In
/etc/default/grub
, addquiet splash
toGRUB_CMDLINE_LINUX_DEFAULT
for a quieter boot.
- In
Swap and Memory
-
Optimize Swap Usage:
- Adjust
vm.swappiness
in/etc/sysctl.conf
to a lower value (e.g., 10).
- Adjust
-
Check Memory Usage:
- Use
free -h
to check RAM usage. - Use
top
orhtop
to monitor active processes and their memory consumption.
- Use
Network and Connectivity
-
Disable Unused Network Services:
- Disable services like
NetworkManager-wait-online.service
if not needed. - Use
systemctl disable NetworkManager-wait-online.service
.
- Disable services like
-
Optimize Network Settings:
- Edit
/etc/network/interfaces
to configure network interfaces for faster boot.
- Edit
Miscellaneous
-
Disable Unused TTYs:
- Edit
/etc/systemd/logind.conf
and setNAutoVTs=1
.
- Edit
-
Use a Lightweight Desktop Environment:
- Consider switching to a lighter desktop environment like Xfce or LXDE.
-
Profile Your Boot:
- Use
systemd-analyze plot > bootchart.svg
to create a visual representation of the boot process.
- Use
Regular Maintenance
-
Clean Package Cache:
- Use
sudo apt-get clean
to clear the package cache.
- Use
-
Remove Old Kernels:
- Use
sudo apt-get autoremove
to remove old kernel versions.
- Use
Comments
I have not configured comments for this site yet as there doesn't seem to be any good, free solutions. Please feel free to email, or reach out on social media if you have any thoughts or questions. I'd love to hear from you!