缓慢 3 分钟 + 在 Ubuntu 18.04 上启动

缓慢 3 分钟 + 在 Ubuntu 18.04 上启动

最近,我的笔记本电脑运行 Ubuntu 18.04 时,启动时间开始很长。我运行以下命令来查明原因,但不确定如何处理这些信息。非常感谢大家提出任何关于导致此问题的原因以及如何解决的想法。

systemd-分析

Startup finished in 12.018s (firmware) + 12.166s (loader) + 12.544s (kernel) + 3min 8.456s (userspace) = 3min 45.185s graphical.target reached after 3min 8.433s in userspace

systemd-analyze 责备

    3min 1.217s dev-mapper-ubuntu\x2d\x2dvg\x2droot.device
    3min 312ms dev-loop26.device
    3min 281ms dev-loop28.device
    3min 278ms dev-loop9.device
    3min 278ms dev-loop14.device
    3min 275ms dev-loop18.device
    3min 271ms dev-loop19.device
    3min 265ms dev-loop20.device
    3min 264ms dev-loop17.device
    3min 256ms dev-loop23.device
    3min 252ms dev-loop11.device
    3min 235ms dev-loop13.device
    3min 234ms dev-loop8.device
    3min 227ms dev-loop10.device
    3min 224ms dev-loop12.device
    3min 216ms dev-loop24.device
    3min 205ms dev-loop16.device
    3min 202ms dev-loop15.device
    3min 195ms dev-loop21.device
    3min 187ms dev-loop22.device
    3min 186ms dev-loop25.device
    3min 155ms dev-loop27.device
    3min 148ms dev-loop31.device
    3min 130ms dev-loop30.device
    3min 130ms dev-loop29.device
    3min 111ms dev-loop5.device
    3min 110ms dev-loop7.device
    3min 109ms dev-loop1.device
    3min 102ms dev-loop0.device
    3min 91ms dev-loop32.device
    3min 69ms dev-loop4.device
    3min 67ms dev-loop6.device
    3min 66ms dev-loop3.device
    3min 66ms dev-loop2.device
    1min 30.186s boot-efi.mount
    1min 28.881s binfmt-support.service
    1min 28.869s proc-sys-fs-binfmt_misc.mount
    6.483s NetworkManager-wait-online.service
    3.519s plymouth-quit-wait.service
    1.994s snapd.service
    1.652s [email protected]
    1.583s snap.ufw.srv.service
    765ms keyboard-setup.service
    579ms fwupd.service
    553ms ufw.service
    478ms systemd-journal-flush.service
    351ms NetworkManager.service
    314ms udisks2.service
    240ms systemd-udevd.service
    219ms networkd-dispatcher.service
    208ms snap-gnome\x2dcharacters-741.mount
    206ms upower.service
    189ms snap-core-13308.mount
    188ms snap-core-12834.mount
    185ms systemd-modules-load.service
    182ms snap-gtk2\x2dcommon\x2dthemes-13.mount
    181ms systemd-rfkill.service
    180ms snap-gnome\x2dlogs-112.mount
    180ms snap-gnome\x2d3\x2d34\x2d1804-77.mount
    178ms snap-gimp-380.mount
    174ms snap-gimp-383.mount
    174ms lvm2-monitor.service
    172ms snap-gnome\x2d3\x2d38\x2d2004-99.mount
    171ms snap-gnome\x2dcalculator-884.mount
    166ms snap-ufw-476.mount
    166ms snap-ufw-501.mount
    162ms snap-gnome\x2d3\x2d34\x2d1804-72.mount
    162ms systemd-timesyncd.service
    161ms systemd-resolved.service
    159ms snap-deja\x2ddup-552.mount
    156ms snap-bare-5.mount
    153ms snap-gnome\x2dlogs-106.mount
    152ms snap-gtk\x2dcommon\x2dthemes-1534.mount
    128ms snap-p7zip\x2ddesktop-220.mount
    127ms lvm2-pvscan@253:0.service
    126ms snap-core20-1434.mount
    125ms snap-gtk\x2dcommon\x2dthemes-1519.mount
    121ms snap-deja\x2ddup-525.mount
    115ms systemd-logind.service
    114ms apparmor.service
    110ms snap-gnome\x2d3\x2d28\x2d1804-145.mount
    105ms snap-gnome\x2dsystem\x2dmonitor-174.mount
    100ms accounts-daemon.service
    100ms snap-gnome\x2dcalculator-920.mount
    96ms snap-gnome\x2d3\x2d28\x2d1804-161.mount
    95ms thermald.service
    95ms ModemManager.service
    92ms systemd-tmpfiles-setup-dev.service
    91ms systemd-udev-trigger.service
    91ms snap-gnome\x2d3\x2d26\x2d1604-104.mount
    90ms snap-core18-2344.mount
    78ms grub-common.service
    72ms snap-gnome\x2dcharacters-761.mount
    72ms avahi-daemon.service
    71ms [email protected]
    71ms snap-gnome\x2dsystem\x2dmonitor-169.mount
    70ms rsyslog.service
    70ms snap-gnome\x2d3\x2d26\x2d1604-102.mount
    66ms gpu-manager.service
    63ms networking.service
    63ms snapd.seeded.service
    62ms wpa_supplicant.service
    62ms snap-core20-1518.mount
    60ms gdm.service
    59ms snap-gnome\x2d3\x2d38\x2d2004-106.mount
    58ms packagekit.service
    56ms [email protected]
    55ms bolt.service
    55ms systemd-journald.service
    53ms snapd.apparmor.service
    53ms [email protected]
    49ms tor.service
    49ms snap-core18-2409.mount
    49ms pppd-dns.service
    46ms apport.service
    37ms systemd-fsck@dev-disk-by\x2duuid-902B\x2d8ECC.service
    37ms bluetooth.service
    36ms speech-dispatcher.service
    30ms systemd-tmpfiles-clean.service
    29ms colord.service
    25ms systemd-random-seed.service
    24ms dev-mapper-ubuntu\x2d\x2dvg\x2dswap_1.swap
    22ms systemd-fsck@dev-disk-by\x2duuid-9a7439b6\x2d9318\x2d4cbe\x2d8bab\x2d4c0448ac9499.service
    22ms systemd-tmpfiles-setup.service
    21ms polkit.service
    18ms systemd-sysctl.service
    15ms sys-kernel-debug.mount
    15ms plymouth-start.service
    14ms dev-hugepages.mount
    14ms blk-availability.service
    13ms kmod-static-nodes.service
    13ms systemd-remount-fs.service
    12ms plymouth-read-write.service
    12ms dev-mqueue.mount
    12ms kerneloops.service
    10ms dns-clean.service
    10ms resolvconf-pull-resolved.service
    8ms openvpn.service
    8ms systemd-backlight@backlight:intel_backlight.service
    8ms boot.mount
    7ms systemd-user-sessions.service
    6ms ureadahead-stop.service
    6ms systemd-update-utmp.service
    5ms resolvconf.service
    5ms systemd-backlight@leds:dell::kbd_backlight.service
    5ms systemd-update-utmp-runlevel.service
    4ms sys-kernel-config.mount
    4ms console-setup.service
    3ms systemd-cryptsetup@sda3_crypt.service
    3ms sys-fs-fuse-connections.mount
    3ms rtkit-daemon.service
    2ms setvtrgb.service
    1ms motd-news.service
    1ms snapd.socket

systemd-analyze 关键链

graphical.target @3min 8.433s
└─multi-user.target @3min 8.433s
  └─kerneloops.service @3min 8.420s +12ms
    └─network-online.target @3min 8.419s
      └─NetworkManager-wait-online.service @3min 1.935s +6.483s
        └─NetworkManager.service @3min 1.578s +351ms
          └─dbus.service @3min 1.553s
            └─basic.target @3min 1.523s
              └─sockets.target @3min 1.523s
                └─snapd.socket @3min 1.520s +1ms
                  └─sysinit.target @3min 1.501s
                    └─systemd-backlight@leds:dell::kbd_backlight.service @3min 1.625s +5ms
                      └─system-systemd\x2dbacklight.slice @956ms
                        └─system.slice @257ms
                          └─-.slice @254ms

lsblk

NAME                   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0                    7:0    0 113.9M  1 loop  /snap/core/13308
loop1                    7:1    0 110.6M  1 loop  /snap/core/12834
loop2                    7:2    0   724K  1 loop  /snap/ufw/501
loop3                    7:3    0   556K  1 loop  /snap/gnome-logs/112
loop4                    7:4    0   724K  1 loop  /snap/ufw/476
loop5                    7:5    0 248.8M  1 loop  /snap/gnome-3-38-2004/99
loop6                    7:6    0     4K  1 loop  /snap/bare/5
loop7                    7:7    0   2.5M  1 loop  /snap/gnome-calculator/884
loop8                    7:8    0  81.3M  1 loop  /snap/gtk-common-themes/1534
loop9                    7:9    0 162.9M  1 loop  /snap/gnome-3-28-1804/145
loop10                   7:10   0 164.8M  1 loop  /snap/gnome-3-28-1804/161
loop11                   7:11   0   219M  1 loop  /snap/gnome-3-34-1804/72
loop12                   7:12   0 251.5M  1 loop  /snap/deja-dup/552
loop13                   7:13   0   2.5M  1 loop  /snap/gnome-system-monitor/174
loop14                   7:14   0  65.2M  1 loop  /snap/gtk-common-themes/1519
loop15                   7:15   0  61.9M  1 loop  /snap/core20/1434
loop16                   7:16   0   704K  1 loop  /snap/gnome-characters/761
loop17                   7:17   0 140.7M  1 loop  /snap/gnome-3-26-1604/104
loop18                   7:18   0 140.7M  1 loop  /snap/gnome-3-26-1604/102
loop19                   7:19   0 391.3M  1 loop  /snap/gimp/383
loop20                   7:20   0   219M  1 loop  /snap/gnome-3-34-1804/77
loop21                   7:21   0  55.5M  1 loop  /snap/core18/2409
loop22                   7:22   0  61.9M  1 loop  /snap/core20/1518
loop23                   7:23   0 254.1M  1 loop  /snap/gnome-3-38-2004/106
loop24                   7:24   0  55.5M  1 loop  /snap/core18/2344
loop25                   7:25   0   2.5M  1 loop  /snap/gnome-system-monitor/169
loop26                   7:26   0 101.5M  1 loop  /snap/p7zip-desktop/220
loop27                   7:27   0   2.6M  1 loop  /snap/gnome-calculator/920
loop28                   7:28   0   193M  1 loop  /snap/deja-dup/525
loop29                   7:29   0   548K  1 loop  /snap/gnome-logs/106
loop30                   7:30   0   140K  1 loop  /snap/gtk2-common-themes/13
loop31                   7:31   0   277M  1 loop  /snap/gimp/380
loop32                   7:32   0   704K  1 loop  /snap/gnome-characters/741
sda                      8:0    0 238.5G  0 disk  
├─sda1                   8:1    0   512M  0 part  /boot/efi
├─sda2                   8:2    0   732M  0 part  /boot
└─sda3                   8:3    0 237.3G  0 part  
  └─sda3_crypt         253:0    0 237.3G  0 crypt 
    ├─ubuntu--vg-root  253:1    0 236.3G  0 lvm   /
    └─ubuntu--vg-swap_1
                       253:2    0   976M  0 lvm   [SWAP]
