GNU/Linux >> Linux の 問題 >  >> Ubuntu

Dev-sda.device Systemd-analyzeで、無効にできますか?

ラップトップにWindowsと一緒にUbuntu16.04をインストールしています。 systemd-analyze blame 「dev-sda7.device」というサービスに時間がかかりすぎています。この問題を解決する方法、または無効にする必要がありますか?

systemd-analyze timeの結果

Startup finished in 4.207s (firmware) + 4.576s (loader) + 3.466s (kernel) + 33.899s (userspace) = 46.149s

systemd-analyze blameの結果

         16.326s dev-sda7.device
         12.859s ufw.service
         11.263s systemd-tmpfiles-setup-dev.service
          7.935s NetworkManager-wait-online.service
          3.203s keyboard-setup.service
          2.736s vboxdrv.service
          2.467s accounts-daemon.service
          2.349s apache2.service
          2.239s NetworkManager.service
          2.163s ModemManager.service
          1.963s lightdm.service
          1.843s nmbd.service
          1.749s samba-ad-dc.service
          1.599s [email protected]\x2duuid-B053\x2dA56B.service
          1.367s thermald.service
          1.127s polkitd.service
          1.112s systemd-journald.service
          1.066s teamviewerd.service
          1.007s udisks2.service
           975ms apparmor.service
           926ms plymouth-start.service

cat /etc/fstabの結果

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda7 during installation
UUID=493cc833-193e-435d-840a-b862ca367fba /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=B053-A56B  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda6 during installation
UUID=a49f56b1-53c3-4eaf-9460-0a221e59957a none            swap    sw              0       0

承認された回答:

/dev/sda7のため、無効にすることはできません ルートパーティションがマウントされる場所です。 systemdでは、起動中に処理できるすべてのものがsystemdユニットになります。次に、それを使って何かを行うことができます(この場合はタイミングを追跡したり、サービスをそれに依存したりします)。デバイスの場合、チェーンは次のようになります。

  • カーネルがデバイスをロードしてアクティブ化します
  • systemdはこれを監視し、/dev/sdxyを作成します そのためのノード
  • 次に、systemdはfstabから生成されたさまざまなマウントユニットをアクティブにします
  • 次に、ファイルシステムがマウントされるのを待っていた他のさまざまなサービスをトリガーします
  • など

これにより、ディスクのアクティブ化が遅いことを特定できますが、新しいディスクを入手できない限り、それについてできることはあまりありません。

クリティカルパスを分析して、他に修正できるものがあるかどうかを確認できます。

systemd-analyze critical-chain [UNIT...]  prints a tree of the
time-critical chain of units (for each of the specified UNITs or for
the default target otherwise). 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. Note that the output might be
misleading as the initialization of one service might depend on socket
activation and because of the parallel execution of units.

例:

graphical.target @10.868s
└─multi-user.target @10.868s
  └─squid-deb-proxy.service @10.816s +51ms
    └─network-online.target @10.814s
      └─NetworkManager-wait-online.service @2.419s +8.395s
        └─NetworkManager.service @2.243s +155ms
          └─dbus.service @2.192s
            └─basic.target @2.129s
              └─sockets.target @2.129s
                └─snapd.socket @2.127s +1ms
                  └─sysinit.target @2.127s
                    └─swap.target @2.127s
                      └─dev-disk-by\x2duuid-498d24e5\x2d7755\x2d422f\x2dbe45\x2d1b78d50b44e8.swap @2.119s +7ms
                        └─dev-disk-by\x2duuid-498d24e5\x2d7755\x2d422f\x2dbe45\x2d1b78d50b44e8.device @2.119s

たとえば、私の場合、ネットワークの起動が遅くなっています。

関連:セキュアブートがオンになっている場合の「非セキュアモードでのブート」?
Ubuntu
  1. LenovoYogaでキーボードを無効および有効にする方法は?

  2. Ubuntu 16.04 –セキュアブートを無効にするにはどうすればよいですか?

  3. CentOS / RHEL 5、6 :NetworkManager を無効にする方法

  1. Ubuntu 17.10.1で起動時間が遅い(systemd-Blameの結果を分析する)?

  2. 特定のデバイスの MTP udev ルールを無効にして、USB 大容量ストレージ デバイスとしてマウントできるようにします。

  3. updatedb を無効にすることはできますか?

  1. デスクトップアクティビティモデレーターを無効にする

  2. OEL で Ksplice サービスを無効にする方法

  3. CentOS / RHEL 6:telnet サービスを無効にする方法