# [RESOLVED] NTFS Write Support respect NTFS Permissions?

## AstroTux

Hi,

As the subject. I've enabled NTFS write support in the Kernel. Mounting does not suggest a read-oinly mode for any reason, and appears to mount in read/write mode. If I attempt to create a plain text file on the root of what is my C:\ drive for Windows (/dev/hda1) it says "Permission Denied". I presume if it was mounted read-only, it would say "Read Only mode" instead? This is within Nano.

Do I need to alter the permissions on the NTFS drive to allow "Everyone" (under Windows) to be able to write to the partition in Linux? I find it odd that if the permissions are preventing me writing, that I can read it, as the only permissions on the drive are all "Full Control" under Windows anyway.  :Confused:   The Windows OS is Windows 2000 Pro, Linux Kernel version is 2.6.16-gentoo-r9 compiled by myself.

```
mount /dev/hda1 /mnt/win
```

returned nothing, and had mounted.

Do I need to put anything in the /etc/fstab file for this to allow read/write? I am root when issuing mount.

Best regards,

AstroTux.

----------

## Aries-Belgium

I remember that you had to set the umask flag for writing to a FAT32 filesystem, so I guess you also have to do that for NTFS:

```
mount -t ntfs -o rw,umask=0000
```

This will set the permissions to rwx for all users.

----------

## AstroTux

Hi,

OK. I'll give it a try!

EDIT: Could someone explain how the umask works? It says here:

 *Quote:*   

> Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal.

 

How does that work then? Is it an AND or XOR operation on the bits?

Best regards,

AstroTux.

----------

## rhill

/usr/src/linux/Documentation/filesystems/ntfs.txt

```
- This is a complete rewrite of the NTFS driver that used to be in the 2.4 and

  earlier kernels.  This new driver implements NTFS read support and is

  functionally equivalent to the old ntfs driver and it also implements limited

  write support.  The biggest limitation at present is that files/directories

  cannot be created or deleted. See below for the list of write features that

  are so far supported.[...]
```

until recently (2.6.15 or 16?) you also couldn't make a write that would change the size of an NTFS file, so check your local copy to see what's supported on the kernel you're running.

----------

## AstroTux

Hi,

Ahhh....... OK. I do know that previously write wasn't an option, then it was very limited, but I didn't know the specifics. I was under the impression that it was now fully implemented, but I stand corrected.

Best regards,

AstroTux.

----------

## Aries-Belgium

 *AstroTux wrote:*   

> 
> 
> EDIT: Could someone explain how the umask works? It says here:
> 
>  *Quote:*   Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal. 
> ...

 

The umask is the opposite of the linux permissions.

It is always 7 minus the prefered permission, so if you would like to set r-x (5) it would be:

```
7 - 5 = 2
```

----------

## AstroTux

Hi,

Thanks!!  :Smile:   That makes sense.

Best regards,

AstroTux.

----------

## TheWhiteKnight

After trying this (and yes i compiled the ntfs support in my kernel)  I get "unknown filesystem type ntfs".  Do I need to add the cfg to my fstab?  I have 2 drives filled with mp3's that I would like to listen too.  Thanks!

- Josh[/gwn]

----------

## linuxtuxhellsinki

Maybe you don't have correct codepages in your Kernel   :Question: 

```
 CONFIG_NLS=y

CONFIG_NLS_DEFAULT="iso8859-15"

CONFIG_NLS_CODEPAGE_437=y

# CONFIG_NLS_CODEPAGE_737 is not set

# CONFIG_NLS_CODEPAGE_775 is not set

CONFIG_NLS_CODEPAGE_850=y

CONFIG_NLS_CODEPAGE_852=y

.........
```

----------

## TheWhiteKnight

 *linuxtuxhellsinki wrote:*   

> Maybe you don't have correct codepages in your Kernel  
> 
> ```
>  CONFIG_NLS=y
> 
> ...

 

 Very dumb question, but how can I tell / check on this code in my kernel?

----------

## Aries-Belgium

 *TheWhiteKnight wrote:*   

>  *linuxtuxhellsinki wrote:*   Maybe you don't have correct codepages in your Kernel  
> 
> ```
>  CONFIG_NLS=y
> 
> ...

 

```
grep "CONFIG_NLS" /usr/src/linux/.config
```

----------

## TheWhiteKnight

No it's not in there.  Can I edit the /.config file to suite my needs or do I have to recompile my kernel?  Also if I have to recompile, what do I need to put in there?

Let me re-phrase..  It's "not set"  but I DID compile NTFS support into my kernel.

EDIT:  :: bangs head against the wall, computer desk, floor, car door(s) ::  I emerged ntfsprogs which went fast, I forgot to check on emerging sys-fs/fuse....... 62 packages later .....   I will be compiliing until the cows come home.

----------

## TheWhiteKnight

[SOLVED] 

I was playing around with the fstab and instead of having /dev/hdc I <as a fluke> put in hdc1 and hdd1 and KDM popped right up with mounting the drives.  w00t!

Thanks to all that helped me on this!!!

----------

