Not automount volume after GlusterFS client booting up by autofs

I have configured GlusterFS between 3 rocky servers and mounting the gluster volume under /srv/gluster/vol01 directory. I had to install glusterfs-client in the 4th machine. My primary objective was to get the 3 servers replicated. Currently I am using autofs, but it doesn’t mount the volume when client booting up. The auto.master & what I did as below. How should i do?
auto.master:
/media /etc/auto.media
Thank you very much.

Hi,

Please don’t post links to onedrive since this could be potential security risks as we don’t know what is being linked is legit, or some kind of trojan/virus or whatever.

You don’t need to link to what you did, you can post it here as text which is normal and makes it far easier for people to read than having to visit a onedrive link to potentially download something.

Oh, sorry, but now I can’t edit the post. Future time I won’t attach the onedrive link.

This is what I did

[root@localhost ~]# yum install -y glusterfs-fuse
Last metadata expiration check: 0:52:23 ago on Tue 28 Mar 2023 10:50:03 AM +07.
Dependencies resolved.

Package Architecture Version Repository Size

Installing:
glusterfs-fuse x86_64 6.0-61.3.el8 baseos 140 k

Transaction Summary

Install 1 Package

Total download size: 140 k
Installed size: 539 k
Downloading Packages:
glusterfs-fuse-6.0-61.3.el8.x86_64.rpm 349 kB/s | 140 kB 00:00

Total 121 kB/s | 140 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : glusterfs-fuse-6.0-61.3.el8.x86_64 1/1
Running scriptlet: glusterfs-fuse-6.0-61.3.el8.x86_64 1/1
Verifying : glusterfs-fuse-6.0-61.3.el8.x86_64 1/1

Installed:
glusterfs-fuse-6.0-61.3.el8.x86_64

Complete!

[root@localhost ~]# yum -y install autofs
Last metadata expiration check: 0:53:56 ago on Tue 28 Mar 2023 10:50:03 AM +07.
Dependencies resolved.

Package Architecture Version Repository Size

Installing:
autofs x86_64 1:5.1.4-83.el8 baseos 706 k

Transaction Summary

Install 1 Package

Total download size: 706 k
Installed size: 2.8 M
Downloading Packages:
autofs-5.1.4-83.el8.x86_64.rpm 1.1 MB/s | 706 kB 00:00

Total 511 kB/s | 706 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : autofs-1:5.1.4-83.el8.x86_64 1/1
Running scriptlet: autofs-1:5.1.4-83.el8.x86_64 1/1
Verifying : autofs-1:5.1.4-83.el8.x86_64 1/1

Installed:
autofs-1:5.1.4-83.el8.x86_64

Complete!
[root@localhost ~]# echo “/mnt /etc/auto.mnt” >> /etc/auto.master
[root@localhost ~]# cat << “EOF” > /etc/auto.mnt

video -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/video
UserFolder -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/UserFolder
csvfile -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/csvfile
image -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/image
report -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/report
media -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/media
EOF
[root@localhost ~]# echo “/media /etc/auto.media” >> /etc/auto.master
[root@localhost ~]# cat << “EOF” > /etc/auto.media
video -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/video
UserFolder -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/UserFolder
csvfile -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/csvfile
image -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/image
report -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/report
EOF
[root@localhost ~]#
[root@localhost ~]# systemctl start autofs.service
[root@localhost ~]# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2023-03-28 11:46:38 +07; 18s ago
Main PID: 168125 (automount)
Tasks: 7 (limit: 48664)
Memory: 1.9M
CGroup: /system.slice/autofs.service
└─168125 /usr/sbin/automount --systemd-service --dont-check-daemon

Mar 28 11:46:38 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand…
Mar 28 11:46:38 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
[root@localhost ~]# systemctl enable autofs.service
Created symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.
[root@localhost ~]# systemctl is-enabled autofs.service
enabled
[root@localhost ~]# systemctl stop autofs.service
[root@localhost ~]# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2023-03-28 12:51:11 +07; 4s ago
Process: 168125 ExecStart=/usr/sbin/automount $OPTIONS --systemd-service --dont-check-daemon (code=exited, status=0/SUCCESS)
Main PID: 168125 (code=exited, status=0/SUCCESS)

Mar 28 11:46:38 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand…
Mar 28 11:46:38 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
Mar 28 12:51:11 localhost.localdomain systemd[1]: Stopping Automounts filesystems on demand…
Mar 28 12:51:11 localhost.localdomain systemd[1]: autofs.service: Succeeded.
Mar 28 12:51:11 localhost.localdomain systemd[1]: Stopped Automounts filesystems on demand.
[root@localhost ~]#
[root@localhost ~]# reboot
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 1.1M 3.8G 1% /dev/shm
tmpfs tmpfs 3.8G 9.5M 3.8G 1% /run
tmpfs tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/mapper/rl-root xfs 70G 7.4G 63G 11% /
/dev/sda2 xfs 1014M 261M 754M 26% /boot
/dev/mapper/rl-home xfs 852G 6.0G 846G 1% /home
/dev/sda1 vfat 599M 5.8M 594M 1% /boot/efi
tmpfs tmpfs 767M 12K 767M 1% /run/user/42
tmpfs tmpfs 767M 0 767M 0% /run/user/0
[root@localhost ~]#
[root@localhost ~]# ls /mnt
[root@localhost ~]# cd /mnt
[root@localhost mnt]# ls
[root@localhost mnt]# mkdir test
mkdir: cannot create directory ‘test’: Permission denied

