Main menu

Format and mount an NTFS drive in Linux

If you have and hybrid environment like us, this is the most common situation that you need to format and mount an NTFS partition in Linux. You can format NTFS drive in Windows easily but what if you have en internal drive attached in Linux and you do want to format with NTFS or a drive already formatted with NTFS with stored data on it and need to mount in Linux system. Here is a quick walk through…

Format Linux drive with NTFS : for formatting a drive with NTFS you will require a package call NTFSprogs.

Let’s start from scratch and assume that you have a raw hard drive, if you have already have a partition you can skip this step

# fdisk -l

Disk /dev/xvda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000aec37

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    60375039    30186496   83  Linux
/dev/sda2       471668734   488396799     8364033    5  Extended
/dev/sda3        60375040   471666687   205645824   83  Linux

As we can see that we have a extended partition /dev/sda3 which we want to format with NTFS file system.

 # mkfs.NTFS /dev/sda3

Installing NTFSprogs and NTFS-3g package : NTFSprogs provide command to format disk with NTFS File system and NTFS-3g provide file system driver which help us to mound NTFS file system under Linux

On CentOS and Redhat systems.

# yum install NTFSprogs NTFS-3g

On Ubuntu Systems.

# sudo apt-get install NTFSprogs NTFS-3g

Mounting NTFS File system

# mount -t NTFS-3g /dev/sdd1 /mnt

All done, if you want to make sure it will mount on boot time, create an fstab enetry
open /etc/fstab in your favorate editon and append these line at the end of file

/dev/sdd1 /Backups NTFS-3g defaults 1 2

This will automatically mount your NTFS partition and boot time.