Mount Windows NTFS File System

This section provides a tutorial example on how to mount Windows NTFS (New Technology File System) file systems on Linux systems. 'ntfs-3g' device driver is needed.

If you have a hard disk partition formatted in Windows NTFS (New Technology File System) format, you may need to install addition device driver to mount it on Linux systems. Here is what I did to mount a NTFS partition on my CentOS 8 computer.

1. Check disk partitions and their formats. The output shows that partition /dev/sda5 uses NTFS format.

herong$ sudo fdisk -l /dev/sda

Disk /dev/sda: 900.0 GiB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048  167776255  167774208    80G  7 HPFS/NTFS/exFAT
/dev/sda2        167776256 1953523711 1785747456 851.5G  f W95 Ext'd (LBA)
/dev/sda5        167778304 1748721663 1580943360 753.9G  7 HPFS/NTFS/exFAT
/dev/sda6       1748723712 1750820863    2097152     1G 83 Linux
/dev/sda7       1750822912 1953523711  202700800  96.7G 8e Linux LVM

2. Try to mount it with default options. I am getting the "unknown filesystem type 'ntfs'" error.

herong$ sudo mount /dev/sda5 /mnt
mount: /mnt: unknown filesystem type 'ntfs'.

herong$ sudo mount -t ntfs /dev/sda5 /mnt
mount: /mnt: unknown filesystem type 'ntfs'.

3. Search Internet NTFS driver for CentOS and found "ntfs-3g" package.

4. Try to install "ntfs-3g" package with the "dnf" tool. But not available in CentOS package repository.

herong$ sudo dnf search ntfs
No matches found.

herong$ sudo dnf search ntfs-3g
No matches found.

5. Get the source code of ntfs-3g

herong$ wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz

herong$ tar zxvf ntfs-3g_ntfsprogs-2017.3.23.tgz

6. Compile and install it. "Make" and "GCC" are required.

herong$ cd ntfs-3g_ntfsprogs-2017.3.23

herong$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
...
You can type now 'make' to build ntfs-3g.

herong$ make
(some warnings)
...

herong$ sudo make install
...
libtool: install: /usr/bin/install -c .... /usr/local/bin/ntfs-3g.probe
libtool: install: /usr/bin/install -c .... /bin/ntfs-3g
libtool: install: /usr/bin/install -c .... /bin/lowntfs-3g
...

7. Mount the NTFS partition again with "ntfs-3g" drive:

herong$ sudo mount -t ntfs-3g /dev/sda5 /mnt
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.

herong$ df
...
/dev/sda5           790471676 416858252 373613424  53% /mnt

Cool. I can read my old files on the Windows disk on my CentOS computer now!

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

File Systems

 "df" - Display Free Space of File System

 Mount USB Drive as File System

 "dd" - Copy Data from/to Storage Devices

 Use "dd" Command to Test I/O Speed

 "du" - Display Disk Usage of Directories

Mount Windows NTFS File System

 Access Persmissions on "ntfs-3g" File System

 Mount Windows Shared Folders

 W95 Ext'd (LBA) Partition

 Reformat NTFS Partition into EXT4 Partition

 NFS (Network File System)

 Mount NFS (Network File System) on macOS

 /etc/mtab and /etc/fstab Files

 Unreachable Remote File Systems

 Block Devices and Partitions

 LVM (Logical Volume Manager)

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Internet Networking Tools

 SSH Protocol and ssh/scp Commands

 Software Package Manager on CentOS - DNF and YUM

 vsftpd - Very Secure FTP Daemon

 LDAP (Lightweight Directory Access Protocol)

 Administrative Tasks

 References

 Full Version in PDF/EPUB