Hi
First of all I am noob in linux.
I have shared folder in active directory. I need CentOS to mount shared folder automatically on boot.
I created line in fstab:
\\192.168.99.99\my_folder /web/my_doc cifs user, uid=0, rw, suid, username=example, password=12345 0 0
After server restart i use command "df" and i see that /web/my_doc is not mounted.
When i use command "mount -a", /web/my_doc mounts perfectly without any problems/errors and I cen list all files in shared folder.
Why fstab doesn't mount \\192.168.99.99\my_folder on boot ?
Soory my eng
fstab doesn't mount active directory shared folder
Re: fstab doesn't mount active directory shared folder
As you are using CentOS7 you should use systemd.
Here are some notes on how I did it. You should name your mount file /etc/systemd/system/web-my_doc.mount and change the other fields to suit your requirements:
Here are some notes on how I did it. You should name your mount file /etc/systemd/system/web-my_doc.mount and change the other fields to suit your requirements:
Code: Select all
# vim /mnt/cifs/.cifs_creds
username=user1
password=secret
# chmod 600 /mnt/cifs/.cifs_creds
# vim /etc/systemd/system/mnt-cifs-logs.mount
[Unit]
Requires=network-online.target
After=network-online.service
[Mount]
What=//example.com/logs$
Where=/mnt/cifs/logs
Options=credentials=/mnt/cifs/.cifs_creds,workgroup=EXAMPLE,rw
Type=cifs
[Install]
WantedBy=multi-user.target
# systemctl enable mnt-cifs-fortilogs.mount
# systemctl start mnt-cifs-fortilogs.mount
Re: fstab doesn't mount active directory shared folder
Thank you very much for the information and config sample. Everything works perfectly!
Re: fstab doesn't mount active directory shared folder
I switched from my fstab entry with auto-mount but get this error and I have to start service manually.
mount[435] : mount error : could not resolve address for myhostbyname: Unknown error
mount[435] : mount error : could not resolve address for myhostbyname: Unknown error
Re: fstab doesn't mount active directory shared folder
This article helped me to configure auto-mount in systemd
https://blog.tomecek.net/post/automount-with-systemd/
https://blog.tomecek.net/post/automount-with-systemd/