LoginSignup
1
1

More than 1 year has passed since last update.

ubuntuにNASをマウントする

Posted at

はじめに

ubuntuにNasをマウントしたときにいい感じの記事を見つけるのに時間がかかったのでメモとして残す

環境

ubutnu 20.04lts
cifs-utils 2:6.9-1

インストール

sudo apt-get install cifs-utils

マウント

/etc/fstabを編集

user$ nano /etc/fstab
/etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# *
# *(いろいろ書いてる)
# *
/swapfile                                 none            swap    sw              0       0

#以下の行を追加
//{IP}/{Nas上のパス} {ubuntu上のパス} cifs user,uid=1000,gid=1000,username={NasUser名},password={NasPassword}
# 例
#//192.168.10.1/date /mnt cifs user,uid=1000,gid=1000,username=test_user,password=test_pass

マウント コマンド

# /etc/fstabに書いてる全てをマウントするなら
sudo mount -a
# 特定のパスのマウントのみ実行するなら
sudo mount {ubuntu上のpath}
# 例 sudo mount /mnt

アンマウント

# 特定のubuntu上のpathのみアンマウント
sudo umount {ubuntu上のpath}
# 例 sudo umount /mnt

# 全てをアンマウントするのは、把握していないすべてのマウントが解除されるのでやめたほうがいい
sudo umount -a
1
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
1
1