Use systemd to mount CIFS drive

From AcrodusWiki
Revision as of 08:23, 21 November 2024 by Alex (talk | contribs) (Created page with "This two examples of unit files that enable a systemd service to mount a cifs drive. <pre> [Unit] Description=cifs mount script Requires=network-online.target After=network-online.service [Mount] What=//10.68.64.19/Reports/NMS Where=/mnt/nas Options=domain=ewr,username=nms,password=Atkins123! Type=cifs [Install] WantedBy=multi-user.target </pre> <pre> [Unit] Description=Automount NAS [Automount] Where=/mnt/nas [Install] 23WantedBy=multi-user.target </pre>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This two examples of unit files that enable a systemd service to mount a cifs drive.

[Unit]
Description=cifs mount script
Requires=network-online.target
After=network-online.service
[Mount]
What=//10.68.64.19/Reports/NMS
Where=/mnt/nas
Options=domain=ewr,username=nms,password=Atkins123!
Type=cifs
[Install]
WantedBy=multi-user.target
[Unit]
Description=Automount NAS
[Automount]
Where=/mnt/nas
[Install]
23WantedBy=multi-user.target