弹性云服务器 ECS-CentOS 7中修改fstab无法挂载怎么办?:根因分析
根因分析
- 执行以下命令,查询有问题的mount unit。
systemctl list-units --type=mount |grep failed
test1.mount loaded failed failed /test1
- 执行以下命令,查询该unit的状态。
回显信息如下所示:
● test1.mount - /test1 Loaded: loaded (/etc/fstab; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-08-28 15:32:53 CS T; 3min 27s ago Where: /test1 What: /dev/vdb1 Docs: man:fstab(5) man:systemd-fstab-generator(8) Process: 4601 ExecUnmount=/bin/umount /test1 (code=exited, status=0/SUC CES S) Process: 3129 ExecMount=/bin/mount /dev/vdb1 /test1 -t ext4 (code=exited, status=0/SUCCESS) ... ... Warning: test1.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
如回显信息所示test1.mount磁盘发生了改变,需要运行systemctl daemon-reload重新加载units。
更改/etc/fstab时,必须执行systemctl daemon-reload。在运行该命令之前,systemd不读取fstab并生成装载单元。