如何修复 RAID 中的启动缓慢问题?

如何修复 RAID 中的启动缓慢问题?

我最近切换到硬件 RAID1,发现启动时间明显增加。请自己查看输出示例dmesg

...
[    2.316879] dell_wmi: Detected Dell WMI interface version 1
[    2.316928] input: Dell WMI hotkeys as /devices/virtual/input/input8
[    2.329702] input: HDA Intel PCH Headphone Mic as /devices/pci0000:00/0000:00:1f.3/sound/card0/input9
[    2.329755] input: HDA Intel PCH Line Out as /devices/pci0000:00/0000:00:1f.3/sound/card0/input10
[    2.332544] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 241
[    2.527704] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: (null)
[    2.606030] audit: type=1400 audit(1477798402.176:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=978 comm="apparmor_parser"
[    2.606034] audit: type=1400 audit(1477798402.176:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=978 comm="apparmor_parser"
[    2.606909] audit: type=1400 audit(1477798402.176:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lightdm/lightdm-guest-session" pid=972 comm="apparmor_parser"
[    2.606913] audit: type=1400 audit(1477798402.176:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lightdm/lightdm-guest-session//chromium" pid=972 comm="apparmor_parser"
[    2.607887] audit: type=1400 audit(1477798402.176:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=973 comm="apparmor_parser"
[    2.607891] audit: type=1400 audit(1477798402.176:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=973 comm="apparmor_parser"
[    2.607895] audit: type=1400 audit(1477798402.176:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=973 comm="apparmor_parser"
[    2.607898] audit: type=1400 audit(1477798402.176:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=973 comm="apparmor_parser"
[    2.608931] audit: type=1400 audit(1477798402.180:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cups-browsed" pid=981 comm="apparmor_parser"
[    2.791921] clocksource: Switched to clocksource tsc
[    2.995463] NVRM: Your system is not currently configured to drive a VGA console
[    2.995464] NVRM: on the primary VGA device. The NVIDIA Linux graphics driver
[    2.995464] NVRM: requires the use of a text-mode VGA console. Use of other console
[    2.995465] NVRM: drivers including, but not limited to, vesafb, may result in
[    2.995465] NVRM: corruption and stability problems, and is not supported.
[    3.118394] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input11
[    3.118480] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input12
[    3.118560] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input13
[    3.118625] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input14
[   92.261466] audit_printk_skb: 60 callbacks suppressed
[   92.261467] audit: type=1400 audit(1477798491.830:31): apparmor="DENIED" operation="open" profile="/usr/sbin/cupsd" name="/etc/ld.so.preload" pid=1140 comm="cupsd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   92.262088] cgroup: new mount options do not match the existing superblock, will be ignored
[   92.331553] audit: type=1400 audit(1477798491.898:32): apparmor="DENIED" operation="open" profile="/usr/sbin/cups-browsed" name="/etc/ld.so.preload" pid=1224 comm="cups-browsed" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
...

我怀疑中的 UUID 不好/etc/fstab,但请注意,我甚至取消了注释交换,以便只包含必要的东西:

~$ sudo blkid 
/dev/sda: TYPE="isw_raid_member"
/dev/sdb: TYPE="isw_raid_member"
/dev/sdc1: UUID="8c6a54af-7820-4590-851d-d11bcb06f642" TYPE="crypto_LUKS" PARTUUID="1a92ebcc-01"
/dev/sdc2: UUID="9660a50c-cd39-4366-85c4-b4f0485914c5" TYPE="swap" PARTUUID="1a92ebcc-02"
/dev/mapper/isw_deehbehggj_TowerVolume1: UUID="04e2666d-4dbf-47d9-87ae-84cc06914d32" TYPE="ext4" PTTYPE="dos" PARTUUID="074e8ddc-01"
/dev/mapper/isw_deehbehggj_TowerVolume2: UUID="e17a84b2-3f2a-471f-a928-d7a265993e1e" TYPE="ext4" PARTUUID="074e8ddc-02"
/dev/mapper/isw_deehbehggj_TowerVolume: PTUUID="074e8ddc" PTTYPE="dos"

看看/etc/fstab

~$ 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/sda1 during installation
UUID=04e2666d-4dbf-47d9-87ae-84cc06914d32 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda6 during installation
UUID=e17a84b2-3f2a-471f-a928-d7a265993e1e /home           ext4    defaults        0       2
# swap was on /dev/sdc during installation
#UUID=9660a50c-cd39-4366-85c4-b4f0485914c5 none            swap    sw              0       0

我会说这些 UUID 匹配,那么为什么我得到

[   92.262088] cgroup: new mount options do not match the existing superblock, will be ignored

附言

/dev/sda是256GB SSD(ADATA SSD S559)

/dev/sdb是 256GB SSD (Liteon CV3-CE256)

sdasdb设置为 RAID1

/dev/sdc是 1TB HDD,分为加密驱动器(/dev/sdc1)和 8GB 交换(/dev/sdc2

/dev/mapper/isw_deehbehggj_TowerVolume是 RAID1 卷表示

RAID 信息:

~$ lspci -vv | grep -i raid
00:17.0 RAID bus controller: Intel Corporation SATA Controller [RAID mode] (rev 31)
    Subsystem: Dell SATA Controller [RAID mode]

以下是没有使用软件 RAID 的证据:

~$ cat /proc/mdstat 
Personalities : 
unused devices: <none>

运行 Ubuntu 16.10

这是systemd-analyze blame输出,我没有看到任何奇怪的事情

~$ systemd-analyze blame
          9.609s NetworkManager-wait-online.service
          5.074s nmbd.service
          3.817s apt-daily.service
          2.078s upower.service
          1.209s vmware.service
           904ms [email protected]
           545ms vmware-workstation-server.service
           414ms systemd-timesyncd.service
           348ms dev-mapper-isw_deehbehggj_TowerVolume1.device
           289ms click-system-hooks.service
           282ms snapd.firstboot.service
           240ms networking.service
           131ms NetworkManager.service
           110ms ModemManager.service
           107ms smbd.service
           102ms accounts-daemon.service
           101ms systemd-resolved.service
            97ms keyboard-setup.service
            92ms udisks2.service
            87ms apparmor.service
            82ms vmware-USBArbitrator.service
            82ms bluetooth.service
            78ms teamviewerd.service
            54ms thermald.service
            45ms gpu-manager.service
            45ms pppd-dns.service
            43ms rsyslog.service
            42ms systemd-udev-trigger.service
            41ms systemd-fsck@dev-disk-by\x2duuid-e17a84b2\x2d3f2a\x2d471f\x2da928\x2dd7a265993e1e.service
            38ms systemd-tmpfiles-setup-dev.service
            37ms irqbalance.service
            36ms grub-common.service
            34ms lightdm.service
            34ms systemd-tmpfiles-setup.service
            30ms polkitd.service
            26ms systemd-udevd.service
            23ms systemd-tmpfiles-clean.service
            22ms colord.service
            19ms apport.service
            18ms avahi-daemon.service
            18ms packagekit.service
            16ms systemd-journald.service
            16ms systemd-modules-load.service
            16ms ssh.service
            16ms speech-dispatcher.service
            15ms plymouth-read-write.service
            15ms rc-local.service
            14ms systemd-logind.service
            14ms alsa-restore.service
            12ms plymouth-start.service
            10ms sys-kernel-debug.mount
            10ms binfmt-support.service
            10ms dev-hugepages.mount
            10ms systemd-remount-fs.service
             9ms dev-mqueue.mount
             8ms ureadahead-stop.service
             7ms home.mount
             7ms snapd.boot-ok.service
             6ms dns-clean.service
             6ms systemd-sysctl.service
             5ms console-setup.service

~$ systemd-analyze plot输出

systemd-analyze 图

答案1

对于那些使用 RAID 或以其他方式重新格式化磁盘的用户,请不要忘记以下几点:

查看两个都 /etc/fstab /etc/crypttab文件。

对我来说,该/etc/crypttab行指定了一个不存在的加密交换卷。删除后,启动现在只需 15 秒。

相关内容