2006-01-08 06:21:25 +08:00
|
|
|
.\" Copyright (c) 2002\-2006 Szabolcs Szakacsits.
|
2005-11-22 05:25:14 +08:00
|
|
|
.\" Copyright (c) 2005 Richard Russon.
|
|
|
|
.\" This file may be copied under the terms of the GNU Public License.
|
2002-11-29 20:16:35 +08:00
|
|
|
.\"
|
2010-12-16 15:14:32 +08:00
|
|
|
.TH NTFSRESIZE 8 "February 2006" "ntfs-3g @VERSION@"
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH NAME
|
2004-03-07 01:42:28 +08:00
|
|
|
ntfsresize \- resize an NTFS filesystem without data loss
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B ntfsresize
|
2005-06-12 19:02:50 +08:00
|
|
|
[\fIOPTIONS\fR]
|
2005-11-22 08:17:23 +08:00
|
|
|
.B \-\-info
|
2005-06-12 19:02:50 +08:00
|
|
|
.I DEVICE
|
2004-03-07 01:42:28 +08:00
|
|
|
.br
|
|
|
|
.B ntfsresize
|
2005-06-12 19:02:50 +08:00
|
|
|
[\fIOPTIONS\fR]
|
|
|
|
[\fB\-\-size \fISIZE\fR[\fBk\fR|\fBM\fR|\fBG\fR]]
|
|
|
|
.I DEVICE
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
|
|
|
.B ntfsresize
|
2005-11-22 08:17:23 +08:00
|
|
|
program safely resizes Windows XP, Windows Server 2003, Windows 2000, Windows
|
2005-06-12 21:39:23 +08:00
|
|
|
NT4 and Longhorn NTFS filesystems without data loss. All NTFS versions are
|
2005-11-22 05:25:14 +08:00
|
|
|
supported, used by 32\-bit and 64\-bit Windows.
|
2005-11-22 08:17:23 +08:00
|
|
|
.B Defragmentation is NOT required prior to resizing
|
|
|
|
because the program can relocate any data if needed, without risking data
|
2005-06-12 21:39:23 +08:00
|
|
|
integrity.
|
|
|
|
.PP
|
|
|
|
Ntfsresize can be used to shrink or enlarge any NTFS filesystem located
|
|
|
|
on an unmounted
|
2005-06-12 19:02:50 +08:00
|
|
|
.I DEVICE
|
2004-03-07 01:42:28 +08:00
|
|
|
(usually a disk partition). The new filesystem will have
|
2005-06-12 19:02:50 +08:00
|
|
|
.I SIZE
|
2002-11-29 20:16:35 +08:00
|
|
|
bytes.
|
|
|
|
The
|
2005-06-12 19:02:50 +08:00
|
|
|
.I SIZE
|
2002-11-29 20:16:35 +08:00
|
|
|
parameter may have one of the optional modifiers
|
2005-11-22 05:25:14 +08:00
|
|
|
.BR k ,
|
|
|
|
.BR M ,
|
|
|
|
.BR G ,
|
|
|
|
which means the
|
2005-06-12 19:02:50 +08:00
|
|
|
.I SIZE
|
2005-11-22 05:25:14 +08:00
|
|
|
parameter is given in kilo\-, mega\- or gigabytes respectively.
|
2005-06-12 21:39:23 +08:00
|
|
|
.B Ntfsresize
|
2002-12-02 02:54:13 +08:00
|
|
|
conforms to the SI, ATA, IEEE standards and the disk manufacturers
|
2002-11-29 20:16:35 +08:00
|
|
|
by using k=10^3, M=10^6 and G=10^9.
|
2006-01-08 06:21:25 +08:00
|
|
|
|
2005-11-22 08:17:23 +08:00
|
|
|
If both
|
2005-11-22 05:25:14 +08:00
|
|
|
.B \-\-info
|
2003-10-09 15:56:06 +08:00
|
|
|
and
|
2005-11-22 05:25:14 +08:00
|
|
|
.B \-\-size
|
2005-11-22 08:17:23 +08:00
|
|
|
are omitted then the
|
|
|
|
NTFS filesystem will be enlarged to the underlying
|
|
|
|
.I DEVICE
|
2005-06-12 19:02:50 +08:00
|
|
|
size.
|
2002-11-29 20:16:35 +08:00
|
|
|
.PP
|
2005-06-12 21:39:23 +08:00
|
|
|
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,
|
2002-11-29 20:16:35 +08:00
|
|
|
.B ntfsresize
|
2005-06-12 21:39:23 +08:00
|
|
|
doesn't manipulate the size of the partitions, hence
|
|
|
|
to do that you must use a disk partitioning tool as well, for example
|
2003-01-11 01:00:47 +08:00
|
|
|
.BR fdisk (8).
|
2005-06-12 21:39:23 +08:00
|
|
|
Alternatively you could use one of the many user friendly partitioners that
|
2005-11-22 08:17:23 +08:00
|
|
|
uses
|
2005-06-12 21:39:23 +08:00
|
|
|
.B ntfsresize
|
|
|
|
internally, like Mandriva's DiskDrake, QTParted, SUSE/Novell's YaST Partitioner,
|
|
|
|
IBM's EVMS, GParted or Debian/Ubuntu's Partman.
|
2003-01-11 01:00:47 +08:00
|
|
|
.PP
|
2004-03-07 01:42:28 +08:00
|
|
|
.B IMPORTANT!
|
2005-11-22 08:17:23 +08:00
|
|
|
It's a good practice making REGULAR BACKUPS of your valuable data, especially
|
2005-06-12 21:39:23 +08:00
|
|
|
before using ANY partitioning tools. To do so for NTFS, you could use
|
2005-11-22 08:17:23 +08:00
|
|
|
.BR ntfsclone (8).
|
2005-06-12 21:39:23 +08:00
|
|
|
Don't forget to save the partition table as well!
|
2005-11-22 05:25:14 +08:00
|
|
|
.SS Shrinkage
|
2002-11-29 20:16:35 +08:00
|
|
|
If you wish to shrink an NTFS partition, first use
|
|
|
|
.B ntfsresize
|
2005-06-12 21:39:23 +08:00
|
|
|
to shrink the size of the filesystem. Then you could use
|
2002-11-29 20:16:35 +08:00
|
|
|
.BR fdisk (8)
|
|
|
|
to shrink the size of the partition by deleting the
|
2002-12-02 02:54:13 +08:00
|
|
|
partition and recreating it with the smaller size.
|
2005-11-22 08:17:23 +08:00
|
|
|
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
|
2005-06-12 21:39:23 +08:00
|
|
|
then just recreate the partition to be as large as NTFS.
|
2005-11-22 05:25:14 +08:00
|
|
|
.SS Enlargement
|
2004-03-07 01:42:28 +08:00
|
|
|
To enlarge an NTFS filesystem, first you must enlarge the size of the
|
2005-11-22 08:17:23 +08:00
|
|
|
underlying partition. This can be done using
|
2002-11-29 20:16:35 +08:00
|
|
|
.BR fdisk (8)
|
2004-03-07 01:42:28 +08:00
|
|
|
by deleting the partition and recreating it with a larger size.
|
|
|
|
Make sure it will not overlap with an other existing partition.
|
|
|
|
Then you may use
|
|
|
|
.B ntfsresize
|
|
|
|
to enlarge the size of the filesystem.
|
2005-11-22 05:25:14 +08:00
|
|
|
.SS Partitioning
|
2004-03-07 01:42:28 +08:00
|
|
|
When recreating the partition by a disk partitioning tool,
|
2005-11-22 08:17:23 +08:00
|
|
|
make sure you create it at the same
|
2005-09-25 04:12:36 +08:00
|
|
|
starting sector and with the same partition type as before.
|
|
|
|
Otherwise you won't be able to access your filesystem. Use the 'u'
|
2005-11-22 08:17:23 +08:00
|
|
|
fdisk command to switch to the reliable sector unit from the
|
2005-09-25 04:12:36 +08:00
|
|
|
default cylinder one.
|
2006-01-08 06:21:25 +08:00
|
|
|
|
2002-11-29 20:16:35 +08:00
|
|
|
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
|
2004-03-07 01:42:28 +08:00
|
|
|
computer from the disk.
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH OPTIONS
|
2004-03-07 01:42:28 +08:00
|
|
|
Below is a summary of all the options that
|
2002-11-29 20:16:35 +08:00
|
|
|
.B ntfsresize
|
2005-11-22 05:25:14 +08:00
|
|
|
accepts. Nearly all options have two equivalent names. The short name is
|
|
|
|
preceded by
|
|
|
|
.B \-
|
2004-03-07 01:42:28 +08:00
|
|
|
and the long name is preceded by
|
|
|
|
.BR \-\- .
|
|
|
|
Any single letter options, that don't take an argument, can be combined into a
|
|
|
|
single command, e.g.
|
2005-11-22 05:25:14 +08:00
|
|
|
.B \-fv
|
2004-03-07 01:42:28 +08:00
|
|
|
is equivalent to
|
2005-11-22 05:25:14 +08:00
|
|
|
.BR "\-f \-v" .
|
|
|
|
Long named options can be abbreviated to any unique prefix of their name.
|
2002-11-29 20:16:35 +08:00
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-i\fR, \fB\-\-info\fR
|
2005-11-22 08:17:23 +08:00
|
|
|
By using this option ntfsresize will determine the theoretically smallest
|
|
|
|
shrunken filesystem size supported. Most of the time the result is the space
|
|
|
|
already used on the filesystem. Ntfsresize will refuse shrinking to a
|
|
|
|
smaller size than what you got by this option and depending on several
|
2004-03-10 17:28:44 +08:00
|
|
|
factors it might be unable to shrink very close to this theoretical
|
|
|
|
size. Although the integrity of your data should be never in risk,
|
|
|
|
it's still strongly recommended to make a test run by using the
|
2005-12-08 05:04:37 +08:00
|
|
|
\fB\-\-no\-action\fR option before real resizing.
|
2006-01-07 14:26:43 +08:00
|
|
|
|
2004-03-07 01:42:28 +08:00
|
|
|
Practically the smallest shrunken size generally is
|
2005-11-22 08:17:23 +08:00
|
|
|
at around "used space" + (20\-200 MB). Please also take into account
|
2005-11-22 05:25:14 +08:00
|
|
|
that Windows might need about 50\-100 MB free space left to boot safely.
|
2006-01-07 14:26:43 +08:00
|
|
|
|
2004-03-07 01:42:28 +08:00
|
|
|
This option never causes any changes to the filesystem, the partition is
|
2005-11-22 05:25:14 +08:00
|
|
|
opened read\-only.
|
2002-11-29 20:16:35 +08:00
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-s\fR, \fB\-\-size\fR SIZE\fR[\fBk\fR|\fBM\fR|\fBG\fR]
|
|
|
|
Resize filesystem to \fISIZE\fR[\fBk\fR|\fBM\fR|\fBG\fR] bytes.
|
|
|
|
The optional modifiers
|
|
|
|
.BR k ,
|
|
|
|
.BR M ,
|
|
|
|
.B G
|
|
|
|
mean the
|
2005-06-12 19:02:50 +08:00
|
|
|
.I SIZE
|
2005-11-22 05:25:14 +08:00
|
|
|
parameter is given in kilo\-, mega\- or gigabytes respectively.
|
2004-03-07 01:42:28 +08:00
|
|
|
Conforming to standards, k=10^3, M=10^6 and G=10^9. Use this option
|
|
|
|
with
|
2005-11-22 05:25:14 +08:00
|
|
|
.B \-\-no\-action
|
2004-03-07 01:42:28 +08:00
|
|
|
first.
|
2002-11-29 20:16:35 +08:00
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-f\fR, \fB\-\-force\fR
|
2005-07-11 07:09:02 +08:00
|
|
|
Forces ntfsresize to proceed with the resize operation even if the filesystem
|
2005-11-22 08:17:23 +08:00
|
|
|
is marked for consistency check.
|
2006-01-08 06:21:25 +08:00
|
|
|
|
2004-03-07 01:42:28 +08:00
|
|
|
Please note, ntfsresize always marks the filesystem
|
2005-11-22 08:17:23 +08:00
|
|
|
for consistency check before a real resize operation
|
|
|
|
and it leaves that way for extra
|
|
|
|
safety. Thus if NTFS was marked by ntfsresize then it's safe to
|
2004-03-07 01:42:28 +08:00
|
|
|
use this option. If you need
|
|
|
|
to resize several times without booting into Windows between each
|
|
|
|
resizing steps then you must use this option.
|
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
.B \-n, \-\-no\-action
|
2003-01-13 03:21:06 +08:00
|
|
|
Use this option to make a test run before doing the real resize operation.
|
2005-11-22 05:25:14 +08:00
|
|
|
Volume will be opened read\-only and
|
2002-11-29 20:16:35 +08:00
|
|
|
.B ntfsresize
|
2005-11-22 08:17:23 +08:00
|
|
|
displays what it would do if it were to resize the filesystem.
|
2004-03-07 01:42:28 +08:00
|
|
|
Continue with the real resizing only if the test run passed.
|
2002-11-29 20:16:35 +08:00
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-b\fR, \fB\-\-bad\-sectors\fR
|
2005-08-16 05:44:10 +08:00
|
|
|
Support disks having hardware errors, bad sectors with those
|
|
|
|
.B ntfsresize
|
2005-11-22 08:17:23 +08:00
|
|
|
would refuse to work by default.
|
2006-01-08 06:21:25 +08:00
|
|
|
|
2005-08-16 05:44:10 +08:00
|
|
|
Prior using this option, it's strongly recommended to make a backup by
|
2005-07-08 05:20:04 +08:00
|
|
|
.BR ntfsclone (8)
|
2005-11-22 08:17:23 +08:00
|
|
|
using the \-\-rescue option, then running 'chkdsk /f /r volume:' on Windows
|
2005-08-16 05:44:10 +08:00
|
|
|
from the command line. If the disk guarantee is still valid then replace it.
|
|
|
|
It's defected. Please also note, that no software can repair these type of
|
2005-11-22 08:17:23 +08:00
|
|
|
hardware errors. The most what they can do is to work around the permanent
|
2005-08-16 05:44:10 +08:00
|
|
|
defects.
|
2006-01-08 06:21:25 +08:00
|
|
|
|
2005-08-16 05:44:10 +08:00
|
|
|
This option doesn't have any effect if the disk is flawless.
|
2005-07-08 05:20:04 +08:00
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-P\fR, \fB\-\-no\-progress\-bar\fR
|
2004-03-07 01:42:28 +08:00
|
|
|
Don't show progress bars.
|
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-v\fR, \fB\-\-verbose\fR
|
2004-03-07 01:42:28 +08:00
|
|
|
More output.
|
|
|
|
.TP
|
2005-11-22 05:25:14 +08:00
|
|
|
\fB\-V\fR, \fB\-\-version\fR
|
|
|
|
Print the version number of
|
|
|
|
.B ntfsresize
|
|
|
|
and exit.
|
|
|
|
.TP
|
|
|
|
\fB\-h\fR, \fB\-\-help\fR
|
2004-03-07 01:42:28 +08:00
|
|
|
Display help and exit.
|
2003-10-09 15:56:06 +08:00
|
|
|
.SH EXIT CODES
|
2005-11-22 08:17:23 +08:00
|
|
|
The exit code is 0 on success, non\-zero otherwise.
|
2006-01-08 06:21:25 +08:00
|
|
|
.SH KNOWN ISSUES
|
2005-11-22 08:17:23 +08:00
|
|
|
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
|
2005-11-22 05:25:14 +08:00
|
|
|
the development team:
|
|
|
|
.br
|
|
|
|
.nh
|
2010-12-16 15:19:15 +08:00
|
|
|
ntfs\-3g\-devel@lists.sf.net
|
2005-11-22 05:25:14 +08:00
|
|
|
.hy
|
2002-11-29 20:16:35 +08:00
|
|
|
.PP
|
2005-11-22 08:17:23 +08:00
|
|
|
There are a few very rarely met restrictions at present: filesystems having
|
2005-07-25 06:34:36 +08:00
|
|
|
unknown bad sectors, relocation
|
2005-07-26 04:40:07 +08:00
|
|
|
of the first MFT extent and resizing into the middle of a $MFTMirr extent
|
2005-11-22 08:17:23 +08:00
|
|
|
aren't supported yet. These cases are detected and
|
|
|
|
resizing is restricted to a safe size or the closest safe
|
2004-03-10 17:28:44 +08:00
|
|
|
size is displayed.
|
2004-03-07 01:42:28 +08:00
|
|
|
.PP
|
2005-06-12 21:39:23 +08:00
|
|
|
.B Ntfsresize
|
2004-03-07 01:42:28 +08:00
|
|
|
schedules an NTFS consistency check and
|
|
|
|
after the first boot into Windows you must see
|
2005-11-22 08:17:23 +08:00
|
|
|
.B chkdsk
|
2005-07-25 06:34:36 +08:00
|
|
|
running on a blue background. This is intentional and no need to worry about it.
|
2004-03-07 01:42:28 +08:00
|
|
|
Windows may force a quick reboot after the consistency check.
|
2005-11-22 08:17:23 +08:00
|
|
|
Moreover after repartitioning your disk and depending on the
|
2004-03-07 01:42:28 +08:00
|
|
|
hardware configuration, the Windows message
|
|
|
|
.B System Settings Change
|
|
|
|
may also appear. Just acknowledge it and reboot again.
|
2005-06-12 21:39:23 +08:00
|
|
|
.PP
|
2005-11-22 08:17:23 +08:00
|
|
|
The disk geometry handling semantic (HDIO_GETGEO ioctl) has changed
|
|
|
|
in an incompatible way in Linux 2.6 kernels and this triggered multitudinous
|
2005-10-28 23:14:49 +08:00
|
|
|
partition table corruptions resulting in unbootable Windows systems, even if
|
2005-11-22 08:17:23 +08:00
|
|
|
NTFS was consistent, if
|
2005-06-12 21:39:23 +08:00
|
|
|
.BR parted (8)
|
2005-11-22 08:17:23 +08:00
|
|
|
was involved in some way. This problem was often attributed to ntfsresize
|
|
|
|
but in fact it's completely independent of NTFS thus ntfsresize. Moreover
|
2005-06-12 21:39:23 +08:00
|
|
|
ntfsresize never touches the partition table at all. By changing
|
2005-11-22 08:17:23 +08:00
|
|
|
the 'Disk Access Mode' to LBA in the BIOS makes booting work
|
2005-06-27 04:43:21 +08:00
|
|
|
again, most of the time. You can find more information about this issue
|
|
|
|
in the Troubleshooting section of the below referred Ntfsresize FAQ.
|
2005-11-22 05:25:14 +08:00
|
|
|
.SH AUTHORS
|
|
|
|
.B ntfsresize
|
|
|
|
was written by Szabolcs Szakacsits, with contributions from Anton Altaparmakov
|
|
|
|
and Richard Russon.
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH ACKNOWLEDGEMENT
|
2004-03-07 01:42:28 +08:00
|
|
|
Many thanks to Anton Altaparmakov and Richard Russon
|
2005-11-22 08:17:23 +08:00
|
|
|
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
|
2005-07-08 05:20:04 +08:00
|
|
|
for beta testing the relocation support, to Florian Eyben, Fritz Oppliger,
|
2005-11-22 05:25:14 +08:00
|
|
|
Richard Ebling, Sid\-Ahmed Touati, Jan Kiszka, Benjamin Redelings, Christopher
|
2006-02-12 09:30:34 +08:00
|
|
|
Haney, Ryan Durk, Ralf Beyer, Scott Hansen, Alan Evans for the valued
|
2005-11-22 08:17:23 +08:00
|
|
|
contributions and to Theodore Ts'o whose
|
2002-11-29 20:16:35 +08:00
|
|
|
.BR resize2fs (8)
|
2005-07-08 05:20:04 +08:00
|
|
|
man page originally formed the basis of this page.
|
2002-11-29 23:26:49 +08:00
|
|
|
.SH AVAILABILITY
|
2005-11-22 05:25:14 +08:00
|
|
|
.B ntfsresize
|
|
|
|
is part of the
|
|
|
|
.B ntfsprogs
|
|
|
|
package and is available from:
|
|
|
|
.br
|
|
|
|
.nh
|
|
|
|
http://www.linux\-ntfs.org/content/view/19/37
|
|
|
|
.hy
|
|
|
|
.sp
|
|
|
|
The manual pages are available online at:
|
|
|
|
.br
|
|
|
|
.nh
|
2006-01-09 05:01:23 +08:00
|
|
|
http://man.linux-ntfs.org/
|
2005-11-22 05:25:14 +08:00
|
|
|
.hy
|
|
|
|
.sp
|
2005-06-12 21:39:23 +08:00
|
|
|
.B Ntfsresize
|
2005-11-22 08:17:23 +08:00
|
|
|
related news, example of usage, troubleshooting, statically linked binary and
|
2005-11-22 05:25:14 +08:00
|
|
|
FAQ (frequently asked questions) are maintained at:
|
|
|
|
.br
|
|
|
|
.nh
|
2003-01-11 01:00:47 +08:00
|
|
|
http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html
|
2005-11-22 05:25:14 +08:00
|
|
|
.hy
|
2002-11-29 20:16:35 +08:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR fdisk (8),
|
|
|
|
.BR cfdisk (8),
|
|
|
|
.BR sfdisk (8),
|
|
|
|
.BR parted (8),
|
2005-06-12 21:39:23 +08:00
|
|
|
.BR evms (8),
|
2003-10-09 15:56:06 +08:00
|
|
|
.BR ntfsclone (8),
|
2005-06-12 21:39:23 +08:00
|
|
|
.BR mkntfs (8),
|
2002-11-29 23:26:49 +08:00
|
|
|
.BR ntfsprogs (8)
|