LoginSignup
11
9

More than 5 years have passed since last update.

/etc/fstabとは (自分メモ)

Last updated at Posted at 2018-02-05

/etc/fstab

/etc/fstabとは
〇自動マウント
〇OS起動時に反映される。
〇fstab 再起動コマンドもある

/etc/fstab中身 例

bitnami@ubuntu:~/test$ cat /etc/fstab
# /etc/fstab: static file system information.
#
proc /proc proc defaults 0 0
/dev/sda1 / ext4 defaults 0 0
//192.168.0.1/XXXXXXXXX /home/XXXXXXXXXXXXXXXXXXXXXXX cifs username=root,password=password 0 0
//192.168.0.1/OOOOOOOOO /home/OOOOOOOOOOOOOOOOOOOOOOO cifs username=root,password=password 0 0

アンマウント umount

設定したマウントを外す場合
sudo umount /home/bitnami/test

mount反映

mount -a

同じmount先が二つある場合以下のエラーが出る

bitnami@ubuntu:~/test$ umount //192.168.0.1/XXXXXXXXX/files
umount: cannot unmount //192.168.0.1/XXXXXXXXX/files -- //192.168.0.2/XXXXXXXXX/files is mounted over it on the same point

その場合、まずは新しいほうから削除する
sudo umount //192.168.0.2/XXXXXXXXX/files
削除後、古いものを削除する
sudo umount //192.168.0.1/XXXXXXXXX/files

コマンド実行する場合

mount -t cifs -o username=#{administrator},password=#{password} //192.168.0.1/files /home/file

11
9
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
11
9