# 2.6.15 Gentoo Sources NTFS write support

## mrnegitoro

Hi,

I have upgraded to the Gentoo Sources 2.6.15 Kernel because I read that it has better NTFS write support. However, I still can't seem to write to my NTFS mount. 

I'm mounting the NTFS drive in my fstab like so: 

```
/dev/hdb1               /mnt/200L       ntfs            user,rw         0 0
```

The mount shows up like this:

```

drwx------  1 root root 4.0K Jan 12 13:33 .

drwxr-xr-x  8 root root  224 Dec 16 09:09 ..

drwx------  1 root root    0 May 19  2005 RECYCLER

drwx------  1 root root 4.0K Apr 23  2005 System Volume Information

drwx------  1 root root  48K Dec 14  2004 movies

drwx------  1 root root 208K Jan  1  2005 soulseek

drwx------  1 root root  20K Mar  6  2005 torrent_dls

```

But I can't delete or copy anything to it.

Here is my kernel .config regarding NTFS support:

```

CONFIG_NTFS_FS=y

# CONFIG_NTFS_DEBUG is not set

CONFIG_NTFS_RW=y

```

Do I have to enable something else in my kernel? I have actually never had any problems with NTFS write support using the 2.6.X kernels. This only started when I installed a new Gentoo box with a 2.6.12-x kernel in early Dec. 2005.

Thanks for any help!

----------

## i92guboj

Do you have permissions to write into /mnt/200L? If not "chmod a+w /mnt/200L".

EDIT: Anyway, if you intend to do something serious I have heared that sys-fs/captive has far better support the ntfs than the linux kernel drivers (but cant confirm it myself).

----------

## mrnegitoro

Yup, I have permissions. 

I have tried mounting it in different ways ie) mount -t ntfs -o umask=000 /dev/hb1 /mnt/200L and also writing to it as the root user. 

I always get:

"Permission denied"

Ugh.

Do you think if I didn't set the drive (it's a whole drive formatted as NTFS) as a slave drive that would cause a problem like this? I think I may have set the jumper wrong for some reason.

----------

## i92guboj

