优化Ubuntu文件系统启动速度可从以下方面入手:
减少文件系统检查
/etc/fstab,将文件系统检查频率设为0(如UUID=xxxx / ext4 defaults,noatime,discard 0 0),或使用fsck.mode=skip参数跳过检查。sudo systemctl disable systemd-fsck-root.service。优化挂载选项
noatime或relatime挂载选项减少磁盘写入(适用于/etc/fstab)。利用SSD特性
sudo systemctl enable fstrim.timer,并在/etc/fstab中添加discard选项。调整内核参数
/etc/default/grub,添加fsck.mode=skip或优化initramfs参数,更新GRUB后生效。vm.swappiness值(如设为10),减少交换分区使用频率。精简启动项
sudo systemctl disable <服务名>(如蓝牙、打印机服务)。gnome-tweaks)管理用户级启动项。清理系统资源
sudo apt autoremove --purge。sudo journalctl --vacuum-size 100M。注意:操作前建议备份重要数据,部分优化(如跳过文件系统检查)需谨慎使用,确保系统稳定性。