How to mount NTFS drive on CentOS

Photo of author

By rasho

The New Technology File System (NTFS) is a proprietary file system created by Microsoft and is used extensively in Microsoft’s Windows operating systems. By default most Linux distributions are not able to mount NTFS, however it is possible to install a driver that allows us to do this so that we can read and write data to an NTFS disk.
This tutorial will show you how to mount an NTFS drive ina read/write mode on CentOS and other RHEL based Linux operating systems with ntfs-3g driver. NTFS3G is an open source cross-platform, stable, GPL licensed, POSIXNTFS R/W driver used in Linux. It provides safe handling of Windows NTFS file systems viz create, remove, rename, move files, directories, hard links, etc.

Enable the EPEL repository

First you need to enable EPEL (Extra Packages for Enterprise Linux) Repository. Run the following command as root user on t he shell to enable the EPEL repository.

# yum -y install epel-release

EPEL (Extra Packages for Enterprise Linux) is a Fedora Special Interest Group that creates, maintains, and manages a set of additional high quality packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Linux (OL).

Install ntfs-3g driver

Once EPEL is installed and enabled, let’s install ntfs-3g package using the below command with root user.

# yum -y install c

Fuse Install

Next, install and load FUSE driver to mount detected devices with below command. FUSE module is included in the kernel itself in version 2.6.18-164 or newer.

# yum -y install fuse
# modprobe fuse

[ads]

Mount NTFS partition

Once installed, we create a directory where the NTFS drive shall be mounted:

# mkdir /mnt/ntfs

Now we can mount the NTFS partition by running this command:

# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs

In this example, my NTFS partition is the device /dev/sdb1. You have to replace that with the device name of your NTFS partition.
The mount point will exist until reboot or until you unmount it with:

# umount /mnt/ntfs

To mount the NTFS partition permanently, add the following line to the /etc/fstab file.
Open /etc/fstab with an editor:

# nano /etc/fstab

And add the line:

/dev/sdb1 /mnt/ntfs ntfs-3g defaults 0 0

Again, replace /dev/sdb1 with the device name that matches your setup. Now your Linux system will mount the NTFS drive automatically at boot time.
That is all. If you have any questions please don’t forget to comment out.

1 thought on “How to mount NTFS drive on CentOS”

  1. Do you recommend NTFS for shared storage in docker environment? Considering a docker swarm environment across different locations?

    Reply

Leave a Comment