Linux 开机后 dev-disk-by-xxx.device 作业的状态仍在等待

Linux 开机后 dev-disk-by-xxx.device 作业的状态仍在等待

我在imx8(NXP CPU)上运行linux,第1个进程是systemd,登录系统后,执行“systemctl list-jobs”显示一些作业状态正在等待。

JOB UNIT                                                            TYPE STATE  
241 dev-disk-by\x2did-mmc\x2d88A378_0x11afd0a0\x2dpart4.device      nop  waiting
216 sys-devices-platform…0-mmc0:0001-block-mmcblk0-mmcblk0p1.device nop  waiting
244 sys-devices-platform…0-mmc0:0001-block-mmcblk0-mmcblk0p4.device nop  waiting
215 dev-mmcblk0p1.device                                            nop  waiting
219 dev-disk-by\x2did-mmc\x2d88A378_0x11afd0a0\x2dpart2.device      nop  waiting
218 dev-disk-by\x2dpartuuid-ab685616\x2d02.device                   nop  waiting
211 dev-disk-by\x2dlabel-Boot\x5cx20imx8mq.device                   nop  waiting
236 dev-disk-by\x2did-mmc\x2d88A378_0x11afd0a0.device               nop  waiting
235 dev-disk-by\x2dpath-platform\x2d30b40000.mmc.device             nop  waiting
213 dev-disk-by\x2duuid-5438\x2d0EB3.device                         nop  waiting
240 dev-disk-by\x2duuid-…300\x2d4678\x2db9d4\x2dbe73d205eae9.device nop  waiting
212 dev-disk-by\x2did-mmc\x2d88A378_0x11afd0a0\x2dpart1.device      nop  waiting
221 sys-devices-platform…0-mmc0:0001-block-mmcblk0-mmcblk0p2.device nop  waiting
243 dev-mmcblk0p4.device                                            nop  waiting
237 dev-mmcblk0.device                                              nop  waiting
214 dev-disk-by\x2dpartuuid-ab685616\x2d01.device                   nop  waiting
220 dev-mmcblk0p2.device                                            nop  waiting
239 dev-disk-by\x2dpath-platform\x2d30b40000.mmc\x2dpart4.device    nop  waiting
242 dev-disk-by\x2dpartuuid-ab685616\x2d04.device                   nop  waiting
238 sys-devices-platform…c_host-mmc0-mmc0:0001-block-mmcblk0.device nop  waiting
217 dev-disk-by\x2dpath-platform\x2d30b40000.mmc\x2dpart2.device    nop  waiting
210 dev-disk-by\x2dpath-platform\x2d30b40000.mmc\x2dpart1.device    nop  waiting

22 jobs listed.

此信息似乎与系统分区相关

root@imx8mqevk:/lib/systemd/system# lsblk --fs
NAME         FSTYPE LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINT
mmcblk0
├─mmcblk0p1  vfat   Boot imx8mq 5438-0EB3
├─mmcblk0p2  ext4               bfc7ccd6-d303-44c5-9466-e6114742d3c7
├─mmcblk0p3  ext4               bfc7ccd6-d303-44c5-9466-e6114742d3c7    1.3G    45% /
└─mmcblk0p4  ext4               c28cc558-0300-4678-b9d4-be73d205eae9    817M     5% /media/usr
mmcblk0boot0
mmcblk0boot1
nvme0n1
└─nvme0n1p1  ext4               eecda9f6-3317-4762-ab05-36b345f19309  413.4G     1% /mnt
root@imx8mqevk:/lib/systemd/system#

比较特别的一点是我使用了两次挂载来挂载分区和绑定文件夹。一个是media-usr.mount

[Unit]
Description = mount mmcblk0p4
DefaultDependencies=no
[Mount]
What = /dev/mmcblk0p4
Where = /media/usr
Type = ext4
Options = defaults
[Install]
WantedBy=local-fs.target

另一个是etc.mount

[Unit]
Description = bind etc dir
DefaultDependencies=no
After=media-usr.mount
[Mount]
What = /media/usr/etc
Where = /etc
Type = none
Options = bind
[Install]
WantedBy=local-fs.target

有时系统启动成功,执行“systemd-analyzeplot>boot.svg”,内容如下启动.svg

这个问题的原因是什么以及如何解决它

相关内容