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?

jstnewb
  • 31
  • 4
  • What is the problem you are having? – Michael Hampton Jul 15 '21 at 14:49
  • didnt have access to the gluster volume upon reboot and could only get access manually issuing the mount cmd. I'm going to delete this post, im now reading about some troubles fuse may cause running in a container in proxmox... – jstnewb Jul 16 '21 at 12:43

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
jstnewb
  • 31
  • 4