首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Fstrim导致较高的启动时间。

Fstrim导致较高的启动时间。
EN

Ask Ubuntu用户
提问于 2019-08-12 08:52:23
回答 1查看 5.8K关注 0票数 4

我使用Ubuntu18.04LTS,使用Win10双引导。每当我启动系统,就需要3分钟。同样在登录屏幕之前,这个东西出现了,我正在附加一个屏幕截图。

这个标志代表什么,如果这是高启动时间的原因,如何摆脱它?

这是systemd-analyze blame的输出

代码语言:javascript
复制
    3min 28.455s apport-autoreport.service
    3min 20.522s fstrim.service
         51.936s dev-sda5.device
         48.922s systemd-journal-flush.service
         40.451s apparmor.service
         38.857s binfmt-support.service
         38.828s snap-vlc-770.mount
         38.827s console-setup.service
         38.806s dns-clean.service
         38.802s qemu-kvm.service
         36.102s snap-core18-1066.mount
         31.498s snap-sublime\x2dtext-58.mount
         29.766s snap-gtk2\x2dcommon\x2dthemes-5.mount
         29.665s snap-gimp-165.mount
         29.496s snap-gtk\x2dcommon\x2dthemes-1198.mount
         29.382s snap-sublime\x2dtext-67.mount
         29.351s snap-audacity-408.mount
         10.796s mysql.service
          9.811s mpd.service
          9.269s networking.service
          6.924s NetworkManager-wait-online.service
          5.682s systemd-tmpfiles-setup-dev.service
          5.257s bolt.service

systemd-analyze critical-chain的输出:

代码语言:javascript
复制
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 10.971s
└─multi-user.target @1min 10.971s
  └─mysql.service @1min 173ms +10.796s
    └─network.target @1min 171ms
      └─wpa_supplicant.service @55.935s +2.813s
        └─dbus.service @55.884s
          └─basic.target @55.878s
            └─sockets.target @55.878s
              └─snapd.socket @55.876s +815us
                └─sysinit.target @55.735s
                  └─swap.target @55.735s
                    └─dev-disk-by\x2duuid-62ba7a95\x2d7374\x2d4862\x2daeb1\x2dc5
                      └─dev-disk-by\x2duuid-62ba7a95\x2d7374\x2d4862\x2daeb1\x2d

我检查了如何启用或禁用Apport?,做了sudo systemctl disable apport.service,现在apport-autoreport.service不在了。但是fstrim仍然需要大量的时间。我通过了https://ubuntuforums.org/showthread.php?t=2410364,但没有得到令人满意的答案。

这是磁盘分区:

代码语言:javascript
复制
If you have any advice, I would be happy to hear! Thanks!  
EN

回答 1

Ask Ubuntu用户

发布于 2019-08-12 11:58:37

禁用fstrim使用:

代码语言:javascript
复制
rm /var/lib/systemd/timers/stamp-fstrim.timer
systemctl stop fstrim.service fstrim.timer
systemctl disable fstrim.service fstrim.timer
systemctl mask fstrim.service fstrim.timer

这将从您的启动删除300万,但没有修复问题。你还得把它找出来。例如:您有交换分区吗?如果是这样的话,将其移除并将一个交换文件添加到/etc/fstab,并查看这是否是问题所在。undefined

代码语言:javascript
复制
journalctl -u fstrim

将展示一份关于fstrim的报告。

请注意,如果您这样做,您应该手动启动fstrim,并且可以用

代码语言:javascript
复制
sudo fstrim -v /
票数 4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1165128

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档