0

I'm using the Ubuntu bash on Windows 10(v1804) and am experiencing a problem with the chown command. I'm trying to change the ownership of a file I created on my desktop with the following path:

mnt/c/users/XY/Desktop/filecat.txt

Using sudo -i I switch to the root user and navigate to the mentioned path and run

chown -v user1 filecat.txt

after which I get this message confirming the ownership change:

changed ownership of 'filecat.txt' from amar to user1

However, when I run ls -l filecat.txt it does not show any change in user. It's still the same user which created the file.

Anyone have any idea what might be the problem? I've been searching online but finding nothing similar so here I am asking the question myself.

EDIT:

This is the full output of the command line mentioned in the comments.

$ ls -l filecat.txt; chown user1 filecat.txt; ls -l filecat.txt
-rwxrwxrwx 1 amar amar 2054 Jul  8 20:44 filecat.txt
-rwxrwxrwx 1 amar amar 2054 Jul  8 20:44 filecat.txt

The file system I'm using is NTFS on both of my partitions. Using lsblk results in the following output

lsblk: failed to access sysfs directory: /sys/dev/block: No such file or directory

The answer provided in the linked question suggested editing a certain line in the etc/fstab file. My etc/fstab file contains only the following line

LABEL=cloudimg-rootfs   /        ext4   defaults        0 0
  • 1
    Please edit and add the full output of this command line: ls -l filecat.txt; chown user1 filecat.txt; ls -l filecat.txt – on which filesystem is the file located? lsblk gives you a nice overview of block devices and their mountpoints. – dessert Jul 8 at 20:22
  • lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT is even better, showing you the file system in the second column as well – IIRC, usual Windows file systems like NTFS and FAT don’t support POSIX file ownership. – dessert Jul 8 at 20:33
  • 3
    Possible duplicate of How to 'chown' on an NTFS ( or FAT32 ) partition? – dessert Jul 8 at 20:37
  • I recall a similar problem and my solution was to boot into Ubuntu mount the WSL partition and change ownership. Of course if you don't have dual boot you would have to do it from Live USB which is a hundred times slower. – WinEunuuchs2Unix Jul 8 at 22:05
  • 1
    People don't realize you are talking about WSL from within WSL. The duplicate is for Windows from within Linux. @dessert Please consider retracting your close vote. – WinEunuuchs2Unix Jul 8 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.