How to solve Podman overlayfs support problem

As you know, In centos or rhel operating systems, podman installation can be done with yum package manager. But in rhel 7, I met a problem today and want to write down here how I solved it. If you get an error like below you can apply the resolution I explained in this article.

Firstly, I installed podman.

yum install podman buildah -y — enablerepo=rhel-7-server-extras-rpms
And the problem was

[root@server ~]# podman pull centos
Error: could not get runtime: kernel does not support overlay fs: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior. Reformat the filesystem with ftype=1 to enable d_type support. Running without d_type is not supported.: driver not supported
to solve this problem I undid the yum packages after finding yum history number. You can find it runnig this command: yum history and to undo:

yum history undo 149
New logical volume is created for /var/run/containers and /var/lib/containers.

lvcreate -L +10G vg_pod -n lv_var_run_containers
lvcreate -L +10G vg_pod -n lv_var_lib_containers
Lvms are formatted xfs with ftype=1 option that is the important point.

[root@server ~]# mkfs -t xfs -n ftype=1 /dev/mapper/vg_pod-lv_var_lib_containers
[root@server ~]# mkfs -t xfs -n ftype=1 /dev/mapper/vg_pod-lv_var_run_containers
Make this permanent.

cat << EOF >> /etc/fstab
/dev/mapper/vg_pod-lv_var_lib_containers /var/lib/containers xfs defaults 0 0
/dev/mapper/vg_pod-lv_var_run_containers /var/run/containers xfs defaults 0 0
mount –a
Install podman again and when you tried pulling an image you can see it is working now.

yum install podman buildah -y — enablerepo=rhel-7-server-extras-rpms

[root@**** ~]# yum install podman buildah -y — enablerepo=rhel-7-server-extras-rpms
[root@**** ~]# podman pull centos
Trying to pull…
Getting image source signatures
Copying blob 294dced27509 done
Copying config c460095972 done
Writing manifest to image destination
Storing signatures