summaryrefslogtreecommitdiff
path: root/usr/src/man/man1m/ntfsresize.1m
blob: 7fe15b70cb05a30748ef26e1dcc62e74cc449f8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
'\" te
.\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright (c) 2002-2006 Szabolcs Szakacsits
.\" Copyright (c) 2002-2005 Anton Altaparmakov
.\" Copyright (c) 2002-2003 Richard Russon
.\" Copyright (c) 2007 Yura Pakhuchiy
.\" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the License, or (at your option) any later version.  This program is distributed
.\" in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.  You should have received a copy of the GNU General Public License along with this program
.\" (in the main directory of the Linux-NTFS distribution in the file COPYING);  if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 11-1307 USA
.TH ntfsresize 1M "21 May 2009" "SunOS 5.11" "System Administration Commands"
.SH NAME
ntfsresize \- resize an NTFS file system without data loss
.SH SYNOPSIS
.LP
.nf
\fBntfsresize\fR  [\fIoptions\fR] \fB--info\fR \fIdevice\fR
.fi

.LP
.nf
\fBntfsresize\fR  [\fIoptions\fR] [\fB--size\fR \fIsize\fR[k|M|G]] \fIdevice\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fBntfsresize\fR program safely resizes Windows XP, Windows Server 2003,
Windows 2000, Windows NT4 and Longhorn NTFS filesystems without data loss. All
NTFS versions used by 32-bit and 64-bit Windows "operating systems" are
supported. Defragmentation is not required prior to resizing, because
\fBntfsresize\fR can relocate any data if needed, without risking data
integrity.
.sp
.LP
\fBntfsresize\fR can be used to shrink or enlarge any NTFS file system located
on an unmounted device (usually a disk partition). The new file system will
have a size that you specify. The size parameter can have one of the optional
modifiers \fBk\fR, \fBM\fR, \fBG\fR, denoting, respectively, kilobytes,
megabytes, or gigabytes. \fBntfsresize\fR conforms to the SI, ATA, an IEEE
standards and the disk manufacturers by supporting \fBk=10\fR^3, \fBM=10\fR^6
and \fBG=10\fR^9.
.sp
.LP
If both \fB---info\fR and \fB---size\fR options are omitted then the NTFS file
system will be enlarged to the underlying device size.
.sp
.LP
To resize a file system on a partition, you must resize both the file system
and the partition, by editing the partition table on the disk. Similarly to
other command-line file system resizers, \fBntfsresize\fR does not manipulate
the size of the partitions. To do that you must use a disk  partitioning tool,
such as \fBfdisk\fR(1M). Alternatively, you could use one of the many user
friendly partitioners that uses  \fBntfsresize\fR internally. Such partitioners
include, among others, Mandriva's DiskDrake, QTParted, SUSE/Novell's YaST
Partitioner, IBM's EVMS, GParted, or Debian/Ubuntu's Partman.
.sp
.LP
Back up your data and your partition table before using any partitioning tool.
For an NTFS file system, you can use \fBntfsclone\fR(1M) as a means of backup.
.sp
.LP
To shrink an NTFS partition, first use \fBntfsresize\fR to shrink the size of
the file system. Then use a utility such as \fBfdisk\fR(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.
.sp
.LP
To enlarge an NTFS file system, you must first enlarge the size of the
underlying partition. You can use \fBfdisk\fR(1M) to delete the partition and
recreate it with a larger size. Make sure the newly sized partition does not
overlap with any other partition. Then use \fBntfsresize\fR to enlarge the file
system.
.sp
.LP
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 will not be able to access your file system. Use the
\fBfdisk u\fR command to switch from the default cylinder unit to the reliable
sector unit. Also, if the bootable flag was set in the old partition, make sure
to set it in the recreated partiton. Otherwise, you might not be able to boot
from the new partition.
.SH EXTENDED DESCRIPTION
.sp
.LP
There are a handful of very rarely met restrictions in the use of
\fBntfsresize\fR. An example of such a restriction occurs with a file system
stored on a disk having unknown bad sectors. Relocation of the first \fBMFT\fR
extent and resizing into the middle of a \fB$MFTMirr\fR extent  are not
supported. These cases are detected and resizing is restricted to a safe size
or the closest safe size is displayed.
.sp
.LP
Upon completion of a resizing, \fBntfsresize\fR schedules an NTFS consistency
check. In Windows, this check is performed by \fBchkdsk\fR. Upon the first
subsequent reboot into Windows, you will note \fBchkdsk\fR running in a blue
background. This is normal. Windows might force a quick reboot after the
consistency 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.
.SH OPTIONS
.sp
.LP
Supported options are listed below. Most options have both single-letter and
full-name forms. Multiple single-letter options that do not take an argument
can be combined. For example, \fB-fv\fR is the equivalent of \fB-f\fR \fB-v\fR.
A full-name option can be abbreviated to a unique prefix of its name.
.sp
.ne 2
.mk
.na
\fB\fB-b\fR, \fB--bad-sectors\fR\fR
.ad
.sp .6
.RS 4n
By default, \fBntfsresize\fR exits upon encountering bad sectors. This option
allows the utility to proceed in spite of such sectors.
.sp
Prior using this option, it is strongly recommended that you use
\fBntfsclone\fR(1M) with the \fB--rescue\fR option to make a backup, then, in
Windows, run \fBchkdsk /f /r volume\fR: 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.
.sp
This option has no effect if a disk has no bad sectors.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-f\fR, \fB--force\fR\fR
.ad
.sp .6
.RS 4n
\fBntfsresize\fR always marks a file system for consistency check before a real
(not using \fB--no-action\fR) resize operation and it leaves that way for extra
safety. Thus, if an NTFS file system was marked by \fBntfsresize\fR, 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.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-h\fR, \fB--help\fR\fR
.ad
.sp .6
.RS 4n
Display usage information and exit.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-i\fR, \fB--info\fR\fR
.ad
.sp .6
.RS 4n
Used when you want to shrink a file system. Causes \fBntfsresize\fR to
determine the smallest shrunken file system size supported. Most of the time
the smallest size is the space already used on the file system.
\fBntfsresize\fR does not shrink a file system to a smaller size than what is
returned by this option. Depending on several factors, it might be unable to
shrink to this theoretical size. Although the integrity of your data should be
never at risk, it is nevertheless strongly recommended to make a test run by
using the \fB--no-action\fR option before actual resizing.
.sp
Based on testing, the smallest attainable size is approximately space used in
the file system plus 20-200 MB. Note also that Windows might need an additional
50-100 MB to boot safely.
.sp
This option never causes any changes to the file system; the partition is
opened read-only.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-n\fR, \fB--no-action\fR\fR
.ad
.sp .6
.RS 4n
Use this option to make a test run before doing the resize operation. Volume
will be opened read-only and \fBntfsresize\fR displays what it would do if it
were to resize the file system. Proceed with the actual resizing only if the
test run passed.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-P\fR, \fB--no-progress-bar\fR\fR
.ad
.sp .6
.RS 4n
Do not display progress bars during \fBntfsresize\fR operation.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-s\fR, \fB--size\fR \fIsize\fR[k|M|G]]\fR
.ad
.sp .6
.RS 4n
Resize file system to \fIsize\fR bytes. The new file system will have a size
that you specify. The size parameter can have one of the optional modifiers
\fBk\fR, \fBM\fR, \fBG\fR, denoting, respectively, kilobytes, megabytes, or
gigabytes. \fBntfsresize\fR conforms to the SI, ATA, an IEEE standards and the
disk manufacturers by supporting \fBk=10\fR^3, \fBM=10\fR^6 and \fBG=10\fR^9.
Before performing an actual resizing, run \fBntfsresize\fR with the
\fB--no-action\fR option, along with this option, first.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-v\fR, \fB--verbose\fR\fR
.ad
.sp .6
.RS 4n
Display copious output.
.RE

