How to Mount Windows Partitions in Ubuntu?


Ubuntu, one of the most popular Linux distributions, offers a versatile and powerful environment for users to explore and accomplish various tasks. If you're someone who frequently works with both Windows and Ubuntu, you might find it necessary to access and manipulate Windows partitions within your Ubuntu system. Fortunately, Ubuntu provides seamless support for mounting Windows partitions, allowing you to effortlessly read and write data stored on those partitions.

In this blog post, we will guide you through the process of mounting Windows partitions in Ubuntu, step by step. We will explore the required preparations, the actual mounting process, and provide useful tips for working with mounted partitions.

Understanding Windows Partitions

Before we delve into the process of mounting Windows partitions in Ubuntu, let's take a moment to understand the concept of disk partitions and familiarize ourselves with the different types of Windows partitions and file system formats.

Explanation of Disk Partitions

In the realm of storage, a disk partition refers to a logical division or section of a physical disk drive. Each partition functions as a separate unit with its own file system, allowing for the organization and management of data. Disk partitions play a vital role in ensuring efficient disk utilization and data management.

Overview of Windows Partition Types

Windows systems typically consist of multiple partitions, each serving a specific purpose. The common types of partitions you might encounter in a Windows setup include 

  • System Partition  This partition contains the essential files required for system startup, including the boot loader and boot configuration data.

  • Boot Partition  The boot partition contains the operating system's core files necessary for booting up the system.

  • Reserved Partition  Also known as the Microsoft Reserved Partition (MSR), this partition serves as a placeholder for future disk management.

  • Primary Partition  Primary partitions are the standard partitions where the operating system and user data reside.

  • Extended Partition  Extended partitions can be further divided into logical drives and are primarily used to overcome the limitation of four primary partitions.

File System Formats (NTFS, FAT32, etc.)

Windows partitions utilize different file system formats to organize and store data. The most common file systems used in Windows include 

  • NTFS (New Technology File System)  NTFS is the default file system used by modern versions of Windows, offering advanced features such as file compression, encryption, and access control.

  • FAT32 (File Allocation Table)  FAT32 is an older file system that offers compatibility with various operating systems but lacks advanced features like file permissions and security.

In the next section, we will cover the necessary preparations to enable Windows partition mounting in Ubuntu.

Preparing Ubuntu for Mounting Windows Partitions

Before we can start mounting Windows partitions in Ubuntu, we need to ensure that our system is properly prepared. This involves checking for required packages and installing necessary tools that enable seamless integration between Ubuntu and Windows partitions.

Checking for Required Packages

Ubuntu typically includes the necessary components to mount Windows partitions out of the box. However, it's always a good idea to double-check if the required packages are installed on your system. Open a terminal and run the following command −

sudo apt-get update
sudo apt-get install ntfs-3g

The ntfs-3g package provides read and write support for the NTFS file system commonly used in Windows partitions. If the package is already installed, the terminal will display the latest version. Otherwise, the installation process will begin, and you'll be prompted for your password.

Installing Necessary Tools

In addition to the ntfs-3g package, we may also need a few other tools to simplify the process of mounting Windows partitions. One such tool is ntfs-config, which provides a graphical interface to manage NTFS partitions in Ubuntu.

To install ntfs-config, use the following command −

sudo apt-get install ntfs-config

Once installed, you can access ntfs-config from the Applications menu or by running sudo ntfs-config in the terminal.

With the required packages and tools in place, we're now ready to proceed with the actual mounting of Windows partitions in Ubuntu. In the next section, we'll explore the steps involved in identifying Windows partitions and creating mount points.

Mounting Windows Partitions in Ubuntu

To access Windows partitions in Ubuntu, we need to identify the partitions and create mount points to establish a connection between the Ubuntu file system and the Windows partitions. In this section, we will cover the steps required to mount Windows partitions manually and set them to automount at boot.

A Identifying Windows Partitions

Before we can mount Windows partitions, we need to identify them. Ubuntu provides several ways to identify the available partitions −

  • Using Disks Utility  Open the Disks utility by searching for "Disks" in the Ubuntu Applications menu. The Disks utility displays all the connected drives and partitions. Identify the Windows partitions based on their size, file system (e.g., NTFS), or partition label.

  • Using Terminal and "lsblk" Command  Open a terminal and run the following command 

lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

This command lists the available disks and their partitions along with their file systems, sizes, mount points, and labels.

Once you have identified the Windows partition(s) you want to mount, make note of their names (e.g., /dev/sda2, /dev/nvme0n1p3, etc.) as we will need this information in the subsequent steps.

Creating Mount Points

A mount point is a directory in the Ubuntu file system where the Windows partition will be attached. We need to create a mount point before we can mount a Windows partition. Choose a suitable directory name to represent the partition, such as /mnt/windows, and create the mount point using the following command 

sudo mkdir /mnt/windows

Replace /mnt/windows with the desired path for your mount point.

