WSL Linuxは、他のパーティションにディレクトリがあるかどうかを知りません。 - ヘルプ

WSL Linuxは、他のパーティションにディレクトリがあるかどうかを知りません。 - ヘルプ

タイトルでこれを説明します。 WSLに新しいLinuxをインストールしましたが、ラップトップに既存のディレクトリが表示されません。何が問題なのかわからないので、問題を評価するためにオンラインでいくつかの方法を試しましたが、役に立ちませんでした。インストールエラーか、Linuxの愚かな奴だと思うかもしれません。助けてくれてありがとう。項目は次のとおりです。

編集1:問題は、次のコードに示すように、C:\ Users \ someuser \ DocumentsなどのWindowsドライブのディレクトリにアクセスできないことです。 ls を使用して、Linux システムのホームディレクトリにあっても何も表示されないディレクトリを探します。

roman@DESKTOP-QKJTF3S:~$ which ls
/usr/bin/ls
roman@DESKTOP-QKJTF3S:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2021.825.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/MATLAB/R2021a/runtime/win64:/mnt/c/Program Files/MATLAB/R2021a/bin:/mnt/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/120/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/120/DTS/Binn/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/roman/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/roman/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/roman/AppData/Local/atom/bin:/snap/bin
roman@DESKTOP-QKJTF3S:~$ ls
roman@DESKTOP-QKJTF3S:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          459G  375G   85G  82% /
none            459G  375G   85G  82% /dev
none            459G  375G   85G  82% /run
none            459G  375G   85G  82% /run/lock
none            459G  375G   85G  82% /run/shm
none            459G  375G   85G  82% /run/user
tmpfs           459G  375G   85G  82% /sys/fs/cgroup
C:\             459G  375G   85G  82% /mnt/c
roman@DESKTOP-QKJTF3S:~$ ls -la
total 8
drwxr-xr-x 1 roman roman  512 Feb 16 16:08 .
drwxr-xr-x 1 root  root   512 Feb  9 15:08 ..
-rw------- 1 roman roman  285 Feb 16 16:08 .bash_history
-rw-r--r-- 1 roman roman  220 Feb  9 15:08 .bash_logout
-rw-r--r-- 1 roman roman 3771 Feb  9 15:08 .bashrc
drwxr-xr-x 1 roman roman  512 Feb  9 15:08 .landscape
-rw-r--r-- 1 roman roman    0 Feb 16 15:46 .motd_shown
-rw-r--r-- 1 roman roman  807 Feb  9 15:08 .profile
-rw-r--r-- 1 roman roman    0 Feb  9 15:11 .sudo_as_admin_successful
roman@DESKTOP-QKJTF3S:~$ type ls
ls is aliased to `ls --color=auto'
roman@DESKTOP-QKJTF3S:~$ dir
roman@DESKTOP-QKJTF3S:~$ ls
roman@DESKTOP-QKJTF3S:~$ mkdir tmp
roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ cd tmp
roman@DESKTOP-QKJTF3S:~/tmp$ ls
roman@DESKTOP-QKJTF3S:~/tmp$ cd
roman@DESKTOP-QKJTF3S:~$ ls
tmp
roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ find
.
./.bashrc
./.bash_history
./.bash_logout
./.landscape
./.landscape/sysinfo.log
./.motd_shown
./.profile
./.sudo_as_admin_successful
./tmp
roman@DESKTOP-QKJTF3S:~$ ls
tmp
roman@DESKTOP-QKJTF3S:~$
roman@DESKTOP-QKJTF3S:~$ pwd
/home/roman
roman@DESKTOP-QKJTF3S:~$ cd ~/Documents
-bash: cd: /home/roman/Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ~/.Documents
-bash: cd: /home/roman/.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents
-bash: /home/roman/Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents$
-bash: /home/roman/Documents$: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents$ find
-bash: /home/roman/Documents$: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd Documents
-bash: cd: Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ tmp

Command 'tmp' not found, but there are 16 similar ones.

roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ cd /tmp
roman@DESKTOP-QKJTF3S:/tmp$ cd
roman@DESKTOP-QKJTF3S:~$ ./.Documents
-bash: ./.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$

編集2:現在接続されているすべてのファイルシステムを表示する「マウント」コード場所

roman@DESKTOP-QKJTF3S:~$ mount
rootfs on / type wslfs (rw,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
roman@DESKTOP-QKJTF3S:~$ mount -t ext4
roman@DESKTOP-QKJTF3S:~$

編集3:進むにつれて、「c」というファイルシステムがマウントされましたが、その中のファイルが一致しないことがわかりました。

roman@DESKTOP-QKJTF3S:~$ /mnt
-bash: /mnt: Is a directory
roman@DESKTOP-QKJTF3S:~$ /mnt/c
-bash: /mnt/c: Is a directory
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /users
-bash: cd: /users: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Users
-bash: cd: /Users: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ ls
ls: cannot access 'DumpStack.log.tmp': Permission denied
ls: cannot access 'hiberfil.sys': Permission denied
ls: cannot access 'pagefile.sys': Permission denied
ls: cannot access 'swapfile.sys': Permission denied
'$Recycle.Bin'                                             ProgramData                  eula.3082.txt
'$WinREAgent'                                              Recovery                     globdata.ini
Apps                                                     'SOLIDWORKS Data'             hiberfil.sys
Config.Msi                                               'SOLIDWORKS Data (2)'         install.exe
Dell                                                     'System Volume Information'   install.ini
'Documents and Settings'                                   Users                        install.res.1028.dll
Downloads                                                 VC_RED.MSI                   install.res.1031.dll
Drivers                                                   VC_RED.cab                   install.res.1033.dll
DumpStack.log                                             Windows                      install.res.1036.dll
DumpStack.log.tmp                                         cygwin64                     install.res.1040.dll
Games                                                     dell.sdr                     install.res.1041.dll
Intel                                                     eula.1028.txt                install.res.1042.dll
NvContainerRecoveryNVDisplay.ContainerLocalSystem.reg     eula.1031.txt                install.res.2052.dll
NvContainerRecoveryNvBroadcast.ContainerLocalSystem.reg   eula.1033.txt                install.res.3082.dll
NvContainerRecoveryNvContainerLocalSystem.reg             eula.1036.txt                pagefile.sys
OneDriveTemp                                              eula.1040.txt                swapfile.sys
PerfLogs                                                  eula.1041.txt                temp
'Program Files'                                            eula.1042.txt                vcredist.bmp
'Program Files (x86)'                                      eula.2052.txt
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Documents and Settings
-bash: cd: too many arguments
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Documents
-bash: cd: /Documents: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Downloads
-bash: cd: /Downloads: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Downloads
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ cd
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c/.Documents
-bash: cd: /mnt/c/.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents and Settings
-bash: cd: too many arguments
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents_and_Settings
-bash: cd: ./Documents_and_Settings: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Downloads
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ ls
Updater_SA_Upgrade
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ ls -la
total 0
drwxrwxrwx 1 roman roman 512 Apr 16  2020 .
drwxrwxrwx 1 roman roman 512 Feb 11 17:47 ..
drwxrwxrwx 1 roman roman 512 Apr 16  2020 Updater_SA_Upgrade
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$

ベストアンサー1

WindowsストアからWSL Ubuntu Linuxをインストールすると、Windows C:ドライブがLinuxシステムにインストールされ、/mnt/c/.Documentsフォルダにあります/mnt/c/Users/someuser/Documentscd(を使用して作業ディレクトリをC:ドライブに変更できます。結ぶ人Dディレクトリ)いいねcd /mnt/c/

@mashuptwiceが私のようなバカを案内してくれたら、彼らは揺れます。

おすすめ記事