Transferring windows files to linux

How to Copy or Move Files from Windows to Linux

Why shut down to using a single operating system? Today it is possible to install two or more operating systems on the same computer. And although we can do this in several ways (virtual machines, Windows subsystems, etc.), the way to take advantage of the benefits of a 100% operating system is to physically install it on the PC thanks to dual boot, or dual boot. However, when we switch from one system to another we may run into some problems. Especially when trying to access our files from Windows and Linux.

Each operating system uses its own file system. Windows, for example, uses NTFS on its primary partition; macOS uses its own system, APFS ; and Linux, although it is compatible with a good number of file systems, the most used in most distributions is EXT4 . As each system uses its own formats, it is difficult (and dangerous) to access the partitions of other operating systems. So if we are using Linux and we have to access a file saved on the Windows hard drive, what can we do?

Windows to Linux

Save data to a shared hard drive

If we want to avoid this type of problem, the best we can do is create a shared drive where we can save the data of all the operating systems that we use. This unit can be a hard drive or partition that we have internal to our own PC or an external hard drive that we have connected to the PC. The important thing is that this drive has a file system that is compatible with both Windows and Linux. And, although we can use NTFS for this, the best we can choose to avoid problems is exFAT .

Both Windows and Linux will be able to read and write to the exFAT disk without problems. This file system is the improved version of FAT32 that eliminates, among other restrictions, the limit of 4 GB per file. Therefore, we can use it as a link between all our operating systems. The important thing is to make sure that we keep all the data there.

Another alternative that we can use is a NAS server . These servers are connected to the network and allow any user connected to it to access the data. They usually mount an SMB / SAMBA server, so the files will be available from both Windows and Linux.

Other ways to access Windows data from Linux

In this case, we are going to see what we can do if we need to access a file from Linux that we have saved on the Windows hard drive.

Restart your computer

The simplest, and safest at the same time, is to restart the computer and return to Windows . By doing so, we will once again have access to all the files that we had saved on that hard drive and, therefore, we will be able to access it. Now that we are in Windows we can choose, either to do what we wanted to do from the Microsoft operating system, or to transfer the file to Linux, either through a pendrive or from the nexus hard drive that we have explained in the previous point .

Читайте также:  Linux mint phpmyadmin настройка

This is the safest way to do it, since by not entering the Windows hard drive from Linux, we avoid changing permissions or corrupting files, saving us problems. However, it is the slowest method.

Mount the NTFS hard drive

Linux is capable of reading and writing to NTFS drives. The kernel itself has its own controller, and there are other third-party tools for this purpose. Reading files from an NTFS partition from Linux usually works fine, it doesn’t usually give problems. But if we are going to make any changes we run the risk that something does not go well and some data will be corrupted. Windows may be damaged, or we may lose files.

Propiedades carpeta Windows old Ubuntu

If we know what we are going to do, we can mount the Windows NTFS disk and access all its data. As long as we do not touch anything or modify anything, we can copy (yes, better copy than move) the file or files that we need from this unit to the Linux partition, and thus we can work with it without problems.

It is the fastest method, but the most risky. And it will only be possible if we do not have the disk encrypted with Bitlocker.

Recover Linux data from Windows

What if we use Linux, we go back to Windows and we have forgotten a file? Here we have several ways to re-access the data.

Restart the PC

As in the previous case, the safest and easiest way is to restart the computer and re-enter Linux . Once there, we can copy the file to a pendrive or an external hard drive, and restart again to take it to Linux. It is the longest and most tedious process, but it is the safest.

Use a program to read EXT4

Windows, by default, cannot read or write to Linux EXT drives. Therefore, if we want to access the data, it is necessary to install a program that allows us to do so. There is a very varied software, both free and paid, that allows us to do this. However, most of them are quite outdated programs that, although they can work, they can also give errors.

If we are going to avoid writing in these units, and we only want to pass the data, we can resort to these programs. If not, it is better to find another alternative.

Use the Windows Subsystem for Linux

Microsoft is betting very hard to integrate Linux into Windows. Thanks to the Windows Subsystem for Linux , WSL, it is possible to load a complete Linux instance on top of the operating system, thanks to Hyper-V. With the advent of WSL2, Windows is able to mount and use Linux EXT4 drives as if it were a hard drive more connected to the computer.

WSL Linux en Windows 10 build 19603 - 3

If we are advanced users, who have WSL enabled on Windows, and we want to access Linux data from Microsoft’s operating system, this is the best option. Anyway, we hope that Microsoft will simplify this process soon, adding almost native support to EXT4 from Windows.

Читайте также:  Unity plugin for linux

Источник

How to Copy Files from Windows PC to Linux

Copy Files from Windows to Linux

In this article, we’re going to explain how to copy files from Windows PC to Linux to share files and folders between the operating systems. So read on to know more!

How to Copy Files from Windows PC to Linux

If you are a multi-OS user, sometimes you need access to the files stored in the other OS. For instance, if you use a Windows PC and want to access those files from your Linux distribution, you will need a mechanism to access those files. One of the easiest methods is to copy the files.

There are multiple ways to transfer files between the OS. In this guide, we will discuss four particular methods in detail.

Copy Files from Windows PC to Linux Using SSH

Copying files from Windows PC to Linux requires SSH configuration on Linux and PuTTY configuration on Windows. Hence, we have divided this section into two parts. The first part covers SSH configuration on Linux, and the second part describes how to set up PuTTY on Windows to transfer files.

Setup SSH to Copy Files from Windows to Linux

The most common method to transfer files securely between Windows and Linux is to use the SSH protocol. For this method, we will configure the SSH on Linux. Follow these simple steps to copy the files effortlessly.

First, configure SSH on ubuntu using the APT package manager. Open the Terminal by pressing “Ctrl + Alt + T” Execute the command given below:

sudo apt update sudo apt install openssh-server

After that, allow SSH through the UFW firewall. Specifically, type:

You should get a similar output:

Configure firewall

The output indicates that the rule already exists.

Now, to ensure that the SSH service is running on the Linux machine, execute this command:

sudo systemctl status sshd

Next, enable the service to boot at startup time. For this step, use the start command as shown below:

sudo systemctl start sshd

Since transferring files requires the IP address of the destination system, we will find that out as well. Type the following command in the terminal and note the Public IP address:

The output should look something like this:

Configure IP Address

Setup PuTTY to Copy Files from Windows to Linux

Head over to Windows and open PuTTY. If you do not have PuTTY installed, download it from its official website. And install it like any other application. Once the installation is complete, launch the application. It should look something like this:

Copy files from windows to linux using ssh

Type the IP address and port of the Linux system. Also, check the SSH option. Hit the “Enter” key to open the connection to the Linux system.

Now to transfer the files, use the scp command. The syntax for this command looks something like this:

For instance, to transfer a textFile.txt from Local Disk D to /home/sidrah, type:

Alternatively, you can use the wildcard pattern to transfer multiple files straightaway. The asterisk “ * ” wildcard transfers all the contents inside the Images folder. For example:

You will be asked for the password to the Linux machine. Provide the correct password, and you will see the files being transferred.

Copy Files Using PSCP

Apart from SSH and PuTTY, you can also use pscp to copy files to/from Windows and Linux. Follow the step given below to transfer files using pscp.

The first step is to download the appropriate pscp package for Windows. Secondly, copy the pscp.exe from your downloads folder to the C:\Windows\System32 folder. After that, open Windows PowerShell (it is installed by default) and use the pscp command to verify its path.

Читайте также:  Возможно диск скоро станет неработоспособным linux

After that, use this command to transfer files to Linux:

The pscp command takes the following arguments:

  • The password to the Linux system (usually written after the -pw flag).
  • The path where the file resides.
  • The IP address of the Linux machine.
  • The accessible path where the file will be copied.

After that, your file should be copied immediately when you press the “Enter” key.

In case you are using the RSA private/public key pair, the command should look something like this:

Copy File from Windows PC to Linux Using FTP GUI

If you are more comfortable with GUI than a Terminal, use the file transfer tool with a GUI (i.e., FileZilla). FileZilla utilizes the SFTP (Secure File Transfer Protocol) to transfer data between Windows and Linux securely. To get started, download FileZilla from its official website. Also, make sure to choose the appropriate setup according to your OS.

After that, install it in Windows like you would install any other software. Once the installation is complete, launch the application. Click Site Manager > New Site. A dialogue box will open:

Copy files from windows to linux using FileZilla

Enter Hostname and set the protocol to SFTP. Enter 22 in the Port field, set the Log on Type to Normal, and type “User and Password”. Next, click “Connect”. You should see a file explorer with a file transfer option, as shown below:

Configure FileZilla

Right-click on any item and click “Upload” to transfer the files. Like SSH and PuTTY, SFTP clients must be installed on both machines for successful file transfer. Therefore, you should install FileZilla on Linux as well as Windows.

Method # 4: Copy Files Using Shared Network Folders

It is the most straightforward approach to transferring files between machines. However, the approach is unique as you don’t have to use any protocol or client to transfer the files. Instead, you mount the drive over the network consisting of the shared files and folders. To set up this approach, follow these steps:

In Windows Machine, right-click on the “Network icon” to open a menu bar.

Configure Network Settings

Select Open “Network & Internet Setting”. From Settings, choose “Network and Sharing Center”. Click to “Turn on Network Discovery and File and Printer Sharing”. Save the changes and exit Settings.

Copy Files from Windows to Linux Using Shared Network Folders

Next, head over to the folder you want to share. Right-click on the folder and choose “Properties”.

Configure Network

From the dialogue box, open the Sharing tab and Click “Advanced Sharing”. Click on the checkbox to share this folder. Click “OK” to save and apply the settings.

Now, open the Linux machine and select Network. Navigate to Files > Other Locations. There, you will see the Windows-Hosted folder available at your disposal for shared access.

Copy Files from Windows to Linux Using Network

We have discussed how to copy files from Windows PC to Linux in four different ways. Moreover, you can also choose any third-party application to copy files from Windows to Linux apart from the methods discussed in the article. If you have any problems while copying files, don’t hesitate to leave comments below.

If this guide helped you, please share it.

Sidrah is a staff writer at Distroid and has a Masters in Computer Science, with her key two focus areas being SQL and DevOps. She has written over 100 posts and specializes in all things Linux. She also has experience trying out various other distros, BASH scripting, Git, and software testing. LinkedIn GitHub

Leave a Reply

You must be logged in to post a comment.

Источник

Оцените статью
Adblock
detector