The ntfsresize program safely resizes Windows XP, Windows Server 2003, Windows 2000, Windows NT4 and Longhorn NTFS filesystems without data loss. All NTFS versions are supported, used by 32-bit and 64-bit Windows. Defragmentation is NOT required prior to resizing because the program can relocate any data if needed, without risking data integrity.
Ntfsresize can be used to shrink or enlarge any NTFS filesystem located on an unmounted DEVICE (usually a disk partition). The new filesystem will fit in a DEVICE whose desired size is SIZE bytes. The SIZE parameter may have one of the optional modifiers k, M, G, which means the SIZE parameter is given in kilo-, mega- or gigabytes respectively. Ntfsresize conforms to the SI, ATA, IEEE standards and the disk manufacturers by using k=10^3, M=10^6 and G=10^9.
If both --info(-mb-only) and --size are omitted then the NTFS filesystem will be enlarged to match the underlying DEVICE size.
To resize a filesystem on a partition, you must resize BOTH the filesystem and the partition by editing the partition table on the disk. Similarly to other command line filesystem resizers, ntfsresize doesn't manipulate the size of the partitions, hence to do that you must use a disk partitioning tool as well, for example fdisk(8). Alternatively you could use one of the many user friendly partitioners that uses ntfsresize internally, like Mandriva's DiskDrake, QTParted, SUSE/Novell's YaST Partitioner, IBM's EVMS, GParted or Debian/Ubuntu's Partman.
IMPORTANT! It's a good practice making REGULAR BACKUPS of your valuable data, especially before using ANY partitioning tools. To do so for NTFS, you could use ntfsclone(8). Don't forget to save the partition table as well!
If you wish to shrink an NTFS partition, first use ntfsresize
to shrink the size of the filesystem. Then you could use fdisk
(8) to shrink the size of the partition by deleting the partition and recreating it with the smaller size. Do not make the partition smaller than the new size of NTFS otherwise you won't be able to boot. If you did so notwithstanding then just recreate the partition to be as large as NTFS.
To enlarge an NTFS filesystem, first you must enlarge the size of the underlying partition. This can be done using fdisk
(8) by deleting the partition and recreating it with a larger size. Make sure it will not overlap with another existing partition. You may enlarge upwards (first sector unchanged) or downwards (last sector unchanged), but you may not enlarge at both ends in a single step. If you merge two NTFS partitions, only one of them can be expanded to the merged partition. After you have enlarged the partition, you may use ntfsresize
to enlarge the size of the filesystem.
When recreating the partition by a disk partitioning tool, make sure you create it at the same starting sector and with the same partition type as before. Otherwise you won't be able to access your filesystem. Use the 'u' fdisk command to switch to the reliable sector unit from the default cylinder one.
Also make sure you set the bootable flag for the partition if it existed before. Failing to do so you might not be able to boot your computer from the disk.
No reliability problem is known. If you need help please try the Ntfsresize FAQ first (see below) and if you don't find your answer then send your question, comment or bug report to the development team: email@example.com
There are a few very rarely met restrictions at present: filesystems having unknown bad sectors, relocation of the first MFT extent and resizing into the middle of a $MFTMirr extent aren't supported yet. These cases are detected and resizing is restricted to a safe size or the closest safe size is displayed.
Ntfsresize schedules an NTFS consistency check and after the first boot into Windows you must see chkdsk running on a blue background. This is intentional and no need to worry about it. Windows may force a quick reboot after the consistency check. Moreover after repartitioning your disk and depending on the hardware configuration, the Windows message System Settings Change may also appear. Just acknowledge it and reboot again.
The disk geometry handling semantic (HDIO_GETGEO ioctl) has changed in an incompatible way in Linux 2.6 kernels and this triggered multitudinous partition table corruptions resulting in unbootable Windows systems, even if NTFS was consistent, if parted(8) was involved in some way. This problem was often attributed to ntfsresize but in fact it's completely independent of NTFS thus ntfsresize. Moreover ntfsresize never touches the partition table at all. By changing the 'Disk Access Mode' to LBA in the BIOS makes booting work again, most of the time. You can find more information about this issue in the Troubleshooting section of the below referred Ntfsresize FAQ.
Many thanks to Anton Altaparmakov and Richard Russon for libntfs, the excellent documentation and comments, to Gergely Madarasz, Dewey M. Sasser and Miguel Lastra and his colleagues at the University of Granada for their continuous and highly valuable help, furthermore to Erik Meade, Martin Fick, Sandro Hawke, Dave Croal, Lorrin Nelson, Geert Hendrickx, Robert Bjorkman and Richard Burdick for beta testing the relocation support, to Florian Eyben, Fritz Oppliger, Richard Ebling, Sid-Ahmed Touati, Jan Kiszka, Benjamin Redelings, Christopher Haney, Ryan Durk, Ralf Beyer, Scott Hansen, Alan Evans for the valued contributions and to Theodore Ts'o whose resize2fs(8) man page originally formed the basis of this page.