0

Need to get a glusterfs volume mounted in a centos 7 lxc container.

found this and can do it manually ok...

But it seems that adding it in the fstab doesnt work because it gets executed before gluster client is functional?

fstab:

host:/gv0/Data /data glusterfs defaults,_netdev 0 0

How do you get it to mount at boot?

user64
  • 31
  • 5

1 Answers1

0

found this and went the service route.

had to add a few ExecStartPre keys and change the After key in the service file but it is currently working for me... just thought I'd share

[Unit]
Description=Glustermounting
After=network.target

[Service] Type=simple RemainAfterExit=true ExecStartPre=/bin/sleep 10 ExecStartPre=/bin/mknod /dev/fuse c 10 229 ExecStartPre=/bin/sleep 3 ExecStart=/bin/mount -a Restart=on-failure RestartSec=3

[Install] WantedBy=multi-user.target

I realize this is a bit hacky, if there's a better way to do this I'd like ot hear about it.

also dont forget the

systemctl daemon-reload
systemctl enable glusterfsmounts
user64
  • 31
  • 5