Mounting Partitions Manually

To manually mount a Windows partition, use the mount command followed by the partition name and mount point. Open a terminal and run the following command, replacing <partition> with the actual partition name (e.g., /dev/sda2) and <mount-point> with the path of the mount point (e.g., /mnt/windows) 

sudo mount <partition> <mount-point>

After running the command, the Windows partition will be mounted, and you can now access its contents through the specified mount point.

Automounting Partitions at Boot

To automatically mount Windows partitions at boot, we need to make a few modifications. First, we need to find the UUID (Universally Unique Identifier) of the Windows partition. Run the following command in the terminal, replacing <partition> with the actual partition name (e.g., /dev/sda2) 

sudo blkid <partition>

Make note of the UUID displayed for the partition.

Next, we need to edit the /etc/fstab file, which contains information about the file systems to be mounted at boot. Open the /etc/fstab file using a text editor with administrative privileges, such as 

sudo nano /etc/fstab

Add the following line to the end of the file, replacing <UUID> with the UUID of the Windows partition and <mount-point> with the path of the mount point (e.g., /mnt/windows) 

UUID=<UUID> <mount-point> ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0

Save the changes and exit the text editor.

Upon the next system reboot, Ubuntu will automatically mount the Windows partition at the specified mount point.

In the next section, we'll explore how to navigate through mounted Windows partitions and perform file operations.

Working with Mounted Windows Partitions

Now that we have successfully mounted the Windows partitions in Ubuntu, let's explore how to navigate through the mounted partitions and perform file operations.

Navigating through Mounted Partitions

To access the contents of a mounted Windows partition, open the file manager (such as Nautilus) and navigate to the mount point directory. In our example, that would be /mnt/windows. You will see the files and folders from the Windows partition just as you would with any other directory in Ubuntu.

You can browse, open, and interact with the files and folders in the mounted partition using the file manager or the terminal.

Performing File Operations

Working with files in a mounted Windows partition is similar to working with files in the Ubuntu file system. You can perform various file operations, including copying, moving, renaming, and deleting files and folders.

For example, to copy a file named document.txt from the mounted Windows partition to your Ubuntu home directory, you can use the following command in the terminal −

cp /mnt/windows/document.txt ~/Desktop/

This command copies the file to the Desktop directory within your home directory.

Similarly, you can use commands like mv to move files, rm to remove files, and rename to rename files and folders within the mounted Windows partition.

Modifying Permissions and Ownership

By default, when mounting Windows partitions in Ubuntu, the files and directories within the mounted partition retain their original ownership and permissions. This means that you might encounter permission restrictions when trying to modify or delete certain files.

To overcome this, you can modify the ownership and permissions of files and directories within the mounted Windows partition. Use the chown and chmod commands in the terminal to change ownership and permissions, respectively.

For example, to change the ownership of a file named data.docx in the mounted Windows partition to the current user, you can use the following command 

sudo chown <your-username> /mnt/windows/data.docx

Replace <your-username> with your actual Ubuntu username.

Remember to exercise caution when modifying permissions and ownership, as it can affect the security and stability of the files and partitions.

In the next section, we will discuss the process of unmounting Windows partitions properly.

Unmounting Windows Partitions

When you're done working with a mounted Windows partition or need to disconnect it from your Ubuntu system, it's essential to unmount the partition properly to ensure data integrity. In this section, we will cover the two methods of unmounting Windows partitions: manual unmounting and unmounting at system shutdown.

Manual Unmounting

To manually unmount a Windows partition, open a terminal and use the umount command followed by the mount point of the partition. For example, to unmount a partition mounted at /mnt/windows, run the following command 

sudo umount /mnt/windows

This command unmounts the partition, and you can safely disconnect it from your Ubuntu system.

Unmounting at System Shutdown

To automate the unmounting process and ensure that Windows partitions are unmounted gracefully during system shutdown, we can modify the /etc/fstab file.

Open the /etc/fstab file using a text editor with administrative privileges, such as 

sudo nano /etc/fstab

Locate the line that corresponds to the Windows partition you want to unmount at shutdown. It should resemble the following line 

UUID= <mount-point> ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0

Add the noauto option to the line, like this 

UUID=<UUID> <mount-point> ntfs-3g defaults,windows_names,locale=en_US.utf8,noauto 0 0

Save the changes and exit the text editor.

With this modification, Ubuntu will no longer attempt to automatically mount the Windows partition at boot, but it will still be mounted manually when required. Additionally, it will be automatically unmounted during system shutdown, ensuring a proper disconnection from your Ubuntu system.

Conclusion

Mounting Windows partitions in Ubuntu opens up a world of possibilities for accessing and manipulating data across operating systems. In this blog post, we explored the step-by-step process of mounting Windows partitions in Ubuntu, from preparing the system to identifying partitions and creating mount points. We also discussed how to navigate through mounted partitions, perform file operations, and unmount partitions properly.

Updated on: 09-Aug-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements