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-analyzeto see the total boot time. - Use
systemd-analyze blameto see which services take the longest to start. - Use
systemd-analyze critical-chainto understand the critical path.
- Use
-
Check Boot Logs:
- Review the logs with
journalctl -bto 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 -hto check for any partitions that are almost full. - Use
du -sh /path/to/directoryto find large files and directories.
- Use
-
Optimize File System:
- Use
sudo e4defrag /for ext4 file system defragmentation. - Use
sudo tune2fs -O fast_commit /dev/sdXfor ext4 optimizations.
- Use
-
Check for Disk Errors:
- Use
sudo fsck /dev/sdXto check and repair filesystem errors.
- Use
Kernel and Drivers
- Update Kernel and Drivers:
- Use
sudo apt-get updateandsudo apt-get upgradeto ensure you have the latest updates. - Use
ubuntu-drivers autoinstallto install the recommended drivers.
- Use
Startup and Grub
-
Optimize GRUB:
- Edit
/etc/default/gruband setGRUB_TIMEOUTto a lower value (e.g., 2 seconds). - Run
sudo update-grubafter making changes.
- Edit
-
Reduce Kernel Load:
- In
/etc/default/grub, addquiet splashtoGRUB_CMDLINE_LINUX_DEFAULTfor a quieter boot.
- In
Swap and Memory
-
Optimize Swap Usage:
- Adjust
vm.swappinessin/etc/sysctl.confto a lower value (e.g., 10).
- Adjust
-
Check Memory Usage:
- Use
free -hto check RAM usage. - Use
toporhtopto monitor active processes and their memory consumption.
- Use
Network and Connectivity
-
Disable Unused Network Services:
- Disable services like
NetworkManager-wait-online.serviceif not needed. - Use
systemctl disable NetworkManager-wait-online.service.
- Disable services like
-
Optimize Network Settings:
- Edit
/etc/network/interfacesto configure network interfaces for faster boot.
- Edit
Miscellaneous
-
Disable Unused TTYs:
- Edit
/etc/systemd/logind.confand 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.svgto create a visual representation of the boot process.
- Use
Regular Maintenance
-
Clean Package Cache:
- Use
sudo apt-get cleanto clear the package cache.
- Use
-
Remove Old Kernels:
- Use
sudo apt-get autoremoveto 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!