0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu NFS mount

Last updated at Posted at 2024-02-21

Ubuntu 22.04 に NAS の共有フォルダを開く(備考録

Ubuntu 22.04 に NAS の共有フォルダを設定(NFS)

NAS

name: truenas.local ※ IP(xxx.xxx.xxx.xxx)でも良い
共有元 /Academic/Studies

PC

共有先 /mnt/Academic/Studies
username: 適宜修正してください

autofs

install autofs
    $ sudo apt install autofs -y
/etc/auto.creds/truenas.local
    # dir 作成 # mkdir + chmod 
    $ sudo install -d -m 0755 -o <username> -g root /etc/auto.creds
    
    # NAS 認証設定
    $ sudo nano /etc/auto.creds/truenas.local
    username=<nas username for auth>
    password=<password for auth>
    # domain=<domain *optional>
/etc/auto.master.d/truenas.local.autofs
    $ sudo nano /etc/auto.master.d/truenas.local.autofs
    
    # 下記1行を記述
    /-      /etc/auto.master.d/auto.truenas.local --timeout 60
    #--Save(Ctrl+S) Close(Ctrl+X)
mkdir + chmod ### 共有フォルダのマウント先フォルダ作成(再帰)
    $ sudo install -d -m 0755 -o <username> -g root /mnt/Academic/Studies
/etc/auto.master.d/auto.truenas.local
    $ sudo nano /etc/auto.master.d/auto.truenas.local
    
    # 下記1行を記述
    /mnt/Academic/Studies -rw,soft,intr,rsize=8192,wsize=8192     truenas.local:/Academic/Studies
reboot autofs ### 再起動 # require sudo ?
    $ systemctl restart autofs

これで /mnt/Academic/Studies に共有元のファイルなどが表示されていれば成功!
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?