[root@localhost mnt]# sudo mkdir test
mkdir: cannot create directory ‘test’: Permission denied
[root@localhost mnt]# mount | grep -w /
/dev/mapper/rl-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
[root@localhost mnt]# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2023-03-30 09:54:47 +07; 6min ago
Main PID: 1589 (automount)
Tasks: 7 (limit: 48664)
Memory: 3.7M
CGroup: /system.slice/autofs.service
└─1589 /usr/sbin/automount --systemd-service --dont-check-daemon

Mar 30 09:54:47 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
Mar 30 09:59:48 localhost.localdomain automount[1589]: key “bpf” not found in map source(s).
Mar 30 09:59:48 localhost.localdomain automount[1589]: key “none” not found in map source(s).
Mar 30 09:59:48 localhost.localdomain automount[1589]: key “selinuxfs” not found in map source(s).
Mar 30 10:01:19 localhost.localdomain automount[1589]: key “syetem” not found in map source(s).
Mar 30 10:01:20 localhost.localdomain automount[1589]: key “syetemct” not found in map source(s).
Mar 30 10:01:28 localhost.localdomain automount[1589]: key “system” not found in map source(s).
Mar 30 10:01:29 localhost.localdomain automount[1589]: key “systemc” not found in map source(s).
Mar 30 10:01:29 localhost.localdomain automount[1589]: key “systemctl” not found in map source(s).
Mar 30 10:01:36 localhost.localdomain automount[1589]: key “autofs.service” not found in map source(s).
[root@localhost mnt]#
[root@localhost mnt]# ls -l
total 0
[root@localhost mnt]# automount -m

autofs dump map information

global options: none configured

Mount point: /misc

source(s):

instance type(s): file
map: /etc/auto.misc

cd | -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

Mount point: /net

source(s):

type: hosts

localhost | (null)

Mount point: /mnt

source(s):

instance type(s): file
map: /etc/auto.mnt

video | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/video
csvfile | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/csvfile
UserFolder | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/UserFolder
image | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/image
media | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/media
report | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/report

Mount point: /media

source(s):

instance type(s): file
map: /etc/auto.media

video | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/video
csvfile | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/csvfile
UserFolder | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/UserFolder
image | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/image
report | -rw -fstype=glusterfs,backupvolfile-server=10.141.81.101 10.141.81.100 10.141.81.91:/vol01/report

[root@localhost ~]# cd /media/video
bash: cd: /media/video: No such file or directory
[root@localhost ~]#
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 1.1M 3.8G 1% /dev/shm
tmpfs tmpfs 3.8G 9.5M 3.8G 1% /run
tmpfs tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/mapper/rl-root xfs 70G 7.4G 63G 11% /
/dev/sda2 xfs 1014M 261M 754M 26% /boot
/dev/mapper/rl-home xfs 852G 6.0G 846G 1% /home
/dev/sda1 vfat 599M 5.8M 594M 1% /boot/efi
tmpfs tmpfs 767M 12K 767M 1% /run/user/42
tmpfs tmpfs 767M 0 767M 0% /run/user/0
[root@localhost ~]#

1 Like

It’s OK I removed it. Best is to explain everything in the post.

1 Like

We could manual mount the 2 volumes:
[root@localhost rpm]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 1.1M 3.8G 1% /dev/shm
tmpfs tmpfs 3.8G 9.5M 3.8G 1% /run
tmpfs tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/mapper/rl-root xfs 70G 8.1G 62G 12% /
/dev/mapper/rl-home xfs 852G 6.0G 846G 1% /home
/dev/sda2 xfs 1014M 328M 687M 33% /boot
/dev/sda1 vfat 599M 5.8M 594M 1% /boot/efi
tmpfs tmpfs 767M 12K 767M 1% /run/user/42
tmpfs tmpfs 767M 0 767M 0% /run/user/0
10.141.81.94:/vol02 fuse.glusterfs 95G 1.9G 94G 2% /mnt
10.141.81.94:/vol01 fuse.glusterfs 95G 1.9G 94G 2% /mnt2
[root@localhost rpm]# ls /mnt
client server

but when use auto.master:
/mnt /etc/auto.mnt

And auto.mnt:
client -rw -fstype=glusterfs,backupvolfile-server=10.141.81.94:/vol02/client
server -rw -fstype=glusterfs,backupvolfile-server=10.141.81.94:/vol02/server

[root@localhost rpm]# systemctl restart autofs.service
then wait for 5 mins:
[root@localhost rpm]# ls /mnt
[root@localhost rpm]#

Tried to change auto.mnt to:
client -rw -fstype=glusterfs,backupvolfile-server=10.141.81.94:/vol01
server -rw -fstype=glusterfs,backupvolfile-server=10.141.81.94:/vol02

[root@localhost rpm]# systemctl restart autofs.service
[root@localhost ~]# systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-04-19 11:12:18 +07; 5min ago
Main PID: 93913 (automount)
Tasks: 6 (limit: 48664)
Memory: 1.8M
CGroup: /system.slice/autofs.service
└─93913 /usr/sbin/automount --systemd-service --dont-check-daemon

Apr 19 11:12:18 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand…
Apr 19 11:12:18 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
[root@localhost ~]# ls /mnt
[root@localhost ~]#
How should I do? Anyone have been use autofs on Rocky? Or is it not support?
Thank you very much.