INT 21h

Select language

Automount SMB (samba) shares with systemd

№ 11820 В разделе Sysadmin от September 22nd, 2022,
В подшивках: ,

Create unit file /etc/systemd/system/mnt-backups-storage.mount

[Unit]
Description=backup storage

[Mount]
What=//backup-server/sql_backup
Where=/mnt/backups/storage
Options=credentials=/root/.smbclient,rw,file_mode=0700,dir_mode=0700,uid=1000
DirectoryMode=0700
Type=cifs

[Install]
WantedBy=multi-user.target

Now create automount unit /etc/systemd/system/mnt-backups-storage.automount

[Unit]
Description=storage automount

[Install]
WantedBy=multi-user.target

[Automount]
Where=/mnt/backups/storage

Auth file /root/.smbclient

username=myusername
pass=supapa$$w0rd

Activate

systemctl enable mnt-backups-storage.mount
systemctl enable mnt-backups-storage.automount
systemctl start mnt-backups-storage.mount

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Облачная платформа
Яндекс.Метрика

Fortune cookie: Today's spam: good yj kw Girls high melody bottom.