ntfs-3g/ntfsprogs/ntfsresize.8.in

238 lines
8.5 KiB
Groff
Raw Normal View History

2002-11-29 20:16:35 +08:00
.\" -*- nroff -*-
.\" Copyright 2002-2005 by Szabolcs Szakacsits All Rights Reserved.
2002-11-29 20:16:35 +08:00
.\"
.TH NTFSRESIZE 8 "Jun 2005" "ntfsprogs version @VERSION@"
2002-11-29 20:16:35 +08:00
.SH NAME
ntfsresize \- resize an NTFS filesystem without data loss
2002-11-29 20:16:35 +08:00
.SH SYNOPSIS
.B ntfsresize
[\fIOPTIONS\fR]
.B --info
.I DEVICE
.br
.B ntfsresize
[\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-06-12 21:39:23 +08:00
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.
.B Defragmentation is NOT required prior resizing
because the program can relocate any data if needed, without risking data
integrity.
.PP
Ntfsresize can be used to shrink or enlarge any NTFS filesystem located
on an unmounted
.I DEVICE
(usually a disk partition). The new filesystem will have
.I SIZE
2002-11-29 20:16:35 +08:00
bytes.
The
.I SIZE
2002-11-29 20:16:35 +08:00
parameter may have one of the optional modifiers
\fBk\fR, \fBM\fR, \fBG\fR, which means the
.I SIZE
2002-11-29 20:16:35 +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.
If both
.B --info
and
.B --size
are omitted then the
NTFS filesystem will be enlarged to the underlying
.I DEVICE
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
.BR fdisk (8).
2005-06-12 21:39:23 +08:00
Alternatively you could use one of the many user friendly partitioners that
uses
.B ntfsresize
internally, like Mandriva's DiskDrake, QTParted, SUSE/Novell's YaST Partitioner,
IBM's EVMS, GParted or Debian/Ubuntu's Partman.
.PP
.B IMPORTANT!
2005-06-12 21:39:23 +08:00
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
.BR ntfsclone (8).
Don't forget to save the partition table as well!
.SH 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-06-12 21:39: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
then just recreate the partition to be as large as NTFS.
.SH ENLARGEMENT
To enlarge an NTFS filesystem, first you must enlarge the size of the
underlying partition. This can be done using
2002-11-29 20:16:35 +08:00
.BR fdisk (8)
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.
.SH PARTITIONING
When recreating the partition by a disk partitioning tool,
2005-06-12 21:39:23 +08:00
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.
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
computer from the disk.
2002-11-29 20:16:35 +08:00
.SH OPTIONS
Below is a summary of all the options that
2002-11-29 20:16:35 +08:00
.B ntfsresize
accepts. All options have two equivalent names. The short name is preceded by
.BR \-
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.
.BR \-fi
is equivalent to
.BR "\-f \-i".
2002-11-29 20:16:35 +08:00
.TP
.B -i, --info
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
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
.B --no-action
option before real resizing.
Practically the smallest shrunken size generally is
at around "used space" + (20-200 MB). Please also take into account
that Windows might need about 50-100 MB free space left to boot safely.
This option never causes any changes to the filesystem, the partition is
opened read-only.
2002-11-29 20:16:35 +08:00
.TP
.B -s, --size \fISIZE\fR[\fBk\fR|\fBM\fR|\fBG\fR]
Resize filesystem to \fIsize\fR[\fBk\fR|\fBM\fR|\fBG\fR] bytes.
The optional modifiers \fBk\fR, \fBM\fR, \fBG\fR mean the
.I SIZE
parameter is given in kilo-, mega- or gigabytes respectively.
Conforming to standards, k=10^3, M=10^6 and G=10^9. Use this option
with
.B --no-action
first.
2002-11-29 20:16:35 +08:00
.TP
.B -f, --force
Forces ntfsresize to proceed with the resize operation if the filesystem
is marked "dirty" for consistency check.
Please note, ntfsresize always marks the filesystem
"dirty" 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
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
.B -n, --no-action
Use this option to make a test run before doing the real resize operation.
2002-11-29 20:16:35 +08:00
Volume will be opened read-only and
.B ntfsresize
displays what it would do if it were to resize the filesystem.
Continue with the real resizing only if the test run passed.
2002-11-29 20:16:35 +08:00
.TP
.B -P, --no-progress-bar
Don't show progress bars.
.TP
.B -v, --verbose
More output.
.TP
.B -h, --help
Display help and exit.
.SH EXIT CODES
The exit code is 0 on success, non-zero otherwise.
.SH KNOWN ISSUES
2005-06-12 21:39: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
<linux-ntfs-dev@lists.sourceforge.net>. No subscription is needed
2005-06-12 21:39:23 +08:00
but the mailing list is moderated and it can take a short time
to approve your post.
2002-11-29 20:16:35 +08:00
.PP
There are some very rarely met limitations at present: filesystems having
bad sectors, highly fragmented Master File Table (MFT), relocation
of the first MFT extent and resizing in the middle of some metadata
in some cases aren't supported yet. These cases are detected and
resizing is refused, restricted to a safe size or the closest safe
size is displayed.
.PP
2005-06-12 21:39:23 +08:00
.B Ntfsresize
schedules an NTFS consistency check and
after the first boot into Windows you must see
.B chkdsk
running on a blue background. This is intentional.
Windows may force a quick reboot after the consistency check.
Moreover after repartitioning your disk and depending on the
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
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 unbootable Windows systems, even if
NTFS was consistent, if
.BR 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.
2002-11-29 20:16:35 +08:00
.SH AUTHOR
2005-06-12 21:39:23 +08:00
.B Ntfsresize
2002-11-29 20:16:35 +08:00
has been written by
Szabolcs Szakacsits <szaka@sienet.hu>.
.SH ACKNOWLEDGEMENT
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 and to Theodore Ts'o whose
2002-11-29 20:16:35 +08:00
.BR resize2fs (8)
man page formed the basis of this page.
2002-11-29 23:26:49 +08:00
.SH AVAILABILITY
2005-06-12 21:39:23 +08:00
.B Ntfsresize
is part of the
.BR ntfsprogs (8)
package and is available from
http://linux-ntfs.sourceforge.net/ as source and precompiled binary.
2005-06-12 21:39:23 +08:00
.B Ntfsresize
related news, example of usage, troubleshooting, statically linked binary and
FAQ (frequently asked questions) is maintained at
http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html
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),
.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)