LoginSignup
2
0

More than 3 years have passed since last update.

WSL(ubuntu)からWindowsのディレクトリのPermissionをいじりたい

Last updated at Posted at 2020-09-11

やりたいこと

WSlで動くubuntu上のターミナルから、Windowsのディレクトリ・ファイルのpermission(chmod, chown)をいじりたい!

WSLで、chmod コマンド等をsudo権限でうったとしても、全然permissionが変わらない、、

原因

Windowsディレクトリ(/mnt/c) をmountするときに、metadataの設定がないため、出来ないみたい

$ mount | grep -i ^C:
result: C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,case=off)

やること

  1. mountオプションに、metadataを追加。etc/wsl.conf を作成する
$ sudo tee /etc/wsl.conf <<EOF >/dev/null
[automount]
options = "metadata"
EOF

2.  /mnt/c をmountしなおすか、Windowsの再起動をする

その他

/mnt/c ディレクトリ以下を、ubuntuの /c 以下にmountしたいときのコマンド


$ sudo mount --bind /mnt/c /c
2
0
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
2
0