mount NTFS partition on Linux in simple steps.

mount NTFS partition on Linux in simple steps.

Spread the love

NTFS, NT File System, or New Technology File System is a file system that Microsoft invented. In other words, it is the default file system Windows NT family, that is to say, till Windows 2008 R2. Later Windows releases have ReFS beside it. This article will explain, by example,  how to mount ntfs partition on Linux.

Why Linux can’t mount NTFS partitions?

Linux is free software work under GPL (GNU Public license). GPL grants permission to reuse or modify the source code to make derivative works, however, if you distribute your software, it requires you to license your derivative work under GPL too. that is to say, you have to make your code available to your users and allow them to further modify and redistribute it. Therefore, Linux can’t include any proprietary software, like graphic drivers or audio codecs.

To allow Linux to read and write files in NTFS partitions,  It needs a driver ( ntfs-3g ) to recognize it. Fortunately, most Linux distributions include and use NTFS-3G by default. Next, we will explain the steps in three :

  • install the drivers.
  • mount NTFS partition.
  • Permanent mount NTFS.

Give it what it needs!

To Install ntfs-3g drivers. You need to enable a repository EPEL ( Extra Packages for Enterprise Linux ). If you don’t have it, then follow the instructions in these articles :

Next,  Install driver packages by executing your Operating system counterpart command.

Enable ntfs-3g on CentOS 7 and OEL 7 .

Enable ntfs-3g on CentOS 8 and OEL 8.

Enable ntfs-3g on Ubuntu or Debian.

By executing the following command, you will give you OS the capability to mount NTFS partitions.

Install ntfs-3g from source code.

For maximum stability use The ntfs-3g package which comes with your distributions. On the other hand, if it’s too old, you might want to compile the latest version from the source. If so, then follow these instructions.

make sure you have installed the basic development tools (gcc compiler, libc-dev libraries)

Download ntfs-3g latest version, then extract it, next, navigate into NTFS-3g directory.

Proceed with the compilation process. Initially, verify the compilation requirement.

Then, Compile the files

Finally, install the driver, thus distribute binary files into OS directories.

if you aren’t root

Mount your NTFS partition.

If there was no error during installation then you can mount the NTFS volume in a read-write mode for everybody as follows. Just replace /dev/sda1, and /mnt/ntfs_partition with your relevant paths.

Linux permanent mount for NTFS partitions.

The configuration file /etc/fstab contains the information for automating partition mounting. Basically, fstab provides The OS with a list of internal devices, CD/DVD devices, and network shares (samba/NFS/sshfs) to mount in its startup.

You can set mount options in fstab which are similar to mount command. Hence, you must the proper options to mount your partition.

The syntax of a fstab entry as follows:

[Device]      [Mount Point]     [File System Type]    [Options]    [Dump]     [Pass]

The following examples of how to add  NTFS partition to your fstab

Example 1:  mount NTFS partition meanwhile, ownership user and group and access permissions for files and directories to 655

Example 2: mount we added file system encoding. Keep in mind that you will need to set access permission in a later step.

Example 3: Simple mount for partition without any additional options

 

in brief, In recent years, If you follow these steps, you will access your NTFS partition. unless your Windows OS was not cleanly shutdown.