본문으로 바로가기

NFS 자동 마운트 설정

autofs 설치

apt-get install -y autofs
또는
yum install -y autofs

autofs 설정

vi /etc/auto.master
// 변경내용 없음

# vi /etc/auto.master.d/nfs.autofs
/-     /etc/auto.nfs

# vi /etc/auto.nfs
/var/lib/docker/volumes/nova_compute/_data/instances -rw,sync 192.168.140.51:/NAS/NOVA

autofs 재시작 및 마운트 확인

# systemctl restart autofs

# systemctl enable autofs
Synchronizing state of autofs.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable autofs


# df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              1.6G  2.8M  1.6G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  226G   27G  188G  13% /
tmpfs                              7.7G     0  7.7G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  211M  1.6G  12% /boot
/dev/sda1                          1.1G  6.1M  1.1G   1% /boot/efi
......
tmpfs                              1.6G  8.0K  1.6G   1% /run/user/0
192.168.140.51:/NAS/NOVA           932G   85G  847G  10% /var/lib/docker/volumes/nova_compute/_data/instances
728x90