What is dev-sda.device in systemd-analyze, can i disable it?

Solution 1:

You can't disable it, because /dev/sda7 is where your root partition is mounted. In systemd, everything that it can handle while booting is made into a systemd unit. Then you can do things with it (like track timings in this case, or depend on it for services). In the cases of devices, the chain goes like this:

  • the kernel loads the device and activates it
  • systemd watches for this and creates the /dev/sdxy nodes for it
  • then systemd activates the various mount units generated from fstab
  • which then triggers various other services which were waiting for filesystems to be mounted
  • and so on

This does allow you to identify that the disk is slow to activate, but unless you can get a new disk, there's not much you can do about it.

You can try analysing the critical path and see if there's anything else you can fix:

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.

Example:

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

For example, in my case the network is slowing startup.