Well, I can't discard anything since my experience with ntfs under linux systems in not so big (and not too recent either), but that would scare my so much. Having the drive as slave or master should have nothing to do with that. Your mount command seems fine and all that stuff. Do you have compression, encription or any other esoteric ntfs feature enabled on that drive? I'm not sure if that would affect or not (I'd bet yes) but is the only thing I can think of right now.

If I can think of anything more I will post here...   :Confused: 

----------

## Shazam

as far as i know, the 'write' support in this kernel allows you to shrink and grow files, and write to them, no more. you cannot create or delete a file und the partition.

I use captive as already mentioned, for writing to ntfs partition. however, it is a real slow process, i don't know why, but if you intend to copy bigger files onto a windows volume, make it vfat.

----------

## i92guboj

 *Shazam wrote:*   

> as far as i know, the 'write' support in this kernel allows you to shrink and grow files, and write to them, no more. you cannot create or delete a file und the partition.
> 
> I use captive as already mentioned, for writing to ntfs partition. however, it is a real slow process, i don't know why, but if you intend to copy bigger files onto a windows volume, make it vfat.

 

That is the only real solution. The one I choose. Anyway, and even if captive's is safe (which I dont really know) I would not risk my data if it is important. I preffer to use vfat.

----------

## mrnegitoro

Hi,

Ok thanks I will try captive again. I have already tried it and it wasn't working:

```

fusermount: mount failed: Invalid argument

Captive-ERROR **: FUSE fuse_setup() failed!

You may need Linux kernel 2.6.14 or higher with its 'fuse.ko' enabled.

You may also need to install or upgrade 'fuse' package to your system.

aborting...

Captive-WARNING **: CORBA Exception occured: id="IDL:omg.org/CORBA/COMM_FAILURE:1.0", value=0x80bd0a4

aborting...

```

I don't think I enabled FUSE in my kernel. I though that 

```
emerge fuse
```

 would create the kernel module.

Nothing like recompiling your kernel 90 times.

Thanks for the help!

----------

## i92guboj

Yeah, just emerge sys-fs/fuse (theres also app-emulation/fuse that has nothing to do with this), and then modprobe fuse. If you intend to use that regularly you can also add the module to /etc/modules.autoload.d/kernel-2.6

----------

## jza

So just to verify (since i'm getting the same error), you need to build fuse support into the kernel AND download sys-fs/fuse?

thanks!

----------

## i92guboj

 *jza wrote:*   

> So just to verify (since i'm getting the same error), you need to build fuse support into the kernel AND download sys-fs/fuse?
> 
> thanks!

 No, just one of them. Is like to choose between buil-in alsa support or to compile the alsa-driver package.

----------

## mrnegitoro

You only have to do one or the other.

The guide I read (http://gentoo-wiki.com/HOWTO_NTFS_write_with_Captive_approach) doesn't mention anything about building the module when compiling your Kernel, just to emerge sys-fs/fuse.

I have tried:

1) emerge sys-fs/fuse

2) building the module when compiling my Kernel

3) both at the same time

Non of it works, I get the same error each time. I gave up, I'm saving all the info I must have from the NTFS drive and I'm going to wipe it out and format it as ext3 or reiserfs or something else.

Very frustrating! I swear around the 2.8.1 Kernel I could write to NTFS no problem. Ah well, good luck, post back here if you make it work.

Thanks!

----------

## xbb

If you need to share a partition with windows, better you use ext2 or ext3 and install the drivers to access them from windows read/write (works very nice). By the way you can't install windows on ext2/ext3.

----------

## w00ter

I can fully recommend using ext3 as a shared linux/windowsxp disk. Been looking into this question lately, bought a new HD and formatted it completely into ext3 partitions. There are quite a few drivers for WinXp out there for ext2 meaning you can use the ext3 partitions just fine. It works transparently here, explorer showing my disks fine and no problems writing to them or reading from them.

----------

## jza

well, mine just magically started working today.  I did it w/o needing to enable support in the kernel.  

The only difference this time vs. yesterday is that yesterday (it was mounted and) didn't want to unmount (it said the device was busy) so I had just tried doing:

```

umount -o remount -t captive-ntfs /dev/hda2 /mnt/win

```

Today, I did the following:

```

mount -o remount -t ntfs /dev/hda2 /mnt/win

umount /mnt/win

mount -t captive-ntfs /dev/hda2 /mnt/win

```

Hopefully I won't experience any problems

----------

## jza

i just finished transfering 1.5GB (from a reiserfs partition) and it took over an hour.  Is this normal?

----------

## w00ter

Try searching for "ntfs captive slow" on this forum. 

For all I know (never got captive to work here) it's dead slow and for me the reason not to go ntfs-captive.

----------

## __g_blade

hi

i have captive 1.1.7 installed on gentoo-sources 2.6.15-r5

my NTFS HD is /dev/hdb5 mounted on /win

fuse module loaded, fuse-2.5.2 emerged

because kernel ntfs doesn't support full access i want captive now

but.......

```

localhost apps # rm win

winamp/  winscp3/

localhost apps # rm -rf winscp3/

localhost apps # ls

AvantGo Connect  ad.aware.se.prof    alcohol    att      clone.cd        filezilla     java         nero.7.premium  winamp

activesync       adobe.reader.7.0.5  antiblaxx  avi2dvd  daemon.tools.4  google.earth  musicbrainz  steam

localhost apps # ls -ali winamp

total 1684

19 drwxr-xr-x  1 root root       0 Nov 25 13:55 .

 2 drwxr-xr-x  1 root root       0 Feb 25 14:08 ..

39 -rw-r--r--  1 root root  110592 Nov 18 19:22 PXSDKPLS.dll

38 drwxr-xr-x  1 root root       0 Dec  2 08:46 Plugins

40 drwxr-xr-x  1 root root       0 Nov 18 19:26 Skins

43 -rw-r--r--  1 root root   45143 Dec  7 21:24 UninstWA.exe

49 -rw-r--r--  1 root root    4587 Nov 18 19:23 Winamp.q1

37 -rw-r--r--  1 root root   38912 Nov 18 19:22 demo.mp3

41 -rw-r--r--  1 root root   15913 Dec  2 19:13 studio.xnf

42 -rw-r--r--  1 root root  258352 Nov 18 19:22 unicows.dll

44 -rw-r--r--  1 root root   20244 Nov 18 19:22 whatsnew.txt

45 -rw-r--r--  1 root root 1162240 Dec  7 21:24 winamp.exe

46 -rw-r--r--  1 root root    7106 Dec  2 19:13 winamp.ini

47 -rw-r--r--  1 root root     413 Nov 18 19:22 winamp.lks

48 -rw-r--r--  1 root root      63 Dec  2 19:12 winamp.m3u

50 -rw-r--r--  1 root root   33792 Dec  7 21:23 winampa.exe

51 -rw-r--r--  1 root root    3296 Nov 18 19:22 winampmb.htm

localhost apps # ls -ali adobe.reader.7.0.5/

total 0

 6 drwxr-xr-x  1 root root 0 Nov 18 19:07 .

 2 drwxr-xr-x  1 root root 0 Feb 25 14:08 ..

52 drwxr-xr-x  1 root root 0 Nov 18 19:07 ActiveX

53 drwxr-xr-x  1 root root 0 Nov 18 19:07 Esl

54 drwxr-xr-x  1 root root 0 Nov 18 19:06 Help

55 drwxr-xr-x  1 root root 0 Nov 18 19:07 Reader

56 drwxr-xr-x  1 root root 0 Nov 18 19:07 Resource

localhost apps # rm -rf winamp/

rm: cannot remove `winamp//Plugins/avs/Community Picks/Zevensoft - Ocean4.avs': Software caused connection abort

rm: reading directory `winamp//Plugins/avs/Community Picks': Transport endpoint is not connected

rm: cannot lstat `.' in `winamp//Plugins/avs': Transport endpoint is not connected

(process:6726): Captive-ERROR (recursed) **: CORBA Exception occured: id="IDL:omg.org/CORBA/COMM_FAILURE:1.0", value=0x8058694

aborting...

localhost apps # ls

ls: .: Transport endpoint is not connected

localhost apps #     

```

 :Sad: 

my fstab

```

# <fs>                  <mountpoint>    <type>          <opts>                                                                          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda1               /boot           ext2            defaults,noatime                                                                1 2

/dev/hda2               none            swap            sw                                                                              0 0

/dev/hda3               /               ext3            noatime                                                                         0 1

/dev/hdb5               /win            captive-ntfs    defaults,users,gid=users,umask=0002,iocharset=iso8859-15,noatime                0 0

/dev/cdroms/cdrom0      /mnt/dvdrom     iso9660         auto                                                                            0 0

/dev/cdroms/cdrom1      /mnt/cdrom      iso9660         auto                                                                            0 0

/dev/fd0                /mnt/floppy     auto            auto                                                                            0 0

# NOTE: The next line is critical for boot!

none                    /proc           proc            defaults                                                                        0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

shm                     /dev/shm        tmpfs           nodev,nosuid,noexec                                                             0 0

```

doesn't mount automatically

with 

```

mount -t captive-ntfs /dev/hdb5 /win  

```

works at first time after boot

----------

## frank1980

My system is gentoo 2005.1 kde3.5.1 (amd64)

when I ACCEPT_KEYWORDS="~x86" emerge captive, then:

 *Quote:*   

> make[11]: *** [irql.lo] ERRO 1
> 
> make[11]: *** ÕýÔÚµÈ´ýÎ´Íê³ÉµÄÈÎÎñ....
> 
> ../../../../../reactos/include/ddk/iotypes.h:991: warning: `__stdcall__' attribute ignored
> ...

 

----------

## Cornflake

Can I write to files on my windows partition?

I mounted it to /mnt/windows, and I can view the files, copy them, etc. But I would like to be able to write to the partition. Whenever I try it says the partition is read only. Is there any way around this?Last edited by Cornflake on Sun Jun 04, 2006 4:03 am; edited 2 times in total

----------

## CptnObvious999

if you cannot write to it I am guessing it is formated with NTFS so you should install captive or enable read/write ntfs support in the kernel (when you run make menuconfig or genkernel --menuconfig)

----------

## Cornflake

Thanks! Where can I find this option?

Nevermind, found it.

----------

## CptnObvious999

Filesystems > DOS/FAT/NT Filesystems > NTFS write support

if you reboot and remount and still can't write to it post your /etc/fstab file and run "mount" and give us the output

EDIT: oh ok you found it X-D

----------

## dmsnell

has the ntfs write support been extended?  last time I checked you could only modify existing files, but not create new files nor delete old ones

----------

## Cornflake

 *CptnObvious999 wrote:*   

> Filesystems > DOS/FAT/NT Filesystems > NTFS write support
> 
> if you reboot and remount and still can't write to it post your /etc/fstab file and run "mount" and give us the output
> 
> EDIT: oh ok you found it X-D

 

I still cant write ><

/dev/hda2               /boot           ext2            defaults,noatime       $/dev/hda4               /               ext3            noatime         0 1

/dev/hda3               none            swap            sw              0 0

/dev/cdrom              /mnt/cdrom      auto            noauto,user,ro  0 0

#/dev/fd0               /mnt/floppy     auto            noauto          0 0

none                    /proc           proc            defaults        0 0

none                    /dev/shm        tmpfs           nodev,nosuid,noexec    $

mount:

/dev/hda4 on / type ext3 (rw,noatime)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

udev on /dev type tmpfs (rw,nosuid)

devpts on /dev/pts type devpts (rw)

/dev/hda2 on /boot type ext2 (rw,noatime)

none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)

usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)

/dev/hda1 on /mnt/windoze type ntfs (rw)

----------

## Cornflake

 *dmsnell wrote:*   

> has the ntfs write support been extended?  last time I checked you could only modify existing files, but not create new files nor delete old ones

 

This is within what I need to do anyway  :Smile: 

----------

## Redhatter

May I suggest not trying to mess with NTFS?  I found it easier to get Windows to read/write an EXT3 partition (via this driver), than to get Linux to read/write an NTFS partition.

That way, you can leave your NTFS partitions read-only, and use EXT3 (which I prefer anyways) for the cross-OS data partitions.  Not exactly what you wanted, but it's another way of tackling the same issue.  :Smile: 

----------

## Cornflake

Well, here is my problem:

I did a dual boot and everything went okay, except I cant boot into Windows XP. I get the hal.dll file is missing or corrupt error.

So what I wanted to do was get a fresh copy of the hal.dll and put it in my system32 as well as rewrite the boot.ini (which I figure it the problem since the partitions are no longer correct; I think)

This is the boot.ini: 

[boot loader]

timeout=3

default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition"$C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

My windows partition is on /dev/hda1, so  I think the partition(2) should be partition(1). I believe it should be anyway.

I cant run the recovery console because I dont have a CD for it.

----------

## KiberGus

