Как найти windows папки в ubuntu


Download Article

Maintain access to your Windows files when migrating to Ubuntu


Download Article

One of the biggest difficulties migrating to Ubuntu is losing access to your windows files. Fortunately, it is not too difficult to overcome this…but read the warnings before trying this out. All that is needed is to mount the windows partition after you boot into Ubuntu. Of course, the first problem is determining which partition contains the windows files.

Things You Should Know

  • Navigate to System → Administration → Synaptics Package Manager to locate and install gparted. Then, run it from System → Partition Editor
  • Open a terminal and type sudo -s to root yourself.
  • Type the prompt «mkdir /mnt/windows». Then, type {{{1}}}.
  • Be sure to replace /dev/sda2 with the partition name you located earlier with the Partition Editor.

Steps

  1. Image titled Access Windows Files in Ubuntu Step 1

    1

    Install gparted (System → Administration → Synaptics Package Manager → search for gparted, mark it for installation and, when it installs, run it from System → Partition Editor). Look for an NTFS partition – it is likely to be the one windows is on.

  2. Image titled Access Windows Files in Ubuntu Step 2

    2

    Having located the partition, write down the name – it will look something like /dev/hda2 or /dev/sda2, depending if your drives are PATA, SCSI or SATA. Do this carefully – Now check to see if this is the partition by manually mounting it and looking at the files.

    Advertisement

  3. Image titled Access Windows Files in Ubuntu Step 3

    3

    Open a terminal (Application → Accessories → Terminal) and make yourself root by typing sudo -s and pressing enter. You will be prompted for the root password and will then become root. Being root assumes that you know what you are doing – you could easily cause disaster if you make a mistake, so concentrate. Carefully type this line at the prompt and press enter

  4. Image titled Access Windows Files in Ubuntu Step 4

    4

    Type the prompt. mkdir /mnt/windows

  5. Image titled Access Windows Files in Ubuntu Step 5

    5

    Replace the name. You may replace /mnt/windows with /mnt/windrv or any other name you prefer. Having created the directory that is going to hold your windows files, type the following command carefully at the prompt and press enter

  6. Image titled Access Windows Files in Ubuntu Step 6

    6

    Type the command. mount -t ntfs /dev/sda2 /mnt/windows -o «umask=022»

  7. Image titled Access Windows Files in Ubuntu Step 7

    7

    Make sure you replace /dev/sda2 with the name of the windows partition you wrote down. Now access the mounted drive and ensure that you can read the files by going to Places → Computer and navigating to /mnt/windows. If you can see your files, you are all set. If not, you’ve mounted the wrong drive, unmount it using umount /dev/sda2, making sure that you use the correct name for your drive.

  8. Advertisement

Add New Question

  • Question

    It says that it can’t find /dev/sda/2 in /etc/fstab. What does that mean?

    Living Concrete

    Living Concrete

    Top Answerer

    The location will not always be /dev/sda2. It may be something else on your system. You will need to look at GPartEd in order to figure out what you need to type in for the mount command. Also, you put an extra ‘/’ in /dev/sda2 right before the 2. This may have affected your mount command as well.

  • Question

    What does it mean when it says Mount is denied because the NTFS volume is already exclusively opened?

    Somone

    It means something else is already accessing the volume. Make sure that no other programs are using the volume and try again.

  • Question

    My root password is wrong. What can I do?

    Somone

    You will have to change your root password. The root password is typically the administrator’s login password. But if it’s not, you will have to change it by editing boot commands.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • Start a text editor as root by typing gedit /etc/init.d/mountwinfs.sh. Copy the lines below into the text editor and save it as /etc/init.d/mountwinfs.sh.

  • Now, you will probably want to have the computer boot up and automatically mount the windows drive so you can save files back and forth seamlessly. This is easily achieved via a script that loads at startup. The commands in the script will have to be run with root permissions, so you will have to save the file in /etc/init.d. You are going to use the same command you used manually. Most of the other lines in the script are comments.

Thanks for submitting a tip for review!

Advertisement

  • Always back your important files up before making changes to your system.

  • Leave yourself plenty of time to recover — never do this before a deadline.

  • Always verify your backup before trusting it.

Advertisement

About This Article

Thanks to all authors for creating a page that has been read 653,689 times.

Is this article up to date?

Добрый день всем!
Проблема в том, что я скачал файлы и не могу понять где они хранятся, скачал я их через WSL
То есть надо понять где же корневой каталог его
В ВСЛ корень вот так прописан alejan@LAPTOP-IFFGH0V4:
А когда я набираю команду ls то я в консоли вижу необходимые мне файлы, но вот вытащить из самой директории (не через линукс) у меня не получается, так как я не могу найти корень и по поиску в винде не получается найти по наименованию файлов
Подскажите пожалуйста как идентифицировать где в винде создался корневой каталог ВСЛ?


  • Вопрос задан

    более двух лет назад

  • 7825 просмотров

Я установил подсистему Ubuntu в Windows 10 (после включения функции в настройках), но где находится корневой каталог файловой системы Ubuntu на диске?

2016-04-21 10:06

6
ответов

Решение

Для Ubuntu, установленного из магазина Windows:

Каждый дистрибутив, который вы устанавливаете через хранилище, устанавливается в каталог appdata этого приложения. Например: C:Users<username>AppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalState — бениллис

На более ранних итерациях подсистемы Windows для Linux файловая система Ubuntu %localappdata%Lxss (например, C:UsersUsernameAppDataLocalLxss — заменить имя пользователя на имя пользователя в Windows). Смотрите сообщение в блоге WSL о поддержке файловой системы:

Основной файловой системой, используемой WSL, является VolFs. Он используется для хранения системных файлов Linux, а также содержимого вашего домашнего каталога Linux. Таким образом, VolFs поддерживает большинство функций Linux VFS, включая разрешения Linux, символические ссылки, FIFO, сокеты и файлы устройств.

VolFs используется для монтирования корневого каталога VFS, используя %LocalAppData%lxssrootfs в качестве резервного хранилища. Кроме того, существует несколько дополнительных точек монтирования VolF, особенно /root а также /home которые установлены с использованием %LocalAppData%lxssroot а также %LocalAppData%lxsshome соответственно. Причина этих отдельных подключений заключается в том, что при удалении WSL домашние каталоги не удаляются по умолчанию, поэтому все личные файлы, хранящиеся там, будут сохранены.

ВНИМАНИЕ

Создание / изменение любых файлов в подсистеме Linux с помощью приложений и инструментов Windows может привести к повреждению данных и потере данных в подсистеме Ubuntu! (Спасибо Ричу Тернеру за эти слова предостережения!) Это абсолютно не поддерживается. Из того же сообщения в блоге:

Совместимость с Windows

Хотя файлы VolFs хранятся в обычных файлах Windows в указанных выше каталогах, совместимость с Windows не поддерживается. Если новый файл добавляется в один из этих каталогов из Windows, ему не хватает советников, необходимых для VolF, поэтому они не знают, что делать с файлом, и просто игнорируют его. Многие редакторы также удаляют советники при сохранении существующего файла, снова делая файл непригодным для использования в WSL.


Ваша файловая система Windows находится по адресу /mnt/c в среде оболочки Bash.

Источник: блог Дастина Киркленда, howtogeek


souravc

21 апр ’16 в 10:34
2016-04-21 10:34

2016-04-21 10:34

Похоже, что это изменилось с тех пор, как Bash был изначально представлен, и не распространяется на дистрибутивы из Магазина Windows, или, возможно, он не совместим со всеми системами, поскольку мой домашний каталог находится в другом месте:

%localappdata%lxsshome{username}

или же:

C:Users{user}AppDataLocallxss{username}

куда {user} ваше имя пользователя Windows и {username} ваше имя пользователя UNIX установлено во время установки.

Таким образом, корневой каталог будет:

%localappdata%lxss

Обратите внимание, что корневой каталог может не отображаться в проводнике Windows из %localappdata% каталог. Вы должны иметь возможность получить к нему доступ в любом случае, набрав его в «адресной строке» Explorer.

2016-08-10 18:35

Если вы устанавливаете Linux с MS Market:

  • Бесплатная Ubuntu в магазине Windows
  • Бесплатный Open Suse в магазине Windows

они поместили дистрибутивы под:

$ cat /proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Lxss/{861c29b4-ebe2-49a5-8a22-7e53a27934a0}/BasePath
C:UsersuserAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalState

Дистрибутив по умолчанию определяется как:

bash# cat /proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Lxss/DefaultDistribution
{861c29b4-ebe2-49a5-8a22-7e53a27934a0}

Корень Linux глубже:

c:/Users/user/AppData/Local/Packages/46932SUSE.openSUSELeap42.2_022rs5jcyhyac/LocalState/rootfs

PS. Я использовал Cygwin для изучения ключей реестра.

Если использовать PowerShell для той же цели, команды будут такими:

# obtain the value of the ID of the default Linux distribution (and store it in a variable to avoid escaping characters issues):
$DEFAULT_LXSS_ID = (Get-ItemPropertyValue -Path REGISTRY::HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionLxss -name DefaultDistribution)

# which will have a value like:
echo  $DEFAULT_LXSS_ID
{bde539d6-0c87-4e12-9599-1dcd623fbf07}

