Ubuntu 18.04でWindows 10の共有フォルダ(シェアフォルダ)をマウント(同期)する方法について紹介します。
以前こんな記事を書きました。
windows 10のシェア(共有)フォルダをubuntu16.04でマウント(同期)する – プログラミングの「YUIPRO」
windows 10のシェア(共有)フォルダをubuntu16.04でマウント(同期)する
mkdir ~/share sudo mount -t cifs //IP_ADDR/_sync_ ~/share -o user=USERNAME,pass=PASSWORD,dir_mode=0777,file_mode=0777 e.g. sudo mount -t cifs //192.168.3.19/_sync_ ~/share -o user=user,pass=hogefuga,dir_mode=0777,file_mode=0777
これはubuntu16.04LTS用なのですが、18.04だとまた追加でやることが出てきました。
ubuntu 18.04でこれだけで実行すると、以下のエラーになります。
bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
mount – Why do I get “wrong fs type, bad option, bad superblock” error? – Ask Ubuntu
解決法
sudo apt update
sudo apt install nfs-common
sudo apt install cifs-utils
で、ubunt16.04同様こちらのコマンドでマウントできます。
sudo mount -t cifs //192.168.3.19/sync ~/share -o user=user,pass=hogefuga,dir_mode=0777,file_mode=0777