2017年10月20日金曜日

ネットワーク上のディレクトリをマウントする(Windows 10 Fall Creators Update - Bash on Ubuntu on Windows)

Windows 10 Fall Creators UpdateのBash on Ubuntu on Windowsでネットワーク上のファイルを利用できるようになりました。以下に解説がありました。
File System Improvements to the Windows Subsystem for Linux
https://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/

When you wish to mount a network location, you can of course create a mapped network drive in Windows and mount that as indicated above. However, it's also possible to mount them directly using a UNC path:
$ sudo mount -t drvfs '\\server\share' /mnt/share
試してみました。
surface$ cd /mnt
surface$ ls
c
surface$ sudo mkdir remote
surface$ ls
c  remote
surface$ sudo mount -t drvfs '\\fileserver\folder' /mnt/remote
surface$ cd /mnt/remote
surface$ ls
Doc                    Mail                   memo.txt

surface$
これは便利です。