sr0                     11:0    1  1024M  0 rom

smartctl -a /dev/sda3

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-188-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     SK hynix SC311 SATA 256GB
Serial Number:    MJ7BN47031120BC3Y
Firmware Version: 70000P10
User Capacity:    256,060,514,304 bytes [256 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Tue Jun 28 12:29:34 2022 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x05) Offline data collection activity
                    was aborted by an interrupting command from host.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (  24) The self-test routine was aborted by
                    the host.
Total time to complete Offline 
data collection:        (   12) seconds.
Offline data collection
capabilities:            (0x51) SMART execute Offline immediate.
                    No Auto Offline data collection support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0002) Does not save SMART data before
                    entering power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    (  40) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 0
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   166   166   006    Pre-fail  Always       -       0
  5 Reallocated_Sector_Ct   0x0032   253   253   036    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       1166
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       1117
100 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       664146
168 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       5
169 Unknown_Attribute       0x0032   097   097   000    Old_age   Always       -       60
174 Unknown_Attribute       0x0030   100   100   000    Old_age   Offline      -       26
175 Program_Fail_Count_Chip 0x0032   253   253   000    Old_age   Always       -       0
176 Erase_Fail_Count_Chip   0x0032   253   253   000    Old_age   Always       -       0
177 Wear_Leveling_Count     0x0032   099   001   000    Old_age   Always       -       23
178 Used_Rsvd_Blk_Cnt_Chip  0x0032   253   253   000    Old_age   Always       -       0
179 Used_Rsvd_Blk_Cnt_Tot   0x0032   253   253   000    Old_age   Always       -       0
180 Unused_Rsvd_Blk_Cnt_Tot 0x0032   100   100   000    Old_age   Always       -       686
181 Program_Fail_Cnt_Total  0x0032   253   253   000    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   253   253   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   253   253   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   253   253   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       1
194 Temperature_Celsius     0x0002   033   013   000    Old_age   Always       -       33 (Min/Max 13/46)
195 Hardware_ECC_Recovered  0x0032   253   253   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   253   253   036    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0032   253   253   000    Old_age   Always       -       0
199 UDMA_CRC_Error_Count    0x0032   253   253   000    Old_age   Always       -       0
204 Soft_ECC_Correction     0x000e   100   001   000    Old_age   Always       -       648
212 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       15383
233 Media_Wearout_Indicator 0x0032   002   001   000    Old_age   Always       -       99
234 Unknown_Attribute       0x0032   100   100   000    Old_age   Always       -       12198856384
241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       11661457212
242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       8297361734

SMART Error Log Version: 0
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               80%       952         -
# 2  Short offline       Aborted by host               80%       762         -
# 3  Short offline       Aborted by host               90%         5         -
# 4  Short offline       Completed without error       00%         5         -
# 5  Short offline       Completed without error       00%         1         -

Warning! SMART Selective Self-Test Log Structure error: invalid SMART checksum.
SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN             MIN_LBA             MAX_LBA  CURRENT_TEST_STATUS
    1                   0                   0  Not_testing
    2                   0                   0  Not_testing
    3                   0                   0  Not_testing
    4                   0                   0  Not_testing
    5                   0                   0  Not_testing
10319  194035862013744762  194035862013810297  Read_scanning was aborted by an interrupting command from host
Selective self-test flags (0xca6e):
  Read-scan of remainder of disk interrupted; will resume 13751 min after power-up.
If Selective self-test is pending on power-up, resume after 13751 minute delay.

相关内容