# display the directory containing the rootfs Windows directory (mapped to the / Linux directory)
Get-ItemPropertyValue -Path REGISTRY::HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionLxss$DEFAULT_LXSS_ID -name BasePath | Format-List -property "BasePath"
%LocalAppData%PackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalState

PPS. https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/


gavenkoa

13 сен ’17 в 14:54
2017-09-13 14:54

2017-09-13 14:54

Единственное, что сработало для меня, было %localappdata%lxsshome{username}, где {username} ваше имя пользователя BASH, которое вы указали при установке. Почему-то после показа скрытой папки lxss отказывается появляться в C:UsersWINDOWS-USERAppDataLocal, а также дает полный C: путь с windows и BASH username тоже не работает.

И, пожалуйста, создайте ярлык на рабочем столе для того, что работает.

2017-06-09 17:02

Для тех, кто ищет расположение образа: C:Users[имя пользователя]AppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalStateext4.vhdx

2020-12-09 22:29

Cover image for Access the Windows file system through WSL!

Have you ever wondered, how to access the windows file system through WSL? If the answer is yes you are in the right place!

Microsoft WSL has given us an incredible way to access the windows file system, you have just to navigate through an exact path to do it. Without further due, let’s dive into the topic.

1. Use the cd command in the Linux terminal.

To access the windows files you have to navigate through /mnt/your_windows_path

cd /mnt/c/Users
**OR**
cd /mnt/d/your_folder/your_folder

Enter fullscreen mode

Exit fullscreen mode

Now you have access to every file in the Linux and Windows file systems.

2. Moving files between the two systems through WSL.

If you want to move files between the two operating systems you can simply use the cp or mv commands.
cp — command for copying files
mv — command for moving files
Use of cp command

cp /mnt/c/file.txt /home/username/Documents

Enter fullscreen mode

Exit fullscreen mode

Use of mv command

mv  /mnt/c/file.txt /home/username/Documents

Enter fullscreen mode

Exit fullscreen mode

3. Editing windows files through WSL.

To edit windows files through the Linux terminal using WSL, you have to use any text editor that can be opened in the terminal. One of the most famous text editors is nano. In our example, I am going to use the nano editor.
Type into the terminal nano and the path to the file.

sudo nano /mnt/c/Users/file.txt

Enter fullscreen mode

Exit fullscreen mode

Now you can edit freely files from your terminal.

4. Creating files in windows through WSL.

To create a file in a specific windows directory you have first to navigate to it and then use the touch command to create a file.
touch — a command that creates a file.
!!! The file extension can be anything you want.

cd /mnt/c/Users/Public/Documents/ 
touch filename.txt

Enter fullscreen mode

Exit fullscreen mode

The file is created and can be opened from both systems.

5. Deleting files from the windows file system through WSL.

To delete windows files using WSL, you have to navigate to the directory where the file lives and use the rm command.
rm — a command that deletes files / directories

cd /mnt/c/Users/Public
sudo rm example_file.jpg

Enter fullscreen mode

Exit fullscreen mode

Congratulations you learned 5 vital skills about working with the Linux terminal. 🎺🎺🎺
If you have any questions, comment down, I will answer as soon as possible.

On the Bash on Ubuntu on Windows app, I only have

root@localhost:~# ls -a
    .bash_history  .bashrc  .profile

How do I access all of the Windows folders like Documents, Downloads, etc.?

Hastur's user avatar

Hastur

18.6k8 gold badges51 silver badges95 bronze badges

asked Apr 16, 2016 at 17:33

Sergei Wallace's user avatar

Sergei WallaceSergei Wallace

2,8295 gold badges16 silver badges18 bronze badges

You’ll find the Windows C: structure at /mnt/c/ in the Bash environment.

Therefore, my Documents folder is at /mnt/c/Users/Ben/Documents/.

answered Apr 16, 2016 at 17:39

Ben N's user avatar

13

Alternatively,

  1. Hold down Shift while right-clicking in your desired Windows directory
  2. Select «Open PowerShell window here«

PowerShell Context Menu

  1. Once you’re in PowerShell, type bash

You’ll be able to use any Bash commands directly to operate on the files and folders in that Windows directory. By using this method, you don’t have to manually cd into your directories especially when you’ve a deep-rooted directory to access.


Update as of Windows 10 1809:

Above still works, but there’s an easier method now.

  1. Hold down Shift while right-clicking in your desired Windows directory
  2. Select «Open Linux shell here«

answered Oct 11, 2017 at 5:14

Keith OYS's user avatar

Keith OYSKeith OYS

4814 silver badges6 bronze badges

8

Понравилась статья? Поделить с друзьями:
  • Как найти ютуб на экспресс панели
  • Нашел карту как узнать владельца по номеру
  • Как найти свое место для пмж
  • Как найти пещеру ящеров в террарии
  • Как мужик двух генералов прокормил найти сатиру