0

On Windows 10 Ubuntu subsystem terminal I tried to inspect the disk usage with the following commands:

sudo -s
cd /mnt/c/Users
du -h --max-depth=1

and got this:

du: cannot read directory './D-Ef/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs': Permission denied
du: cannot read directory './D-Ef/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/temp/{3b734033-965e-4834-ba78-36717e14008d}': Permission denied
Infinity        ./D-Ef
2.7M    ./Default
du: cannot read directory './dmitr': Permission denied
0       ./dmitr
du: cannot read directory './Public/Documents/Hyper-V': Permission denied
1.3M    ./Public
Infinity        .

so obviously root user, for example, does not have the access to these folders.

What Ubuntu user can access Windows folders with administrator privileges?

EDIT1:

if I run Ubuntu.exe as Admin I can assess folders with 'll', but 'du' outputs 'infinity':

enter image description here

EDIT2:

in the current windows user folder I have this:

enter image description here

EDIT3:

another example, both 'll' and 'du' show some strange huge numbers:

enter image description here

enter image description here

My OS versions: Windows 10 1803, ubuntu 18.04.1

Alexey Starinsky
  • 327
  • 1
  • 4
  • 10
  • 2
    Try to run `ubuntu.exe` as Admin. – harrymc May 25 '19 at 10:03
  • @harrymc it is the step to the right direction, but probably there is something still wrong with either 'du' command or with the permissions. see EDIT1. – Alexey Starinsky May 25 '19 at 10:52
  • Are you specifically trying to access AppData or are we talking about any Windows directory? You also must provide us specifics on which version of Windows you are using and what version of Ubuntu you are you using. – Ramhound May 25 '19 at 13:08
  • 1
    I can't reproduce the problem. Running ubuntu as admin, `cd /mnt/c/Users/Harry/AppData/`, then `sudo du -h --max-depth=1`, gives some error messages and then the data without "Infinity". Try maybe to check the disk using `chkdsk`. – harrymc May 25 '19 at 15:08
  • @harrymc try AppData folder of a different user. AppData of the current user works fine on my machine too. – Alexey Starinsky May 25 '19 at 15:30
  • @Ramhound Not only AppData but any home directory of a different windows user. Windows 10 1803, ubuntu 18.04.1 – Alexey Starinsky May 25 '19 at 15:35
  • @harrymc chkdsk.exe found no problem. – Alexey Starinsky May 25 '19 at 15:42
  • 1
    I tried another user, specifically the IIS user, and had no problem. Something is wrong on your computer. – harrymc May 25 '19 at 17:44
  • @harrymc I was able to scan C:\Users\dmitr folder with 'Far Manager' (a windows tool run as Admin) without errors. Far Manager shown me it takes 27.3G of the disk space and AppData takes 833MB. So at least I do not see something wrong at the Windows side. – Alexey Starinsky May 25 '19 at 19:04
  • 1
    The problem is probably with WSL improperly translating Windows permissions to Linux ones, as there is absolutely no one-to-one correspondence between the two models. – harrymc May 25 '19 at 19:09
  • @harrymc Added more examples, see EDIT2, EDIT3. both 'll' and 'du' show some strange huge numbers. – Alexey Starinsky May 25 '19 at 20:11
  • 1
    The WSL implementation is not perfect, as Microsoft has not done a complete port of Ubuntu to Windows. I think you are discovering some of the raw spots. – harrymc May 25 '19 at 20:14
  • @AlexeyStarinsky - Update your question with the relevant information instead of a comment – Ramhound May 25 '19 at 22:19
  • @Ramhound updated. – Alexey Starinsky May 25 '19 at 22:46
  • 1
    I am 99% 1809 WSL brought the required changes to WSL that you are seeking. – Ramhound May 25 '19 at 23:01
  • @Ramhound looks like 1809 is not available yet, at least I have 1803 and my Windows Update page shows 'You're up to date'. – Alexey Starinsky May 27 '19 at 10:54
  • 1
    1809 was released last September. It absolutely is available. The feature your attempting to use does not exist in 1803. – Ramhound May 27 '19 at 17:51
  • @Ramhound I pressed 'Check for updates' button multiple times, but 1809 does not install on my machine, my Windows is still 1803. – Alexey Starinsky May 27 '19 at 21:07
  • 1
    @AlexeyStarinsky - Download and mount a Windows 10 1809 ISO. Launch the setup within Windows. This will upgrade you to Windows 10 1809. If you only want to use Windows Update then verify your system is configured to the Semi-Annual Targeted branch. [Be sure you have Developer Mode turned off as that might be blocking the upgrade to 1809.](https://superuser.com/questions/1407284/cannot-seem-to-get-build-1809-update-installed-on-windows-10?noredirect=1&lq=1) – Ramhound May 27 '19 at 23:33
  • @Ramhound I will try this link https://www.microsoft.com/en-us/software-download/windows10 – Alexey Starinsky May 29 '19 at 15:46
  • @AlexeyStarinsky - Have you verified if what you want works in 1809? – Ramhound May 30 '19 at 22:58
  • @Ramhound I hope, yes. – Alexey Starinsky May 31 '19 at 21:59

0 Answers0