Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

Automatically Mount NFS with Systemd

Posted on September 22, 2020 by Syauqi Wiryahasana
Follow this step:
  1. create network share for NFS
[sourcecode][root@nfs-server ~]# exportfs -v /data (sync,wdelay,hide,no_subtree_check,sec=sys,rw,no_root_squash,no_all_squash)[/sourcecode] try those NFS mounting, with mount command:
mount 192.168.168.10:/data /share
and check:
df -h /share
if you're successfully to mount those NFS, then unmount. umount /share
  1. Create Systemd Unit to mount NFS
with nano/vim, create a new file /etc/systemd/system/mount-nfs [sourcecode] [Unit] Description=NFS Share from nfs-server.example.com(192.168.43.10) DefaultDependencies=no Conflicts=umount.target After=network-online.target remote-fs.target Before=umount.target [Mount] What=192.168.43.10:/data Where=/share Type=nfs Options=defaults [Install] WantedBy=multi-user.target [/sourcecode] reload systemd daemon, systemctl daemon-reload then start it: systemctl start mount-nfs and check the mounting directory.
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically