1
- ###############################################################################
2
- ###############################################################################
3
- ###############################################################################
4
- ######### #########
5
- ######### THIS DOCUMENT EXPLAINS HOW TO USE #########
6
- ######### RISKY PROGRAMS AND PROCEDURES #########
7
- ######### THAT MAY COMPLETELY AND IRREVERSIBLY DELETE #########
8
- ######### ALL THE DATA ON YOUR DISKS #########
9
- ######### #########
10
- ######### THE AUTHOR DECLINES ALL RESPONSIBILITIES #########
11
- ######### FOR ANY DAMAGE THAT MAY DERIVE #########
12
- ######### FROM USING THE PROGRAMS AND PROCEDURES #########
13
- ######### DESCRIBED IN THIS DOCUMENT #########
14
- ######### #########
15
- ###############################################################################
16
- ###############################################################################
17
- ###############################################################################
18
-
19
- This document explains how use the programs 'fstransform', 'fsmove'
20
- and 'fsremap' to transform the contents of a Linux device
21
- - usually a disk partition - from a filesystem type to another
22
- while preserving its contents.
1
+ ###############################################################
2
+ ###############################################################
3
+ ###
4
+ ### DISCLAIMER
5
+ ###
6
+ ### THIS DOCUMENT EXPLAINS HOW TO USE
7
+ ### RISKY PROGRAMS AND PROCEDURES
8
+ ### THAT MAY COMPLETELY AND IRREVERSIBLY DELETE
9
+ ### ALL THE DATA ON YOUR DISKS
10
+ ###
11
+ ### THE AUTHOR DECLINES ALL RESPONSIBILITIES
12
+ ### FOR ANY DAMAGE THAT MAY DERIVE
13
+ ### FROM USING THE PROGRAMS AND PROCEDURES
14
+ ### DESCRIBED IN THIS DOCUMENT
15
+ ###
16
+ ###############################################################
17
+ ###############################################################
18
+
19
+
20
+ This document explains how use the programs 'fstransform', 'fsmove' and
21
+ 'fsremap' to transform the contents of a Linux device - usually a disk
22
+ partition - from a filesystem type to another while preserving its contents.
23
23
24
24
For example, a disk partition can be transformed from 'jfs' to 'ext4',
25
25
or from 'ext2' to 'xfs', or many other combinations.
@@ -48,9 +48,10 @@ All this foreword means only one thing:
48
48
The author declines ALL responsibilities for ANY damage that may derive
49
49
from using the programs and procedures described in this document.
50
50
51
- ###############################################################################
52
- ###############################################################################
53
- ###############################################################################
51
+ ###############################################################
52
+ ###############################################################
53
+
54
+ ### Introduction
54
55
55
56
Enough legalese... now let's get to the interesting part.
56
57
@@ -66,9 +67,11 @@ It works even if the filesystem is almost full
66
67
and even if it contains very large files, for example if some files
67
68
are larger than half the device or larger than the available space.
68
69
70
+ ### REQUIREMENTS
71
+
69
72
There are four requirements for fstransform to have a chance to succeed:
70
73
71
- 1 ) the device must have a little free space, typically at least 5%
74
+ 1 . the device must have a little free space, typically at least 5%
72
75
73
76
WARNING: transforming an almost full device to 'xfs' file-system
74
77
can be tricky:
@@ -79,7 +82,7 @@ There are four requirements for fstransform to have a chance to succeed:
79
82
before resuming fstransform.
80
83
A future fstransform version may automate this operation.
81
84
82
- 2 ) the filesystem on the device must support SPARSE FILES, i.e. files with holes
85
+ 2 . the filesystem on the device must support SPARSE FILES, i.e. files with holes
83
86
(see for example http://en.wikipedia.org/wiki/Sparse_file for an explanation of what they are)
84
87
and at least one of the two system calls "ioctl(FS_IOC_FIEMAP)" or "ioctl(FIBMAP)"
85
88
(see the file Documentation/filesystems/fiemap.txt in any recent Linux kernel
@@ -88,24 +91,25 @@ There are four requirements for fstransform to have a chance to succeed:
88
91
ioctl(FIBMAP) is limited by design to 2G-1 blocks, which typically translates to 8TB - 4kB.
89
92
To transform file systems equal or larger than 8TB, ioctl(FIEMAP) is required.
90
93
91
- 3 ) the initial and final filesystems must be supported by the Linux kernel
94
+ 3 . the initial and final filesystems must be supported by the Linux kernel
92
95
(i.e. it must be able to mount them)
93
96
and by the tools 'mkfs' and 'fsck'
94
97
(i.e. it must be possible to create them and check them for errors)
95
98
96
- 4 ) the following programs must be available:
99
+ 4 . the following programs must be available:
97
100
the two custom-made programs 'fsmove' and 'fsremap' (distributed with the script)
98
101
and several common Linux tools:
99
102
which, expr, id, blockdev, losetup, mount, umount,
100
103
mkdir, rmdir, rm, mkfifo, dd, sync, fsck, mkfs
101
104
102
105
103
- KNOWN LIMITS:
106
+ ### KNOWN LIMITS
107
+
108
+ * If the device contains a HUGE number of files with multiple hard links,
109
+ fstransform will be very slow and consume a LOT of memory.
110
+ Devices with more than one million files with multiple hard links
111
+ can cause fstransform to crash with "out of memory" errors.
104
112
105
- 1 ) if the device contains a HUGE number of files with multiple hard links,
106
- fstransform will be very slow and consume a LOT of memory.
107
- Devices with more than one million files with multiple hard links
108
- can cause fstransform to crash with "out of memory" errors.
109
113
110
114
2 ) JFS file systems equal or larger than 8TB cannot be converted due to
111
115
missing support for ioctl(FIEMAP) in the kernel:
@@ -120,7 +124,8 @@ KNOWN LIMITS:
120
124
4 ) for the same reason, a device cannot be converted _ to_ REISERFS format "3.5"
121
125
if it contains files larger than 2TB - 4k.
122
126
123
- FOREWORD:
127
+
128
+ ### DETAILS TO KNOW
124
129
125
130
If the original device is almost full, the program 'fsremap'
126
131
will create a relatively small backup file ("secondary storage")
@@ -136,9 +141,9 @@ To pass the same option to 'fstransform', you must execute something like
136
141
fstransform --opts-fsremap='-s <size >' <other-options-and-arguments >
137
142
138
143
139
- PROCEDURE:
144
+ ### PROCEDURE
140
145
141
- 0 ) compile fsmove and fsremap.
146
+ 0 . compile fsmove and fsremap.
142
147
Running "./configure" then "make" should suffice on any recent Linux machine,
143
148
as long as g++ is installed.
144
149
@@ -152,15 +157,15 @@ PROCEDURE:
152
157
Below, they will be referred as {fsmove} and {fsremap}
153
158
154
159
155
- 1 ) OPTIONAL - CAN BE SKIPPED
160
+ 1 . OPTIONAL - CAN BE SKIPPED
156
161
mount read-write the device you want to remap to a new file-system type
157
162
158
163
mount {device} {device-mount-point} [ your-options]
159
164
160
165
if the device is already mounted, check that it is mounted read-write
161
166
and that no process is using it.
162
167
163
- 2 ) decide the target file-system type.
168
+ 2 . decide the target file-system type.
164
169
165
170
For some combinations of the initial and final filesystems
166
171
it is not necessary to use 'fstransform',
@@ -175,14 +180,14 @@ PROCEDURE:
175
180
"convert Linux File System ext2 to ext3"
176
181
"convert Linux File System ext3 to ext4"
177
182
178
- But for most combinations, the only way is either to do a full backup + format +
179
- restore the data, or use 'fstransform'
183
+ But for most combinations, the only way is either to do a full backup +
184
+ format + restore the data, or use 'fstransform'
180
185
181
- 3 ) execute the program
186
+ 3 . execute the program
182
187
183
188
fstransform {device} {target-file-system-type}
184
189
185
- 4 ) follow the instructions - the program will tell you what it is doing,
190
+ 4 . follow the instructions - the program will tell you what it is doing,
186
191
and will also call 'fsmove' and 'fsremap' which show progress percentage
187
192
and estimated time left.
188
193
@@ -193,10 +198,11 @@ PROCEDURE:
193
198
In case there are errors, you can even try to fix them instead of
194
199
aborting the execution (if you know what you are doing).
195
200
196
- 5 ) be PATIENT. Transforming a large device takes a LONG time...
197
- On a fairly fast disk, it takes about 1 minute per 1 gigabyte.
198
- It means transforming 250GB of takes about 4 hours.
199
- Solid state disks (SSD) can be much faster.
201
+ 5 . be PATIENT. Transforming a large device takes a LONG time...
202
+ On a fairly fast disk, it takes about one minute per gigabyte.
203
+ It means transforming 1000GB takes about 16 hours.
204
+ Raid disks can be somewhat faster, and solid state disks (SSD)
205
+ can be _ much_ faster.
200
206
201
207
6 ) if something goes really wrong, check in /var/tmp/fstransform
202
208
for the log files
0 commit comments