Как найти файлы 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?


Загрузить PDF


Загрузить PDF

При переходе на Ubuntu необходимо получить доступ к файлам Windows. Это не так сложно сделать, но перед этим прочитайте раздел «Предупреждения». Для получения доступа к файлам Windows нужно найти и подключить раздел, содержащий эти файлы.

Шаги

  1. Изображение с названием Access Windows Files in Ubuntu Step 1

    1

    Установите программу GParted, нажав System → Administration → Synaptics Package Manager; в поисковой строке введите gparted, установите эту программу и запустите ее, нажав System → Partition Editor. Найдите раздел в формате NTFS — это, скорее всего, раздел с файлами Windows.

  2. Изображение с названием Access Windows Files in Ubuntu Step 2

    2

    После того, как вы нашли раздел Windows, запишите его имя; оно выглядит примерно так: /dev/hda2 или /dev/sda2, в зависимости от типа вашего жесткого диска (PATA, SCSI или SATA). Теперь проверьте правильность выбора раздела; для этого подключите его и откройте папки с файлами.

  3. Изображение с названием Access Windows Files in Ubuntu Step 3

    3

    Откройте терминал и получите права суперпользователя (рута), введя sudo –s и нажав Enter. Будьте осторожны, работая из-под рута – одна ошибка может привести к краху системы. В терминале введите следующую команду и нажмите Enter:

  4. Изображение с названием Access Windows Files in Ubuntu Step 4

    4

    mkdir /mnt/windows

  5. Изображение с названием Access Windows Files in Ubuntu Step 5

    5

    Вы можете заменить /mnt/windows на /mnt/windrv или любое другое имя, которое вам нравится. Теперь в терминале введите следующую команду и нажмите Enter:

  6. Изображение с названием Access Windows Files in Ubuntu Step 6

    6

    mount -t ntfs /dev/sda2 /mnt/windows -o «umask=022»

  7. Изображение с названием Access Windows Files in Ubuntu Step 7

    7

    Замените /dev/sda2 на имя вашего раздела с файлами Windows (которое вы записали раньше). Теперь откройте подключенный раздел и убедитесь, что вы можете открыть файлы Windows. Для этого нажмите Places → Computer и откройте /mnt/windows. Если отображается список файлов Windows, то все настроено правильно. В противном случае вы подключили не тот раздел; отключите его, введя команду umount /dev/sda2 (с правильным именем раздела).

    Реклама

Советы

  • Из-под рута запустите текстовый редактор, введя команду gedit /etc/init.d/mountwinfs.sh Скопируйте нижние строки и сохраните файл как gedit /etc/init.d/mountwinfs.sh
  • Теперь необходимо настроить автоматическое подключение раздела с файлами Windows при загрузке Ubuntu (чтобы обмениваться файлами между двумя системами). Это делается при помощи скрипта, запускаемого при загрузке системы. В скрипт запишите команду подключения раздела, описанную выше, и сохраните скрипт из-под рута в /etc/init.d.

Реклама

Предупреждения

  • Перед внесением изменений в системе сделайте резервную копию важных файлов.
  • Перед восстановлением файлов из резервной копии проверьте ее целостность.
  • Запаситесь временем для восстановления файлов из резервной копии.

Реклама

Об этой статье

Эту страницу просматривали 39 337 раз.

Была ли эта статья полезной?

Yes, just mount the windows partition from which you want to copy files. Drag and drop the files on to your Ubuntu desktop. That’s all.

Mounting a partition can be done manually or automatically,

sudo mkdir /media/windows
sudo mount /dev/sdaX /media/windows
    # X = partition number

Now your windows partition should be mounted inside /media/windows directory.

After you clicked on the corresponding partition icon(which was on the unity), it get automatically mounted inside /media/$USER directory. To copy files from windows partition to Ubuntu desktop, you have to run these command,

cp /media/$USER/xxxxxxx/folder ~/Desktop
    # To copy a folder to your Ubuntu desktop

cp /media/$USER/xxxxxxx/folder/* ~/Desktop
    # To copy all the files inside that folder to Ubuntu desktop

cp /media/$USER/xxxxxxx/folder/filename ~/Desktop
    # To copy specific file to your Ubuntu desktop

xxxxxxx — label name of the Windows partition.

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

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.

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