.sp
.ne 2
.mk
.na
\fB\fB-V\fR, \fB--version\fR\fR
.ad
.sp .6
.RS 4n
Display the version number of \fBntfsresize\fR.
.RE

.SH EXIT STATUS
.sp
.LP
Display zero on success, non-zero otherwise.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i) 
lw(2.75i) |lw(2.75i) 
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityUncommitted
.TE

.SH SEE ALSO
.sp
.LP
\fBfdisk\fR(1M), \fBntfsclone\fR(1M), \fBparted\fR(1M), \fBattributes\fR(5)
.sp
.LP
http://wiki.linux-ntfs.org
.SH NOTES
.sp
.LP
In Linux version 2.6, with partitions that have been manipulated by
\fBparted\fR(1M), use of \fBntfsresize\fR preceded corruption of partition
tables, which resulted in unbootable Windows systems. This occurred even if the
NTFS file system was consistent. This problem is independent of NTFS and, thus,
\fBntfsresize\fR. Moreover, \fBntfsresize\fR never touches the partition table.
Under the conditions just described, you can, in the BIOS, change \fBDisk
Access Mode\fR to \fBLBA\fR to regain the ability to boot. For further
discussion of this condition see the \fBntfsresize\fR FAQ at:
\fBhttp://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html\fR.
.SH AUTHORS
.sp
.LP
\fBntfsresize\fR was written by Szabolcs Szakacsits, with  contributions from
Anton Altaparmakov and Richard Russon.