[elrepo] [CentOS] NTFS and elrepo

Alan Bartlett ajb at elrepo.org
Mon Nov 2 07:14:02 EST 2009


2009/11/2 Akemi Yagi <toracat at elrepo.org>:
> On Sun, Nov 1, 2009 at 8:15 PM, Ron Loftin <reloftin at twcny.rr.com> wrote:
>>
>> On Sun, 2009-11-01 at 18:19 -0800, Akemi Yagi wrote:
>
>>> One possibility is that the ntfs module was built with the 'write'
>>> mode disabled.  I'm not sure if I tested the module with respect to
>>> writing to the NTFS partition.
>
> I just booted a laptop that has Windows and attempted to write to a
> NTFS partition and got the same permission problem as what you saw.  I
> also checked the code in kmod-ntfs.  The write option is apparently
> enabled.  I need to wait for Alan for confirmation though.
>
>> Well, when you're checking into this, I suggest that, if possible, you
>> have the output of the "mount" command indicate the RW/RO status
>> correctly.  That is at the least misleading, when "mount" claims RW
>> capability, while the module is in read-only mode.
>
> Well, the mount command shows what it was told to display - in this
> case, it was mounted with the "rw" option.  The driver has to be
> corrected to do the right thing.
>
> But we need to look into the matter in more details.

Looking at the kernel Kconfig file I see --

config NTFS_FS
        tristate "NTFS file system support"
        select NLS
        help
          NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.

          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/>.

          To compile this file system support as a module, choose M here: the
          module will be called ntfs.

-- and --

config NTFS_RW
        bool "NTFS write support"
        depends on NTFS_FS
        help
          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.

Note the mention of partial write support and the restrictions defined
in the second paragraph.

Here follows the Makefile from the tarball of the ntfs kmod package --

# If KERNELRELEASE is defined, the make command using this Makefile has
# been invoked by the kernel build system and so can use its language.
# Otherwise, if KERNELRELEASE is null, a make command was issued from
# the command line. So invoke the kernel build system.

ifeq ($(KERNELRELEASE),)

    # KVERSION should be set in the environment if this
    # build is not for the currently running kernel.
    KVERSION ?= $(shell uname -r)

    BUILD_DIR := /lib/modules/${KVERSION}/build
    PWD := $(shell pwd)

modules:
        $(MAKE) -C $(BUILD_DIR) M=$(PWD) modules

modules_install:
        $(MAKE) -C $(BUILD_DIR) M=$(PWD) modules_install

clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions \
        modules.order Module.symvers Module.markers

.PHONY: modules modules_install clean

else

# Called from kernel build system -- just declare the module(s).

obj-m += ntfs.o

ntfs-objs := aops.o attrib.o collate.o compress.o debug.o dir.o file.o \
             index.o inode.o mft.o mst.o namei.o runlist.o super.o sysctl.o \
             unistr.o upcase.o

EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.27\"

#ifeq ($(CONFIG_NTFS_RW),y)
EXTRA_CFLAGS += -DNTFS_RW

ntfs-objs += bitmap.o lcnalloc.o logfile.o quota.o usnjrnl.o
#endif

endif

>From this it can be seen that rw support is enabled in the driver.

As I do not use any version of Windoze and have no means of checking
this, I must assume that what is being observed is a result of the
intrinsic restrictions mentioned above.

Akemi -- Would you be able to test this please?

Alan.



More information about the elrepo mailing list