Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: filesystems: convert ntfs.txt to ReST

- Add a SPDX header;
- Adjust document title;
- Comment out text-only ToC;
- Some whitespace fixes and new line breaks;
- Mark literal blocks as such;
- Add table markups;
- Add it to filesystems/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/f09ca6c9bdd4e7aa7208f3dba0b8753080b38d03.1581955849.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
461f2c8f 2640c19d

+81 -65
+2 -1
Documentation/filesystems/index.rst
··· 74 74 inotify 75 75 isofs 76 76 nilfs2 77 + nfs/index 78 + ntfs 77 79 overlayfs 78 80 virtiofs 79 81 vfat 80 - nfs/index
+79 -64
Documentation/filesystems/ntfs.txt Documentation/filesystems/ntfs.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ================================ 1 4 The Linux NTFS filesystem driver 2 5 ================================ 3 6 4 7 5 - Table of contents 6 - ================= 8 + .. Table of contents 7 9 8 - - Overview 9 - - Web site 10 - - Features 11 - - Supported mount options 12 - - Known bugs and (mis-)features 13 - - Using NTFS volume and stripe sets 14 - - The Device-Mapper driver 15 - - The Software RAID / MD driver 16 - - Limitations when using the MD driver 10 + - Overview 11 + - Web site 12 + - Features 13 + - Supported mount options 14 + - Known bugs and (mis-)features 15 + - Using NTFS volume and stripe sets 16 + - The Device-Mapper driver 17 + - The Software RAID / MD driver 18 + - Limitations when using the MD driver 17 19 18 20 19 21 Overview ··· 68 66 partition by creating a large file while in Windows and then loopback 69 67 mounting the file while in Linux and creating a Linux filesystem on it that 70 68 is used to install Linux on it. 71 - - A comparison of the two drivers using: 69 + - A comparison of the two drivers using:: 70 + 72 71 time find . -type f -exec md5sum "{}" \; 72 + 73 73 run three times in sequence with each driver (after a reboot) on a 1.4GiB 74 74 NTFS partition, showed the new driver to be 20% faster in total time elapsed 75 75 (from 9:43 minutes on average down to 7:53). The time spent in user space ··· 108 104 mount command (man 8 mount, also see man 5 fstab), the NTFS driver supports the 109 105 following mount options: 110 106 107 + ======================= ======================================================= 111 108 iocharset=name Deprecated option. Still supported but please use 112 109 nls=name in the future. See description for nls=name. 113 110 ··· 180 175 181 176 errors=opt What to do when critical filesystem errors are found. 182 177 Following values can be used for "opt": 183 - continue: DEFAULT, try to clean-up as much as 178 + 179 + ======== ========================================= 180 + continue DEFAULT, try to clean-up as much as 184 181 possible, e.g. marking a corrupt inode as 185 182 bad so it is no longer accessed, and then 186 183 continue. 187 - recover: At present only supported is recovery of 184 + recover At present only supported is recovery of 188 185 the boot sector from the backup copy. 189 186 If read-only mount, the recovery is done 190 187 in memory only and not written to disk. 191 - Note that the options are additive, i.e. specifying: 188 + ======== ========================================= 189 + 190 + Note that the options are additive, i.e. specifying:: 191 + 192 192 errors=continue,errors=recover 193 + 193 194 means the driver will attempt to recover and if that 194 195 fails it will clean-up as much as possible and 195 196 continue. ··· 213 202 In general use the default. If you have a lot of small 214 203 files then use a higher value. The values have the 215 204 following meaning: 205 + 206 + ===== ================================= 216 207 Value MFT zone size (% of volume size) 208 + ===== ================================= 217 209 1 12.5% 218 210 2 25% 219 211 3 37.5% 220 212 4 50% 213 + ===== ================================= 214 + 221 215 Note this option is irrelevant for read-only mounts. 216 + ======================= ======================================================= 222 217 223 218 224 219 Known bugs and (mis-)features ··· 269 252 components and their sizes in sectors, i.e. multiples of 512-byte blocks. 270 253 271 254 For NT4 fault tolerant volumes you can obtain the sizes using fdisk. So for 272 - example if one of your partitions is /dev/hda2 you would do: 255 + example if one of your partitions is /dev/hda2 you would do:: 273 256 274 - $ fdisk -ul /dev/hda 257 + $ fdisk -ul /dev/hda 275 258 276 - Disk /dev/hda: 81.9 GB, 81964302336 bytes 277 - 255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors 278 - Units = sectors of 1 * 512 = 512 bytes 259 + Disk /dev/hda: 81.9 GB, 81964302336 bytes 260 + 255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors 261 + Units = sectors of 1 * 512 = 512 bytes 279 262 280 - Device Boot Start End Blocks Id System 281 - /dev/hda1 * 63 4209029 2104483+ 83 Linux 282 - /dev/hda2 4209030 37768814 16779892+ 86 NTFS 283 - /dev/hda3 37768815 46170809 4200997+ 83 Linux 263 + Device Boot Start End Blocks Id System 264 + /dev/hda1 * 63 4209029 2104483+ 83 Linux 265 + /dev/hda2 4209030 37768814 16779892+ 86 NTFS 266 + /dev/hda3 37768815 46170809 4200997+ 83 Linux 284 267 285 268 And you would know that /dev/hda2 has a size of 37768814 - 4209030 + 1 = 286 269 33559785 sectors. ··· 288 271 For Win2k and later dynamic disks, you can for example use the ldminfo utility 289 272 which is part of the Linux LDM tools (the latest version at the time of 290 273 writing is linux-ldm-0.0.8.tar.bz2). You can download it from: 274 + 291 275 http://www.linux-ntfs.org/ 276 + 292 277 Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go 293 278 into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You 294 279 will find the precompiled (i386) ldminfo utility there. NOTE: You will not be 295 280 able to compile this yourself easily so use the binary version! 296 281 297 - Then you would use ldminfo in dump mode to obtain the necessary information: 282 + Then you would use ldminfo in dump mode to obtain the necessary information:: 298 283 299 - $ ./ldminfo --dump /dev/hda 284 + $ ./ldminfo --dump /dev/hda 300 285 301 286 This would dump the LDM database found on /dev/hda which describes all of your 302 287 dynamic disks and all the volumes on them. At the bottom you will see the ··· 324 305 Assuming you know all your devices and their sizes things are easy. 325 306 326 307 For a linear raid the table would look like this (note all values are in 327 - 512-byte sectors): 308 + 512-byte sectors):: 328 309 329 - --- cut here --- 330 - # Offset into Size of this Raid type Device Start sector 331 - # volume device of device 332 - 0 1028161 linear /dev/hda1 0 333 - 1028161 3903762 linear /dev/hdb2 0 334 - 4931923 2103211 linear /dev/hdc1 0 335 - --- cut here --- 310 + # Offset into Size of this Raid type Device Start sector 311 + # volume device of device 312 + 0 1028161 linear /dev/hda1 0 313 + 1028161 3903762 linear /dev/hdb2 0 314 + 4931923 2103211 linear /dev/hdc1 0 336 315 337 316 For a striped volume, i.e. raid level 0, you will need to know the chunk size 338 317 you used when creating the volume. Windows uses 64kiB as the default, so it 339 318 will probably be this unless you changes the defaults when creating the array. 340 319 341 320 For a raid level 0 the table would look like this (note all values are in 342 - 512-byte sectors): 321 + 512-byte sectors):: 343 322 344 - --- cut here --- 345 - # Offset Size Raid Number Chunk 1st Start 2nd Start 346 - # into of the type of size Device in Device in 347 - # volume volume stripes device device 348 - 0 2056320 striped 2 128 /dev/hda1 0 /dev/hdb1 0 349 - --- cut here --- 323 + # Offset Size Raid Number Chunk 1st Start 2nd Start 324 + # into of the type of size Device in Device in 325 + # volume volume stripes device device 326 + 0 2056320 striped 2 128 /dev/hda1 0 /dev/hdb1 0 350 327 351 328 If there are more than two devices, just add each of them to the end of the 352 329 line. 353 330 354 331 Finally, for a mirrored volume, i.e. raid level 1, the table would look like 355 - this (note all values are in 512-byte sectors): 332 + this (note all values are in 512-byte sectors):: 356 333 357 - --- cut here --- 358 - # Ofs Size Raid Log Number Region Should Number Source Start Target Start 359 - # in of the type type of log size sync? of Device in Device in 360 - # vol volume params mirrors Device Device 361 - 0 2056320 mirror core 2 16 nosync 2 /dev/hda1 0 /dev/hdb1 0 362 - --- cut here --- 334 + # Ofs Size Raid Log Number Region Should Number Source Start Target Start 335 + # in of the type type of log size sync? of Device in Device in 336 + # vol volume params mirrors Device Device 337 + 0 2056320 mirror core 2 16 nosync 2 /dev/hda1 0 /dev/hdb1 0 363 338 364 339 If you are mirroring to multiple devices you can specify further targets at the 365 340 end of the line. ··· 366 353 them. 367 354 368 355 Once you have your table, save it in a file somewhere (e.g. /etc/ntfsvolume1), 369 - and hand it over to dmsetup to work with, like so: 356 + and hand it over to dmsetup to work with, like so:: 370 357 371 - $ dmsetup create myvolume1 /etc/ntfsvolume1 358 + $ dmsetup create myvolume1 /etc/ntfsvolume1 372 359 373 360 You can obviously replace "myvolume1" with whatever name you like. 374 361 375 362 If it all worked, you will now have the device /dev/device-mapper/myvolume1 376 363 which you can then just use as an argument to the mount command as usual to 377 - mount the ntfs volume. For example: 364 + mount the ntfs volume. For example:: 378 365 379 - $ mount -t ntfs -o ro /dev/device-mapper/myvolume1 /mnt/myvol1 366 + $ mount -t ntfs -o ro /dev/device-mapper/myvolume1 /mnt/myvol1 380 367 381 368 (You need to create the directory /mnt/myvol1 first and of course you can use 382 369 anything you like instead of /mnt/myvol1 as long as it is an existing ··· 408 395 "chunk-size 64k" option for each raid-disk, too. 409 396 410 397 For example, if you have a stripe set consisting of two partitions /dev/hda5 411 - and /dev/hdb1 your /etc/raidtab would look like this: 398 + and /dev/hdb1 your /etc/raidtab would look like this:: 412 399 413 - raiddev /dev/md0 414 - raid-level 0 415 - nr-raid-disks 2 416 - nr-spare-disks 0 417 - persistent-superblock 0 418 - chunk-size 64k 419 - device /dev/hda5 420 - raid-disk 0 421 - device /dev/hdb1 422 - raid-disk 1 400 + raiddev /dev/md0 401 + raid-level 0 402 + nr-raid-disks 2 403 + nr-spare-disks 0 404 + persistent-superblock 0 405 + chunk-size 64k 406 + device /dev/hda5 407 + raid-disk 0 408 + device /dev/hdb1 409 + raid-disk 1 423 410 424 411 For linear raid, just change the raid-level above to "raid-level linear", for 425 412 mirrors, change it to "raid-level 1", and for stripe sets with parity, change ··· 440 427 raid0run /dev/md0 to start a particular md device, in this case /dev/md0. 441 428 442 429 Then just use the mount command as usual to mount the ntfs volume using for 443 - example: mount -t ntfs -o ro /dev/md0 /mnt/myntfsvolume 430 + example:: 431 + 432 + mount -t ntfs -o ro /dev/md0 /mnt/myntfsvolume 444 433 445 434 It is advisable to do the mount read-only to see if the md volume has been 446 435 setup correctly to avoid the possibility of causing damage to the data on the