大网数据广告活动
服务器运维问答

Retry all failed mounts with systemd

· 52CE 我爱测

I created several GlusterFS volumes replicated over 9 machines. All of the mounts (128 to be exact) are managed by systemd. The systemctl command shows a random subset of the mounts as "failed" (see listing below). From the log m…

问题原文

原帖链接 · Franz Wimmer · CC BY-SA 3.0

I created several GlusterFS volumes replicated over 9 machines. All of the mounts (128 to be exact) are managed by systemd.

The systemctl command shows a random subset of the mounts as "failed" (see listing below). From the log messages I guess that's because the network or the gluster daemon wasn't ready at that time.

  mnt-gluster-gluster\x2d119.mount      loaded active mounted   /mnt/gluster/gluster-119
  mnt-gluster-gluster\x2d12.mount       loaded active mounted   /mnt/gluster/gluster-12
● mnt-gluster-gluster\x2d120.mount      loaded failed failed    /mnt/gluster/gluster-120
  mnt-gluster-gluster\x2d122.mount      loaded active mounted   /mnt/gluster/gluster-122
  mnt-gluster-gluster\x2d123.mount      loaded active mounted   /mnt/gluster/gluster-123
● mnt-gluster-gluster\x2d124.mount      loaded failed failed    /mnt/gluster/gluster-124
  mnt-gluster-gluster\x2d125.mount      loaded active mounted   /mnt/gluster/gluster-125
  mnt-gluster-gluster\x2d126.mount      loaded active mounted   /mnt/gluster/gluster-126

I think it would be a sufficient solution to just retry all the failed mounts. How can I accomplish that?

已采纳解答

原帖链接 · bgtvfr · CC BY-SA 4.0

You can try to type mount -a just after your system has booted.

If this workaround works, you can set up a script whose content is just something like "sleep 60 && mount -a" and make it executed at boot time (via cron, systemctl or any other mean).

It's really dirty, the good solution would be to investigate why some fs do not mount correctly.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。