Suggest a StoryDo you have a news tip? We would like to hear from you.

[How To]: Manage NTFS File System on CentOS 7 / RHEL 7

Spread the love

Having a problem on managing partition with NTFS File System on RHEL7 / CentOS 7 !! You are in the right place. Here we will go through how to mount partitions with NTFS file systems, format NTFS partitions as well.

If you are currently have a dual boot setup with Microsoft WIndows 10. By default you won’t be able to managing NTFS file system on Red Hat Enterprise Linux (RHEL) or its based Linux distributions such as CentOS 7 and Scientific Linux. So, let’s take a look on how to let the system recognize/mount NTFS file system. Currently we are using CentOS 7.5 for that tutorial and same instructions applies for other RHEL 7 distributions.

How To Mount NTFS File System on CentOS 7 / RHEL 7

First we will need to install NTFS file system driver to recognize the availbility of a partition on the disk with NTFS file system.

Run Terminal and install the following package,

yum install ntfs-3g

After we had installed NTFS-3g it should recognize currently available NTFS partitions on the system. Let’s use blkid command to do so.

blkid
Terminal Output Sample

/dev/sda1: UUID="0650e9a6-99f0-432d-8cf3-354cbe28feca" TYPE="xfs"
/dev/sda2: UUID="rlxY3E-zftk-ur7g-3Ych-idoR-YsqQ-2xYHYc" TYPE="LVM2_member"
/dev/mapper/centos-root: UUID="9b49e2ec-93c2-4335-9984-8dec1a5d31e1" TYPE="xfs"
/dev/mapper/centos-swap: UUID="d3b3f3eb-2cd2-420a-ba93-7740cf228379" TYPE="swap"
/dev/sdc1: UUID="46F37DD057360079" TYPE="ntfs" PTTYPE="dos"

Now we see that BLKID command recognize a new disk attributes with NTFS file system.

To Manually mount the disk to a specific location. We could use mount command. Make sure you create a directory to for the desired location you would like to mount the NTFS partition to it. We will create a new directory named “windows”. and mount the partition path “/dev/sdc1” to the new directory “windows”.

mkdir /windows
mount /dev/sdc1 /windows

To confirm that the NTFS partition is properly mounted. We will use df command.

df -h
Terminal Output Sample

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  6.2G  1.1G  5.2G  18% /
devtmpfs                 484M     0  484M   0% /dev
tmpfs                    496M     0  496M   0% /dev/shm
tmpfs                    496M  6.8M  489M   2% /run
tmpfs                    496M     0  496M   0% /sys/fs/cgroup
/dev/sda1               1014M  129M  886M  13% /boot
tmpfs                    100M     0  100M   0% /run/user/0
/dev/sdc1                199M  2.5M  197M   2% /windows

How To Create NTFS Partition on CentOS 7 / RHEL 7

We will create a new partition and format it with NTFS file system. But, before we begin we will need to install the following package to be able to format a disk with NTFS file system.

yum install ntfsprogs

We are ready to go through the process of creating a new disk and format it with NTFS file system.

Firstly we will use fdisk to create a partition of that disk.

fdisk /dev/sdc

Follow the Terminal output sample down below to guide you through the process. I used the entire disk as the default values shows. Also, you could use the “m” option to display the help of the fdisk command.

Terminal Output Sample

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x6b270cc4.

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-409599, default 2048): - Enter to choose the default value
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-409599, default 409599): - Enter to choose the default value
Using default value 409599
Partition 1 of type Linux and of size 199 MiB is set
Hex code (type L to list all codes): 7 - Choose the partition type - In that case we will choose "7" for supporting HPFS/NTFS/exFAT
Changed type of partition 'Linux' to 'HPFS/NTFS/exFAT'
Command (m for help): w - Write the changes
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now it’s time to format the new partition with NTFS File System. This is where ntfsprogs package comes provide the mkfs.ntfs command to do so.

mkfs.ntfs /dev/sdc1

Mount-NTFS-File-System-format-NTFS-Screenshot

Terminal Output Sample

Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes: 100% - Done.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.

Now, You have successfully formatted your partition with NTFS file system. Use the previous steps mentioned earlier to mount the NTFS partition. If you are interested in Logical Volume Management (LVM). Please feel free to check our post for Creating LVM partition on RHEL 7.

Post Has been updated — For changing the partition Id as I forgot to set it in the first place. Thanks to Scott Westlake for catching that.


Spread the love
2 Comments

Leave a Reply