notes/autofs_dnas.md

29 lines
974 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### Монтирование сетевых папок с помощью NFS
```bash
sudo apt install autofs
```
**Настройка**
Для настройки autofs в файле `/etc/auto.master` необходимо добавить строку
```
/nfs /etc/auto.nfs --timeout=60
```
Здесь --timeout=60 указывает отмонтировать раздел при отсутствии активности на нём более чем 60 секунд.
Создаем в корне файловой системы папку `/nfs` :
```bash
sudo touch /etc/auto.nfs && sudo mkdir /nfs
````
В файле `/etc/auto.nfs` добавляем строку
```
disk1 -rw,soft,intr,rsize=8192,wsize=8192 192.168.13.8:/mnt/disk1
disk2 -rw,soft,intr,rsize=8192,wsize=8192 192.168.13.8:/mnt/disk2
disk3 -rw,soft,intr,rsize=8192,wsize=8192 192.168.13.8:/mnt/disk3
```
Перезапускаем службу autofs :
```bash
sudo service autofs restart
```