I think that writing to linux partitions from windows is a bad idea. It may crash your file system. So it's better to use FAT partition to share data.

----------

## MickKi

 *Cornflake wrote:*   

> Well, here is my problem:
> 
> I did a dual boot and everything went okay, except I cant boot into Windows XP. I get the hal.dll file is missing or corrupt error.
> 
> So what I wanted to do was get a fresh copy of the hal.dll and put it in my system32 as well as rewrite the boot.ini (which I figure it the problem since the partitions are no longer correct; I think)

 

You're right.  If you have a corrupt hal.dll your WinXP will probably fall over itself when it tries to probe and automount different drives, CD/DVD and other devices.  The only fix is to replace it with a healthy copy.  Here's the catch:  last time I checked the Linux kernel ability to write to NTFS, it could only safely do so if the file you wrote was already there and any writing to it left it in exactly the same size and location!  If your hal.dll is corrupted then it is likely that a healthy hal.dll file will have a different size.  Slapping it on your NTFS partition using Linux to do so will most likely corrupt your NTFS tree.

 *Cornflake wrote:*   

> This is the boot.ini: 
> 
> [boot loader]
> 
> timeout=3
> ...

 

Partition(2) should be partition(0).  DOS like Grub counts devices from 0.

 *Cornflake wrote:*   

> I cant run the recovery console because I dont have a CD for it.

 

The best recovery solution if you cannot borrow a WinXP or Win2K installation CD is to make a Bart's PE Live CD and use that to edit/copy the required files without fear of damaging your NTFS.  You'll probably need a working M$Windoze box for doing this - I haven't tried building one using WINE but I guess you could have a go and report back?

----------

