Score:0

How to mount glusterfs at boot in centOS 7 lxc container?

pk flag

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?

Michael Hampton avatar
cz flag
What is the problem you are having?
jstnewb avatar
pk flag
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...
Score:0
pk flag

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
Michael Hampton avatar
cz flag
Again, what is the problem that this solves? You did not explain the specifics of the problem in your original question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.