결과

결과

내 시스템에 다음 구성이 설치되어 있습니다.

mercurial@providence:~$ neofetch
       _,met$$$$$gg.          mercurial@providence 
    ,g$$$$$$$$$$$$$$$P.       -------------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 10 (buster) x86_64 
 ,$$P'              `$$$.     Host: XPS L501X A08 
',$$P       ,ggs.     `$$b:   Kernel: 4.19.0-6-amd64 
`d$$'     ,$P"'   .    $$$    Uptime: 7 mins 
 $$P      d$'     ,    $$P    Packages: 2883 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.0.3 
 $$;      Y$b._   _,d$P'      Resolution: 1366x768 
 Y$$.    `.`"Y$$$$P"'         DE: MATE 
 `$$b      "-.__              WM: Metacity (Marco) 
  `Y$$                        WM Theme: TraditionalOk 
   `Y$$.                      Theme: Clearlooks [GTK2/3] 
     `$$b.                    Icons: gnome [GTK2/3] 
       `Y$$b.                 Terminal: mate-terminal 
          `"Y$b._             Terminal Font: Monospace 10 
              `"""            CPU: Intel i5 M 460 (4) @ 2.534GHz 
                              GPU: NVIDIA GeForce GT 420M 
                              GPU: Intel Core Processor 
                              Memory: 1062MiB / 3683MiB 




mercurial@providence:~$ uname -a
Linux providence 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

이제 문제는 시스템 시작 시간이 너무 길다는 것입니다. 다음은 시작 플롯입니다.

mercurial@providence:~$ systemd-analyze
Startup finished in 38.520s (kernel) + 26.496s (userspace) = 1min 5.017s 
graphical.target reached after 26.478s in userspace

https://svgshare.com/i/FNK.svg

몇 가지 문제를 해결하려고 노력했지만 들어갈 수 없었습니다.

내 시작 로그는 다음과 같습니다.

Gave up waiting for suspend/resume device
Debian: clean, 934549/7528448 files, 9966424/30091008 blocks
[  OK  ] Started Set console font and keymap.
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Network Time Synchronization...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started udev Kernel Device Manager.
         Starting Show Plymouth Boot Screen...
[  OK  ] Started Load AppArmor profiles.
         Starting Raise network interfaces...
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Started Forward Password Requests to Plymouth Directory Watch.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Created slice system-systemd\x2dbacklight.slice.
         Starting Load/Save Screen Backlight Brightness of backlight:intel_backlight...
[  OK  ] Started Load/Save Screen Backlight Brightness of backlight:intel_backlight.
[  OK  ] Started Raise network interfaces.
         Starting Load/Save Screen Backlight Brightness of leds:dell::kbd_backlight...
[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
[  OK  ] Started Load/Save Screen Backlight Brightness of leds:dell::kbd_backlight.
         Starting Load/Save RF Kill Switch Status...
[  OK  ] Started Load/Save RF Kill Switch Status.
         Starting Show Plymouth Boot Screen...
         Starting Tell Plymouth To Write Out Runtime Data...
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Show Plymouth Boot Screen.
         Starting Tell Plymouth To Write Out Runtime Data...
         Starting Show Plymouth Boot Screen...
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Found device ST9500420AS 7.
         Activating swap /dev/disk/by-uuid/c0198c37-f28b-41f5-bb0f-37d575e86896...
[  OK  ] Activated swap /dev/disk/by-uuid/c0198c37-f28b-41f5-bb0f-37d575e86896.
[  OK  ] Reached target Swap.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Trigger anacron every hour.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on CUPS Scheduler.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started CUPS Scheduler.
[  OK  ] Reached target Paths.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Started Daily man-db regeneration.
[  OK  ] Listening on UUID daemon activation socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started CUPS Scheduler.
[  OK  ] Started Manage Sound Card State (restore and store).
         Starting Save/Restore Sound Card State...
         Starting System Logging Service...
[  OK  ] Started Run anacron jobs.
         Starting Bluetooth service...
         Starting Avahi mDNS/DNS-SD Stack...
[  OK  ] Started Regular background program processing daemon.
         Starting Modem Manager...
         Starting Accounts Service...
         Starting Restore /etc/resolv.conf if the system crashed before the ppp link was shut down...
         Starting Deferred execution scheduler...
         Starting Disk Manager...
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Manager...
         Starting WPA supplicant...
         Starting Login Service...
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Started System Logging Service.
[  OK  ] Started Save/Restore Sound Card State.
[  OK  ] Started Restore /etc/resolv.conf if the system crashed before the ppp link was shut down.
[  OK  ] Started Deferred execution scheduler.
[  OK  ] Started Login Service.
[  OK  ] Started WPA supplicant.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[  OK  ] Started Bluetooth service.
[  OK  ] Reached target Bluetooth.
[  OK  ] Started Make remote CUPS printers available locally.
[  OK  ] Reached target Sound Card.
         Starting Authorization Manager...
         Starting Hostname Service...
[  OK  ] Started Network Manager.
         Starting Network Manager Wait Online...
[  OK  ] Reached target Network.
         Starting Permit User Sessions...
[  OK  ] Started Unattended Upgrades Shutdown.
[  OK  ] Started Permit User Sessions.
         Starting Hold until boot process finishes up...
         Starting Light Display Manager...
[  OK  ] Started Hostname Service.
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Network Manager Script Dispatcher Service.
[  OK  ] Started Authorization Manager.
[  OK  ] Started Accounts Service.

이것에 대해 조금 검색해보니 GAVE UP WAITING FOR...이것을 타겟으로 하는 사람이 있었으니 참고하시기 바랍니다.

mercurial@providence:~$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.19.0-6-amd64
cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.
update-initramfs: Generating /boot/initrd.img-4.19.0-5-amd64
cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.

그게 /dev/sda7내 스왑 파일이에요.

mercurial@providence:~$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500420AS     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc8000000

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 170128349 169921502    81G  7 HPFS/NTFS/exFAT
/dev/sda3       170144408 337927335 167782928    80G  7 HPFS/NTFS/exFAT
/dev/sda4       337930238 976769023 638838786 304.6G  f W95 Ext'd (LBA)
/dev/sda5       337930240 727652351 389722112 185.9G 83 Linux
/dev/sda6       727654400 968382463 240728064 114.8G 83 Linux
/dev/sda7       968384512 976769023   8384512     4G 82 Linux swap / Solaris


mercurial@providence:~$ ls -la /dev/disk/by-uuid
total 0
drwxr-xr-x 2 root root 160 Oct  7 23:45 .
drwxr-xr-x 7 root root 140 Oct  7 23:45 ..
lrwxrwxrwx 1 root root  10 Oct  7 23:46 129C98019C97DE13 -> ../../sda3
lrwxrwxrwx 1 root root  10 Oct  7 23:46 3D9D2B1C080C3A89 -> ../../sda2
lrwxrwxrwx 1 root root  10 Oct  7 23:46 480488312682F440 -> ../../sda1
lrwxrwxrwx 1 root root  10 Oct  7 23:46 aec68856-488a-4c50-aa05-01af59b3ae0b -> ../../sda6
lrwxrwxrwx 1 root root  10 Oct  7 23:46 c0198c37-f28b-41f5-bb0f-37d575e86896 -> ../../sda7
lrwxrwxrwx 1 root root  10 Oct  7 23:46 d96d4546-92a2-49bf-b9d0-c00348d42395 -> ../../sda5

어떻게 하면 하프당 10초 미만으로 더 빠르게 시작할 수 있나요?

답변1

기본적으로 가상 상자 내부에서 스왑을 비활성화하고 제거한 후 동일한 문제가 발생하여 UUID가 엉망이 되었습니다. 이로 인해 시간 초과 문제와 종속성 오류가 발생하고 부팅할 때마다 파일 시스템을 강제로 확인하게 됩니다. 이에 따라 UUID를 업데이트해야 합니다.

스왑 파티션이 삭제된 경우(예: 의도적으로 HD에서 SSD로 마이그레이션하는 경우) 파일이 /etc/initramfs-tools/conf.d/resume완전히 비어 있거나 읽혀져야 합니다 RESUME=. UUID 번호를 제거하세요. RESUME=NONE유효하지 않은. 스왑 사용 여부에 관계없이 해결 방법은 다음과 같습니다.

문제 해결을 위해(선택 사항):

sudo cat /var/log/boot.log

올바른 파티션 UUIDS를 나열하십시오.

sudo blkid -c /dev/null -o list

다음 세 파일이 blkid에 나열된 올바른 UUID 설정을 가지고 있는지 확인하고 올바른 UUID로 덮어씁니다.

/etc/fstab                                      [for me swap was incorrect]
/etc/default/grub                               [for me RESUME=UUID was incorrect]
/boot/grub/grub.cfg                             [for me RESUME=UUID was incorrect]

그런 다음 초기 Ram 파일 시스템을 업데이트합니다.

update-initramfs -u

위의 세 파일을 편집하면 cryptsetup: error: couldn't resolve deviceupdate-initramfs를 실행할 때 오류가 영구적으로 해결되었습니다.

이렇게 하면 에 UUID를 추가할 필요가 없지만 /etc/initramfs-tools/conf.d/resume여전히 문제가 있는 경우 다음과 같은 UUID를 추가하거나 RESUME=UUID=c0198c37-f28b-41f5-bb0f-37d575e86896스왑 RESUME=파일을 사용하지 않는 경우 설정하는 것이 좋습니다.

그런 다음 다음을 실행하십시오.

update-initramfs -u

또한 시작 프로세스 속도를 높이려면 /etc/default/grub으로 설정되어 있는지 확인하십시오 . GRUB_TIMEOUT=0여기에서 설명한 모든 내용이 끝나면 시작 시 마지막 파일 시스템 검사를 한 번 수행하지만 1분 30초가 아닌 10초 만에 부팅됩니다.

답변2

mercurial@providence:~$ systemd-analyze
Startup finished in 7.913s (kernel) + 20.621s (userspace) = 28.534s 
graphical.target reached after 20.605s in userspace

여기에 이미지 설명을 입력하세요.

몇 가지 문제를 수정한 후 얻은 결과입니다. 보시다시피 부팅 시간이 1분 5초에서 28초로 점차 줄어듭니다.

1. sudo update-initramfs -u -k all: 커널 시간

이는 찾을 수 없는 장치에서 복구하려고 한다는 큰 소리입니다. 즉, 내 시스템에 복구 블록이 있습니다.grub.cfg

cryptsetup: ERROR: Couldn't resolve device 
    UUID=fee92c6d-7b60-4014-a66b-c48cd9094162

그냥 실수일 뿐이야

cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.

이 멋진 코드 줄에서는 시스템이 복구할 수 있도록 새 스왑 파티션을 선언해야 합니다.

I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=c0198c37-f28b-41f5-bb0f-37d575e86896)
I: Set the RESUME variable to override this.

그래서 내가 그랬어,

mercurial@providence:~$ cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=c0198c37-f28b-41f5-bb0f-37d575e86896

2. systemd-analyze 문제: 사용자 공간 시간

내 네트워크 관리자가 온라인 상태가 되기까지 시간이 좀 걸리므로, 내가 해야 할 일은 그것을 차단하는 것뿐입니다.

sudo systemctl mask NetworkManager-wait-online.service

결과

이제 내 부팅 시간은 28초로 단축되었습니다. 아래는 내 책임과 중요한 체인입니다.

mercurial@providence:~$ 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 @20.605s
└─udisks2.service @9.969s +10.636s
  └─basic.target @9.515s
    └─sockets.target @9.515s
      └─dbus.socket @9.515s
        └─sysinit.target @9.333s
          └─swap.target @9.333s
            └─dev-disk-by\x2duuid-c0198c37\x2df28b\x2d41f5\x2dbb0f\x2d37d575e86896.swap @8.843s +490ms
              └─dev-disk-by\x2duuid-c0198c37\x2df28b\x2d41f5\x2dbb0f\x2d37d575e86896.device @8.841s
mercurial@providence:~$ systemd-analyze blame
         10.636s udisks2.service
          6.628s dev-sda6.device
          5.486s ModemManager.service
          4.935s accounts-daemon.service
          4.346s exim4.service
          4.156s NetworkManager.service
          3.211s bluetooth.service
          3.203s atd.service
          3.174s apt-daily.service
          3.132s pppd-dns.service
          3.128s alsa-restore.service
          2.765s systemd-logind.service
          2.762s avahi-daemon.service
          2.751s rsyslog.service
          2.750s wpa_supplicant.service
          2.594s networking.service
          2.168s lightdm.service
          2.148s plymouth-quit-wait.service
          2.024s upower.service
          1.975s systemd-udevd.service
          1.955s apparmor.service
          1.718s polkit.service
          1.412s systemd-tmpfiles-setup.service
          1.161s colord.service
          1.000s systemd-rfkill.service

저는 개선의 여지가 많다고 생각하므로 일부 핵심 시스템 관리자가 약간의 정보를 제공할 때까지 기다릴 것입니다. 감사해요.

답변3

/etc/default/grub 편집 구성 파일을 교체하여 종료하고 시작 sudo update-grub 편집 /etc/fstab 기회 1 또는 2 in 0 마스크 네트워크 관리자 온라인 대기 마스크 플리머스 온라인 재부팅 대기 중

관련 정보