Systemd 长启动

Systemd 长启动

我有一台 Dell Latitude 6440 -intel i5-4310 笔记本电脑,8GB RAM 磁盘 - SSD。SD 卡上的系统 - Ubuntu Mate 18.04.3 内核 5.2.8。带有加密分区 /home。

系统分析如下所示:

Startup finished in
   8.807s (firmware) + 30.926s (loader)  
 + 3.776s (kernel)   + 32.108s (userspace)  
= 1min 15.618s  

graphical.target reached after 32.101s in userspace

它负责什么? loader + 30,926s 是什么?
如何加快速度?

$systemd-analyze critical-chain
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 @14.312s  
└─lightdm.service @12.694s +1.617s  
  └─systemd-user-sessions.service @12.671s +13ms  
    └─network.target @12.670s  
      └─NetworkManager.service @10.163s +2.505s  
        └─dbus.service @9.653s  
          └─basic.target @9.641s  
            └─sockets.target @9.641s  
              └─dbus.socket @9.638s  
                └─sysinit.target @9.623s  
                  └─apparmor.service @9.423s +198ms  
                    └─local-fs.target @9.420s  
                      └─home-groszek-.cache.mount @9.416s +3ms  
                        └─home.mount @9.386s +16ms  
                          └─systemd-fsck@dev-mapper-mmcblk0p8_crypt.service @9.3  
                            └─dev-mapper-mmcblk0p8_crypt.device @9.365s  
$ lsblk
NAME                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0                 7:0    0  71,7M  1 loop  /snap/software-boutique/31
loop1                 7:1    0    16K  1 loop  /snap/software-boutique/39
loop2                 7:2    0  88,7M  1 loop  /snap/core/7396
loop3                 7:3    0  88,5M  1 loop  /snap/core/7270
loop4                 7:4    0   7,9M  1 loop  /snap/pulsemixer/23
loop5                 7:5    0   7,9M  1 loop  /snap/pulsemixer/250
loop6                 7:6    0  87,3M  1 loop  /snap/ubuntu-mate-welcome/220
loop7                 7:7    0  86,3M  1 loop  /snap/ubuntu-mate-welcome/335
sda                   8:0    0 298,1G  0 disk  
├─sda1                8:1    0  39,2M  0 part  
├─sda2                8:2    0  13,8G  0 part  
├─sda3                8:3    0 226,3G  0 part  /media/OS
└─sda4                8:4    0    58G  0 part  
sr0                  11:0    1  1024M  0 rom   
mmcblk0             179:0    0  59,5G  0 disk  
├─mmcblk0p1         179:1    0   285M  0 part  /boot/efi
├─mmcblk0p2         179:2    0     1K  0 part  
├─mmcblk0p5         179:5    0   6,1G  0 part  /
├─mmcblk0p6         179:6    0  15,9G  0 part  /usr
├─mmcblk0p7         179:7    0   6,1G  0 part  /var
└─mmcblk0p8         259:0    0  31,3G  0 part  
  └─mmcblk0p8_crypt 25If you know how to solve this, please leave your comment, I really appreciate it!3:0    0  31,3G  0 crypt /home
zram0               252:0    0   985M  0 disk  [SWAP]
zram1               252:1    0   985M  0 disk  [SWAP]
zram2               252:2    0   985M  0 disk  [SWAP]
zram3               252:3    0   985M  0 disk  [SWAP]
$ sudo hdparm -tT /dev/mmcblk0
/dev/mmcblk0:
 Timing cached reads:   13722 MB in  2.00 seconds = 6873.86 MB/sec
 Timing buffered disk reads:  70 MB in  3.08 seconds =  22.74 MB/sec

答案1

基准测试的hdparm读取速度非常慢

$sudo hdparm -tT /dev/mmcblk0
...
Timing buffered disk reads:  70 MB in  3.08 seconds =  22.74 MB/sec

因此,22 MB/秒是一个瓶颈。还请考虑这是连续读取速度,而随机访问的实际速度可能更慢。加密也可能会降低速度。
内部 HDD 目前的额定速度为 150 MB/秒,而 SSD 的额定速度为 >500 MB/秒。

考虑使用以下选项之一:

  • 购买具有 Class 10 和 UHS I(或 UHS III)等级的更快的 SD 卡 - 例如三星 PRO 或 PRO Plus;
  • 购买快速 USB 闪存 - 例如 ADATA UE700 或 Sandisk Extreme;
  • 购买 2.5 英寸 SATA / mSATA / M.2 SSD(我不太清楚您的笔记本电脑的内部结构),容量约为 512 GB,并在 Windows 分区后将 Ubuntu 移动到它。

相关内容