Commit 12689c9c authored by Anton Altaparmakov's avatar Anton Altaparmakov

Merge cantab.net:/home/aia21/bklinux-2.5

into cantab.net:/home/aia21/ntfs-2.6
parents 350667d7 d9704d82
...@@ -6,8 +6,9 @@ Table of contents ...@@ -6,8 +6,9 @@ Table of contents
================= =================
- Overview - Overview
- Supported mount options - Web site
- Features - Features
- Supported mount options
- Known bugs and (mis-)features - Known bugs and (mis-)features
- Using Software RAID with NTFS - Using Software RAID with NTFS
- Limitiations when using the MD driver - Limitiations when using the MD driver
...@@ -17,13 +18,59 @@ Table of contents ...@@ -17,13 +18,59 @@ Table of contents
Overview Overview
======== ========
To mount an NTFS 1.2/3.x (Windows NT4/2000/XP) volume, use the filesystem Linux-NTFS comes with a number of user-space programs known as ntfsprogs.
type 'ntfs'. The driver currently works only in read-only mode, with no These include mkntfs, a full-featured ntfs file system format utility,
fault-tolerance or journalling supported. ntfsundelete used for recovering files that were unintentionally deleted
from an NTFS volume and ntfsresize which is used to resize an NTFS partition.
See the web site for more information.
To mount an NTFS 1.2/3.x (Windows NT4/2000/XP/2003) volume, use the file
system type 'ntfs'. The driver currently supports read-only mode (with no
fault-tolerance, encryption or journalling) and very limited, but safe, write
support.
For fault tolerance and raid support (i.e. volume and stripe sets), you can
use the kernel's Software RAID / MD driver. See section "Using Software RAID
with NTFS" for details.
Web site
========
There is plenty of additional information on the linux-ntfs web site
at http://linux-ntfs.sourceforge.net/
The web site has a lot of additional information, such as a comprehensive
FAQ, documentation on the NTFS on-disk format, informaiton on the Linux-NTFS
userspace utilities, etc.
For fault tolerance and raid support (i.e. volume and stripe sets), you can use
the kernel's Software RAID / MD driver. See section "Using Software RAID with Features
NTFS" for details. ========
- This is a complete rewrite of the NTFS driver that used to be in the kernel.
This new driver implements NTFS read support and is functionally equivalent
to the old ntfs driver.
- The new driver has full support for sparse files on NTFS 3.x volumes which
the old driver isn't happy with.
- The new driver supports execution of binaries due to mmap() now being
supported.
- The new driver supports loopback mounting of files on NTFS which is used by
some Linux distributions to enable the user to run Linux from an NTFS
partition by creating a large file while in Windows and then loopback
mounting the file while in Linux and creating a Linux filesystem on it that
is used to install Linux on it.
- A comparison of the two drivers using:
time find . -type f -exec md5sum "{}" \;
run three times in sequence with each driver (after a reboot) on a 1.4GiB
NTFS partition, showed the new driver to be 20% faster in total time elapsed
(from 9:43 minutes on average down to 7:53). The time spent in user space
was unchanged but the time spent in the kernel was decreased by a factor of
2.5 (from 85 CPU seconds down to 33).
- The driver does not support short file names in general. For backwards
compatibility, we implement access to files using their short file names if
they exist. The driver will not create short file names however, and a rename
will discard any existing short file name.
Supported mount options Supported mount options
...@@ -33,31 +80,31 @@ In addition to the generic mount options described by the manual page for the ...@@ -33,31 +80,31 @@ In addition to the generic mount options described by the manual page for the
mount command (man 8 mount, also see man 5 fstab), the NTFS driver supports the mount command (man 8 mount, also see man 5 fstab), the NTFS driver supports the
following mount options: following mount options:
iocharset=name Deprecated option. Still supported but please use iocharset=name Deprecated option. Still supported but please use
nls=name in the future. See description for nls=name. nls=name in the future. See description for nls=name.
nls=name Character set to use when returning file names. nls=name Character set to use when returning file names.
Unlike VFAT, NTFS suppresses names that contain Unlike VFAT, NTFS suppresses names that contain
unconvertible characters. Note that most character unconvertible characters. Note that most character
sets contain insufficient characters to represent all sets contain insufficient characters to represent all
possible Unicode characters that can exist on NTFS. To possible Unicode characters that can exist on NTFS.
be sure you are not missing any files, you are advised To be sure you are not missing any files, you are
to use nls=utf8 which is capable of representing all advised to use nls=utf8 which is capable of
Unicode characters. representing all Unicode characters.
utf8=<bool> Option no longer supported. Currently mapped to utf8=<bool> Option no longer supported. Currently mapped to
nls=utf8 but please use nls=utf8 in the future and nls=utf8 but please use nls=utf8 in the future and
make sure utf8 is compiled either as module or into make sure utf8 is compiled either as module or into
the kernel. See description for nls=name. the kernel. See description for nls=name.
uid= uid=
gid= gid=
umask= Provide default owner, group, and access mode mask. umask= Provide default owner, group, and access mode mask.
These options work as documented in mount(8). By These options work as documented in mount(8). By
default, the files/directories are owned by root and default, the files/directories are owned by root and
he/she has read and write permissions, as well as he/she has read and write permissions, as well as
browse permission for directories. No one else has any browse permission for directories. No one else has any
access permissions. I.e. the mode on all files is by access permissions. I.e. the mode on all files is by
default rw------- and for directories rwx------, a default rw------- and for directories rwx------, a
consequence of the default fmask=0177 and dmask=0077. consequence of the default fmask=0177 and dmask=0077.
Using a umask of zero will grant all permissions to Using a umask of zero will grant all permissions to
...@@ -74,7 +121,7 @@ sloppy=<BOOL> If sloppy is specified, ignore unknown mount options. ...@@ -74,7 +121,7 @@ sloppy=<BOOL> If sloppy is specified, ignore unknown mount options.
any unknown options are found. any unknown options are found.
show_sys_files=<BOOL> If show_sys_files is specified, show the system files show_sys_files=<BOOL> If show_sys_files is specified, show the system files
in directory listings. Otherwise the default behaviour in directory listings. Otherwise the default behaviour
is to hide the system files. is to hide the system files.
Note that even when show_sys_files is specified, "$MFT" Note that even when show_sys_files is specified, "$MFT"
will not be visible due to bugs/mis-features in glibc. will not be visible due to bugs/mis-features in glibc.
...@@ -85,15 +132,15 @@ show_sys_files=<BOOL> If show_sys_files is specified, show the system files ...@@ -85,15 +132,15 @@ show_sys_files=<BOOL> If show_sys_files is specified, show the system files
case_sensitive=<BOOL> If case_sensitive is specified, treat all file names as case_sensitive=<BOOL> If case_sensitive is specified, treat all file names as
case sensitive and create file names in the POSIX case sensitive and create file names in the POSIX
namespace. Otherwise the default behaviour is to treat namespace. Otherwise the default behaviour is to treat
file names as case insensitive and to create file names file names as case insensitive and to create file names
in the WIN32/LONG name space. Note, the Linux NTFS in the WIN32/LONG name space. Note, the Linux NTFS
driver will never create short file names and will driver will never create short file names and will
remove them on rename/delete of the corresponding long remove them on rename/delete of the corresponding long
file name. file name.
Note that files remain accessible via their short file Note that files remain accessible via their short file
name, if it exists. If case_sensitive, you will need to name, if it exists. If case_sensitive, you will need
provide the correct case of the short file name. to provide the correct case of the short file name.
errors=opt What to do when critical file system errors are found. errors=opt What to do when critical file system errors are found.
Following values can be used for "opt": Following values can be used for "opt":
...@@ -102,27 +149,27 @@ errors=opt What to do when critical file system errors are found. ...@@ -102,27 +149,27 @@ errors=opt What to do when critical file system errors are found.
bad so it is no longer accessed, and then bad so it is no longer accessed, and then
continue. continue.
recover: At present only supported is recovery of recover: At present only supported is recovery of
the boot sector from the backup copy. If a the boot sector from the backup copy.
read-only mount, the recovery is done in If read-only mount, the recovery is done
memory only and not written to disk. in memory only and not written to disk.
Note that the options are additive, i.e. specifying: Note that the options are additive, i.e. specifying:
errors=continue,errors=recover errors=continue,errors=recover
This means the driver will attempt to recover and if means the driver will attempt to recover and if that
that fails it will clean-up as much as possible and fails it will clean-up as much as possible and
continue. continue.
mft_zone_multiplier= Set the MFT zone multiplier for the volume (this mft_zone_multiplier= Set the MFT zone multiplier for the volume (this
setting is not persistent across mounts and can be setting is not persistent across mounts and can be
changed from mount to mount but cannot be changed on changed from mount to mount but cannot be changed on
remount). Values of 1 to 4 are allowed, 1 being the remount). Values of 1 to 4 are allowed, 1 being the
default. The MFT zone multiplier determines how much default. The MFT zone multiplier determines how much
space is reserved for the MFT on the volume. If all space is reserved for the MFT on the volume. If all
other space is used up, then the MFT zone will be other space is used up, then the MFT zone will be
shrunk dynamically, so this has no impact on the shrunk dynamically, so this has no impact on the
amount of free space. However, it can have an impact amount of free space. However, it can have an impact
on performance by affecting fragmentation of the MFT. on performance by affecting fragmentation of the MFT.
In general use the default. If you have a lot of small In general use the default. If you have a lot of small
files then use a higher value. The values have the files then use a higher value. The values have the
following meaning: following meaning:
Value MFT zone size (% of volume size) Value MFT zone size (% of volume size)
1 12.5% 1 12.5%
...@@ -132,37 +179,14 @@ mft_zone_multiplier= Set the MFT zone multiplier for the volume (this ...@@ -132,37 +179,14 @@ mft_zone_multiplier= Set the MFT zone multiplier for the volume (this
Note this option is irrelevant for read-only mounts. Note this option is irrelevant for read-only mounts.
Features
========
- This is a complete rewrite of the NTFS driver that used to be in the kernel.
This new driver implements NTFS read support and is functionally equivalent
to the old ntfs driver.
- The new driver has full support for sparse files on NTFS 3.x volumes which
the old driver isn't happy with.
- The new driver supports execution of binaries due to mmap() now being
supported.
- A comparison of the two drivers using:
time find . -type f -exec md5sum "{}" \;
run three times in sequence with each driver (after a reboot) on a 1.4GiB
NTFS partition, showed the new driver to be 20% faster in total time elapsed
(from 9:43 minutes on average down to 7:53). The time spent in user space
was unchanged but the time spent in the kernel was decreased by a factor of
2.5 (from 85 CPU seconds down to 33).
- The driver does not support short file names in general. For backwards
compatibility, we implement access to files using their short file names if
they exist. The driver will not create short file names however, and a rename
will discard any existing short file name.
Known bugs and (mis-)features Known bugs and (mis-)features
============================= =============================
- The link count on each directory inode entry is set to 1, due to Linux not - The link count on each directory inode entry is set to 1, due to Linux not
supporting directory hard links. This may well confuse some user space supporting directory hard links. This may well confuse some user space
applications, since the directory names will have the same inode numbers. applications, since the directory names will have the same inode numbers.
This also speeds up ntfs_read_inode() immensely. And we haven't found any This also speeds up ntfs_read_inode() immensely. And we haven't found any
problems with this approach so far. If you find a problem with this, please problems with this approach so far. If you find a problem with this, please
let us know. let us know.
...@@ -176,11 +200,11 @@ Using Software RAID with NTFS ...@@ -176,11 +200,11 @@ Using Software RAID with NTFS
For support of volume and stripe sets, use the kernel's Software RAID / MD For support of volume and stripe sets, use the kernel's Software RAID / MD
driver and set up your /etc/raidtab appropriately (see man 5 raidtab). driver and set up your /etc/raidtab appropriately (see man 5 raidtab).
Linear volume sets, i.e. linear raid, as well as stripe sets, i.e. raid level 0, Linear volume sets, i.e. linear raid, as well as stripe sets, i.e. raid level
have been tested and work fine (though see section "Limitiations when using the 0, have been tested and work fine (though see section "Limitiations when using
MD driver with NTFS volumes" especially if you want to use linear raid). Even the MD driver with NTFS volumes" especially if you want to use linear raid).
though untested, there is no reason why mirrors, i.e. raid level 1, and stripes Even though untested, there is no reason why mirrors, i.e. raid level 1, and
with parity, i.e. raid level 5, should not work, too. stripes with parity, i.e. raid level 5, should not work, too.
You have to use the "persistent-superblock 0" option for each raid-disk in the You have to use the "persistent-superblock 0" option for each raid-disk in the
NTFS volume/stripe you are configuring in /etc/raidtab as the persistent NTFS volume/stripe you are configuring in /etc/raidtab as the persistent
...@@ -207,15 +231,16 @@ For linear raid, just change the raid-level above to "raid-level linear", for ...@@ -207,15 +231,16 @@ For linear raid, just change the raid-level above to "raid-level linear", for
mirrors, change it to "raid-level 1", and for stripe sets with parity, change mirrors, change it to "raid-level 1", and for stripe sets with parity, change
it to "raid-level 5". it to "raid-level 5".
Note for stripe sets with parity you will also need to tell the MD driver which Note for stripe sets with parity you will also need to tell the MD driver
parity algorithm to use by specifying the option "parity-algorithm which", which parity algorithm to use by specifying the option "parity-algorithm
where you need to replace "which" with the name of the algorithm to use (see which", where you need to replace "which" with the name of the algorithm to
man 5 raidtab for available algorithms) and you will have to try the different use (see man 5 raidtab for available algorithms) and you will have to try the
available algorithms until you find one that works. Make sure you are working different available algorithms until you find one that works. Make sure you
read-only when playing with this as you may damage your data otherwise. If you are working read-only when playing with this as you may damage your data
find which algorithm works please let us know (email the linux-ntfs developers otherwise. If you find which algorithm works please let us know (email the
list linux-ntfs-dev@lists.sourceforge.net or drop in on IRC in channel #ntfs linux-ntfs developers list linux-ntfs-dev@lists.sourceforge.net or drop in on
on the irc.openprojects.net network) so we can update this documentation. IRC in channel #ntfs on the irc.freenode.net network) so we can update this
documentation.
Once the raidtab is setup, run for example raid0run -a to start all devices or Once the raidtab is setup, run for example raid0run -a to start all devices or
raid0run /dev/md0 to start a particular md device, in this case /dev/md0. raid0run /dev/md0 to start a particular md device, in this case /dev/md0.
...@@ -232,14 +257,14 @@ Limitiations when using the MD driver ...@@ -232,14 +257,14 @@ Limitiations when using the MD driver
===================================== =====================================
Using the md driver will not work properly if any of your NTFS partitions have Using the md driver will not work properly if any of your NTFS partitions have
an odd number of sectors. This is especially important for linear raid as all an odd number of sectors. This is especially important for linear raid as all
data after the first partition with an odd number of sectors will be offset by data after the first partition with an odd number of sectors will be offset by
one or more sectors so if you mount such a partition with write support you one or more sectors so if you mount such a partition with write support you
will cause massive damage to the data on the volume which will only become will cause massive damage to the data on the volume which will only become
apparent when you try to use the volume again under Windows. apparent when you try to use the volume again under Windows.
So when using linear raid, make sure that all your partitions have an even So when using linear raid, make sure that all your partitions have an even
number of sectors BEFORE attempting to use it. You have been warned! number of sectors BEFORE attempting to use it. You have been warned!
ChangeLog ChangeLog
......
...@@ -680,31 +680,45 @@ config UMSDOS_FS ...@@ -680,31 +680,45 @@ config UMSDOS_FS
module, so saying M could be dangerous. If unsure, say N. module, so saying M could be dangerous. If unsure, say N.
config NTFS_FS config NTFS_FS
tristate "NTFS file system support (read only)" tristate "NTFS file system support"
help help
NTFS is the file system of Microsoft Windows NT/2000/XP. For more NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
information see <file:Documentation/filesystems/ntfs.txt>. Saying Y
here would allow you to read from NTFS partitions. Saying Y or M here enables read support. There is partial, but
safe, write support available. For write support you must also
say Y to "NTFS write support" below.
There are also a number of user-space tools available, called
ntfsprogs. These include ntfsundelete and ntfsresize, that work
without NTFS support enabled in the kernel.
This is a rewrite from scratch of Linux NTFS support and replaced
the old NTFS code starting with Linux 2.5.11. A backport to
the Linux 2.4 kernel series is separately available as a patch
from the project web site.
For more information see <file:Documentation/filesystems/ntfs.txt>
and <http://linux-ntfs.sourceforge.net/>.
This file system is also available as a module ( = code which can be This file system is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want). inserted in and removed from the running kernel whenever you want).
The module will be called ntfs. If you want to compile it as a The module will be called ntfs. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>. module, say M here and read <file:Documentation/modules.txt>.
If you are not using Windows NT/2000/XP in addition to Linux on your If you are not using Windows NT, 2000, XP or 2003 in addition to
computer it is safe to say N. Linux on your computer it is safe to say N.
config NTFS_DEBUG config NTFS_DEBUG
bool "NTFS debugging support" bool "NTFS debugging support"
depends on NTFS_FS depends on NTFS_FS
help help
If you are experiencing any problems with the NTFS file system, say If you are experiencing any problems with the NTFS file system, say
Y here. This will result in additional consistency checks to be Y here. This will result in additional consistency checks to be
performed by the driver as well as additional debugging messages to performed by the driver as well as additional debugging messages to
be written to the system log. Note that debugging messages are be written to the system log. Note that debugging messages are
disabled by default. To enable them, supply the option debug_msgs=1 disabled by default. To enable them, supply the option debug_msgs=1
at the kernel command line when booting the kernel or as an option at the kernel command line when booting the kernel or as an option
to insmod when loading the ntfs module. Once the driver is active, to insmod when loading the ntfs module. Once the driver is active,
you can enable debugging messages by doing (as root): you can enable debugging messages by doing (as root):
echo 1 > /proc/sys/fs/ntfs-debug echo 1 > /proc/sys/fs/ntfs-debug
Replacing the "1" with "0" would disable debug messages. Replacing the "1" with "0" would disable debug messages.
...@@ -717,16 +731,33 @@ config NTFS_DEBUG ...@@ -717,16 +731,33 @@ config NTFS_DEBUG
debugging messages while the misbehaviour was occurring. debugging messages while the misbehaviour was occurring.
config NTFS_RW config NTFS_RW
bool "NTFS write support (DANGEROUS)" bool "NTFS write support"
depends on NTFS_FS && EXPERIMENTAL depends on NTFS_FS
help help
This enables the experimental write support in the NTFS driver. This enables the partial, but safe, write support in the NTFS driver.
The only supported operation is overwriting existing files, without
changing the file length. No file or directory creation, deletion or
renaming is possible. Note only non-resident files can be written to
so you may find that some very small files (<500 bytes or so) cannot
be written to.
While we cannot guarantee that it will not damage any data, we have
so far not received a single report where the driver would have
damaged someones data so we assume it is perfectly safe to use.
Note: While write support is safe in this version (a rewrite from
scratch of the NTFS support), it should be noted that the old NTFS
write support, included in Linux 2.5.10 and before (since 1997),
is not safe.
WARNING: Do not use this option unless you are actively developing This is currently useful with TopologiLinux. TopologiLinux is run
NTFS as it is currently guaranteed to be broken and you on top of any DOS/Microsoft Windows system without partitioning your
may lose all your data! hard disk. Unlike other Linux distributions TopologiLinux does not
need its own partition. For more information see
<http://topologi-linux.sourceforge.net/>
It is strongly recommended and perfectly safe to say N here. It is perfectly safe to say N here.
endmenu endmenu
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#define const_cpu_to_le32(x) __constant_cpu_to_le32(x) #define const_cpu_to_le32(x) __constant_cpu_to_le32(x)
#define const_cpu_to_le64(x) __constant_cpu_to_le64(x) #define const_cpu_to_le64(x) __constant_cpu_to_le64(x)
/* The NTFS oem_id */ /* The NTFS oem_id "NTFS " */
#define magicNTFS const_cpu_to_le64(0x202020205346544e) /* "NTFS " */ #define magicNTFS const_cpu_to_le64(0x202020205346544eULL)
/* /*
* Location of bootsector on partition: * Location of bootsector on partition:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment