• Home »
  • Insights »
  • Install NTFSResize Using Yum on CentOS, NTFSResize to Verify Partition Table

Install NTFSResize Using Yum on CentOS, NTFSResize to Verify Partition Table

NTFSResize is a very useful tool on Linux when you also have Windows computers in your household. I have had many NTFS hard drives fail over time and its nice to plug them into a Linux server and gain basic information about them. A brief description from the man page is located below and if you want to view the entire man page for all of the switches that are available for ntfsresize simply click on the name.

ntfsresize- resize an NTFS filesystem without data loss

The ntfsresize package is part of a set of tools on Linux so it is included in the ntfsprogs application. The ntfsresize application will be installed with a set of tools called ntfsprogson CentOS using the the yum command below.

yum install ntfsprogs

There are other NTFS tools required to link tools with the NTFS library, called libntfs, available in the package ntfsprogs-devel. This can be installed on CentOS using yum with the command below.

yum install ntfsprogs-devel

The ntfsresize command can be used not only to resize a NTFS drive but also to obtain basic information about the drive. If you issue the -i switch you will get details about a specific drive. In the below example the disk is damaged which will require us to force the command which will be explained later.

Example ntfsresize -i:

[root@dev ~]# ntfsresize -i /dev/sda2
ntfsresize v1.13.1 (libntfs 9:0:0)
ERROR: Volume is scheduled for check.
Run chkdsk /f and please try again, or see option -f.

When using the -f switch along with the -i switch you will get output similar to the below. In the below example the NTFS drive is damaged.

[root@dev ~]# ntfsresize -f -i /dev/sda2
ntfsresize v1.13.1 (libntfs 9:0:0)
Device name : /dev/sda2
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 79966171648 bytes (79967 MB)
Current device size: 79966172160 bytes (79967 MB)
Checking filesystem consistency ...
100.00 percent completed
Accounting clusters ...
Cluster accounting failed at 12967 (0x32a7): missing cluster in $Bitmap
Cluster accounting failed at 16296 (0x3fa8): extra cluster in $Bitmap
Cluster accounting failed at 16714 (0x414a): extra cluster in $Bitmap
Cluster accounting failed at 29874 (0x74b2): extra cluster in $Bitmap
Cluster accounting failed at 29908 (0x74d4): extra cluster in $Bitmap
Cluster accounting failed at 476117 (0x743d5): extra cluster in $Bitmap
Cluster accounting failed at 476118 (0x743d6): extra cluster in $Bitmap
Cluster accounting failed at 476119 (0x743d7): extra cluster in $Bitmap
Cluster accounting failed at 476120 (0x743d8): extra cluster in $Bitmap
Cluster accounting failed at 3645440 (0x37a000): missing cluster in $Bitmap

Filesystem check failed! Totally 422909 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.

In an attempt on a different drive that is also damaged ntfsresize provide the below output.

[root@dev working]# ntfsresize --info --force laptop
ntfsresize v1.13.1 (libntfs 9:0:0)
Device name : laptop
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 79966171648 bytes (79967 MB)
Current device size: 75937648640 bytes (75938 MB)
ERROR: Current NTFS volume size is bigger than the device size!
Corrupt partition table or incorrect device partitioning?

You can use ntfsresize to then resize the partition if possible.


List Price: $34.99 USD
New From: $20.82 USD In Stock
Used from: $4.45 USD In Stock


List Price: $119.99 USD
New From: $43.00 USD In Stock
Used from: $28.29 USD In Stock

Share