System Administration Commands ntfsresize(1M)
NAME
ntfsresize - resize an NTFS file system without data loss
SYNOPSIS
ntfsresize [options] --info device
ntfsresize [options] [--size size[k|M|G]] device
DESCRIPTION
The ntfsresize program safely resizes Windows XP, Windows
Server 2003, Windows 2000, Windows NT4 and Longhorn NTFS filesystems without data loss. All NTFS versions used by32-bit and 64-bit Windows "operating systems" are supported.
Defragmentation is not required prior to resizing, becausentfsresize can relocate any data if needed, without risking
data integrity.ntfsresize can be used to shrink or enlarge any NTFS file
system located on an unmounted device (usually a disk parti-
tion). The new file system will have a size that you specify. The size parameter can have one of the optionalmodifiers k, M, G, denoting, respectively, kilobytes, mega-
bytes, or gigabytes. ntfsresize conforms to the SI, ATA, an
IEEE standards and the disk manufacturers by supporting k=10^3, M=10^6 and G=10^9.If both ---info and ---size options are omitted then the
NTFS file system will be enlarged to the underlying device size. To resize a file system on a partition, you must resize both the file system and the partition, by editing the partitiontable on the disk. Similarly to other command-line file sys-
tem resizers, ntfsresize does not manipulate the size of the
partitions. To do that you must use a disk partitioning tool, such as fdisk(1M). Alternatively, you could use one ofthe many user friendly partitioners that uses ntfsresize
internally. Such partitioners include, among others,Mandriva's DiskDrake, QTParted, SUSE/Novell's YaST Parti-
tioner, IBM's EVMS, GParted, or Debian/Ubuntu's Partman. Back up your data and your partition table before using any partitioning tool. For an NTFS file system, you can use ntfsclone(1M) as a means of backup.
SunOS 5.11 Last change: 21 May 2009 1
System Administration Commands ntfsresize(1M)
To shrink an NTFS partition, first use ntfsresize to shrink
the size of the file system. Then use a utility such as fdisk(1M) 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 will not be able to boot from that partition.If you mistakenly made a too-small partition, you would have
to recreate the partition to be as large as newly sized NTFS file system. To enlarge an NTFS file system, you must first enlarge the size of the underlying partition. You can use fdisk(1M) to delete the partition and recreate it with a larger size. Make sure the newly sized partition does not overlap withany other partition. Then use ntfsresize to enlarge the file
system. When recreating a partition, make sure you create it at the same starting sector and with the same partition type as was used in the partition you are replacing. Otherwise, you willnot be able to access your file system. Use the fdisk u com-
mand to switch from the default cylinder unit to the reli-
able sector unit. Also, if the bootable flag was set in theold partition, make sure to set it in the recreated parti-
ton. Otherwise, you might not be able to boot from the new partition.EXTENDED DESCRIPTION
There are a handful of very rarely met restrictions in theuse of ntfsresize. An example of such a restriction occurs
with a file system stored on a disk having unknown bad sec-
tors. Relocation of the first MFT extent and resizing intothe middle of a $MFTMirr extent are not supported. These
cases are detected and resizing is restricted to a safe size or the closest safe size is displayed.Upon completion of a resizing, ntfsresize schedules an NTFS
consistency check. In Windows, this check is performed by chkdsk. Upon the first subsequent reboot into Windows, youwill note chkdsk running in a blue background. This is nor-
mal. Windows might force a quick reboot after the con-
sistency check. Depending on your hardware configuration, Windows might alert you to a systems setting change and recommend or require a reboot. Acknowledge the message and reboot a second time. OPTIONS Supported options are listed below. Most options have bothsingle-letter and full-name forms. Multiple single-letter
SunOS 5.11 Last change: 21 May 2009 2
System Administration Commands ntfsresize(1M)
options that do not take an argument can be combined. Forexample, -fv is the equivalent of -f -v. A full-name option
can be abbreviated to a unique prefix of its name.-b, --bad-sectors
By default, ntfsresize exits upon encountering bad sec-
tors. This option allows the utility to proceed in spite of such sectors. Prior using this option, it is strongly recommended thatyou use ntfsclone(1M) with the --rescue option to make a
backup, then, in Windows, run chkdsk /f /r volume: from the command line. If the disk guarantee displays as valid, then replace it, as it is defective. Note that no software can repair bad sector errors. The most that can be done is to work around these defects. This option has no effect if a disk has no bad sectors.-f, --force
ntfsresize always marks a file system for consistency
check before a real (not using --no-action) resize
operation and it leaves that way for extra safety. Thus,if an NTFS file system was marked by ntfsresize, it is
safe to use this option. You must use this option, if you need to resize several times without booting into Windows between each resizing step.-h, --help
Display usage information and exit.-i, --info
Used when you want to shrink a file system. Causesntfsresize to determine the smallest shrunken file sys-
tem size supported. Most of the time the smallest sizeis the space already used on the file system. ntfsresize
does not shrink a file system to a smaller size than what is returned by this option. Depending on severalfactors, it might be unable to shrink to this theoreti-
cal size. Although the integrity of your data should be never at risk, it is nevertheless strongly recommendedto make a test run by using the --no-action option
before actual resizing. Based on testing, the smallest attainable size isSunOS 5.11 Last change: 21 May 2009 3
System Administration Commands ntfsresize(1M)
approximately space used in the file system plus 20-200
MB. Note also that Windows might need an additional50-100 MB to boot safely.
This option never causes any changes to the file system;the partition is opened read-only.
-n, --no-action
Use this option to make a test run before doing theresize operation. Volume will be opened read-only and
ntfsresize displays what it would do if it were to
resize the file system. Proceed with the actual resizing only if the test run passed.-P, --no-progress-bar
Do not display progress bars during ntfsresize opera-
tion.-s, --size size[k|M|G]]
Resize file system to size bytes. The new file system will have a size that you specify. The size parametercan have one of the optional modifiers k, M, G, denot-
ing, respectively, kilobytes, megabytes, or gigabytes.ntfsresize conforms to the SI, ATA, an IEEE standards
and the disk manufacturers by supporting k=10^3, M=10^6 and G=10^9. Before performing an actual resizing, runntfsresize with the --no-action option, along with this
option, first.-v, --verbose
Display copious output.-V, --version
Display the version number of ntfsresize.
EXIT STATUSDisplay zero on success, non-zero otherwise.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:SunOS 5.11 Last change: 21 May 2009 4
System Administration Commands ntfsresize(1M)
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | system/file-system/ntfsprogs|
|_____________________________|_____________________________|
| Interface Stability | Uncommitted ||_____________________________|_____________________________|
SEE ALSO
fdisk(1M), ntfsclone(1M), parted(1M), attributes(5)http://wiki.linux-ntfs.org
NOTESIn Linux version 2.6, with partitions that have been manipu-
lated by parted(1M), use of ntfsresize preceded corruption
of partition tables, which resulted in unbootable Windowssystems. This occurred even if the NTFS file system was con-
sistent. This problem is independent of NTFS and, thus,ntfsresize. Moreover, ntfsresize never touches the partition
table. Under the conditions just described, you can, in the BIOS, change Disk Access Mode to LBA to regain the ability to boot. For further discussion of this condition see thentfsresize FAQ at:
http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html.
AUTHORSntfsresize was written by Szabolcs Szakacsits, with contri-
butions from Anton Altaparmakov and Richard Russon.SunOS 5.11 Last change: 21 May 2009 5