# Mount ntfs rw???

## MarcoRacer

I want to mount my ntfs partition with write mode,

but i try so many ways and still don´t work,

i´m using kernel gentoo-sources-2.6.17-r5

and the last thing i do was change my fstab to:

/dev/hda1    /mnt/hd       ntfs     rw,uid=1000,gid=100

i try use umask, but not work too!

how can i write in my partitions ntfs, using oly the kernel modules???

----------

## drescherjm

Install ntfs-3g, The builtin kernel driver will only let you write to a file as long as you don't make it take any more blocks on the disk so it is only good if you need to edit a windows config file or something for disaster recovery...

----------

## MarcoRacer

why i need the ntfs-3g???

why i can´t write with only the kernel modules default??

thanks..

----------

## drescherjm

 *Quote:*   

> why i can´t write with only the kernel modules default?? 

 

Because the kernel modules only support limited writing as I stated above. With the kernel modules you can not create a new  file you can only edit a file provided you do not increase the number of disk blocks it occupies.

Here is a link that explains the write support in kernel driver: http://bisqwit.iki.fi/story/howto/ntfs/

----------

## MarcoRacer

and how i can create a large file like bkps 

an store in ntfs partition on linux?

----------

## ONEEYEMAN

Hi, ALL,

What options I should use in /etc/fstab so that I have a write access?

Thank you.

----------

## batistuta

Please search a bit before posting...

but to sumarize:

Kernel does not support ntfs write. you have two options. Captivefs or ntfs-3G

none of them are production ready and you should not use this in critical systems.

captivefs has been tested a bit more and uses windows drivers directly. So it is slower compared to native support. ntfs-3g is native, but has been developed kind of "reverse engineering" the ntfs filesystem, so there is always a risk.

----------

## ONEEYEMAN

Thank you for the reply, batistuta.

Can I access the ntfs by choosing vfat?

Thank you.

----------

## davascript

 *Quote:*   

> Can I access the ntfs by choosing vfat? 

 

No.  You have to use the captivefs or ntfs-3g packages.  even then the only way you can write to an ntfs partition is to chaneg a file.  It must stay the same size, and you cannot create new files.  Try googling ntfs-3g.  i am in the same situation right now, I am looking into a new drive and formatting to jfs then transferring all my data to it.

----------

## ONEEYEMAN

Thank you for the fast reply.

Thank, I guess, I don't have much of a choice: samba + cifs on a dual boot machine...   :Sad: 

Thank you.

----------

## nixnut

merged above five posts here.

----------

## drescherjm

 *Quote:*   

> No. You have to use the captivefs or ntfs-3g packages. even then the only way you can write to an ntfs partition is to chaneg a file. It must stay the same size, and you cannot create new files.

 

I believe this is incorrect as you can create new files and delete files with both captivefs or ntfs-3g. The problem is that captivefs is very buggy and ntfs-3g  is very new so it is not tested for a long time.

----------

## batistuta

 *Quote:*   

> You have to use the captivefs or ntfs-3g packages. even then the only way you can write to an ntfs partition is to chaneg a file. It must stay the same size, and you cannot create new files.

 

This is true for kernel ntfs write support. Kernel write support allows writing as long as the filesize is not changed. CaptiveFS and ntfs-3g allow all file operations.

CaptiveFS uses the Windows dlls, so it is kind of like writing through wine if you wanna think it that way. But since it uses the actual Windows dlls, it is somehow robust in the sense that there won't be a bug related to a wrong write format. ntfs-3G on the other hand was made by reverse engineering the filesystem. So all the developer can do is test and test. He claims to have tested A LOT, but you never know if there is not a very very very special case that he was not able to reverse engineer and might corrupt your filesystem.

So my advice: 

- If you just need to exchange data between win and Linux, consider using vfat for that until ntfs-3G goes under more testing. Keep in mind the maximum filesystem size of (I believe 4G of vfat)

- If you need ocasional writing when performance is not that critical, try captiveFS

- if you need faster performance with ntfs and need rw support, then play with ntfs-3G

In either of the later 2 cases don't forget to backup regularly.

----------

## davascript

 *Quote:*   

> This is true for kernel ntfs write support. Kernel write support allows writing as long as the filesize is not changed. CaptiveFS and ntfs-3g allow all file operations. 

 

I got mixed up and to tell you the truth i havent been able to get ntfs-3g to write to my ntfs partition.  i think i have the filesystem wrong in /etc/fstab.  but anyway thanks for clearing that up. 

 *Quote:*   

> Keep in mind the maximum filesystem size of (I believe 4G of vfat) 

 

Isn't it 32 gb max?

----------

## jmbsvicetto

davascript,

I think batistuta might have meant the maximum file size, which I think is 2GB.

----------

## batistuta

 *jmbsvicetto wrote:*   

> davascript,
> 
> I think batistuta might have meant the maximum file size, which I think is 2GiB.

 

Yeap, I've meant filesize. And even then I got it wrong, because it is 4GiB and not 2GiB. Sorry, I was very tired when I wrote that yesterday

This might be an issue, specially if plan to use that for video files or ISO images.

davascript: could you post your fstab?

----------

## jmbsvicetto

 *batistuta wrote:*   

>  *jmbsvicetto wrote:*   davascript,
> 
> I think batistuta might have meant the maximum file size, which I think is 2GiB. 
> 
> Yeap, I've meant filesize. And even then I got it wrong, because it is 4GiB and not 2GiB. Sorry, I was very tired when I wrote that yesterday
> ...

 

batistuta,

you were right. You said 4GB. I thought it was 2GB, so it was me who was wrong. Thanks for the correction.

----------

## arwing

actually it is one byte less than 4gb but thats just being pedantic.  Also the maximum size of a fat32 partition is something like 2Tb but windows only lets you format up to 8Gb IIRC.  I've used ntfs-3g since it was released and I've had no troubles at all, but I regularly run scandisk for the hell of it.

Also the correct type entry in fstab for an ntfs partition mouted with ntfs-3g is "ntfs-3g" but you should be able to test if you have ntfs-3g working correctly without editing fstab using "mount.ntfs-3g"  

fstab is only an index and is used to automatcly mount partitions at boot, or to shorten the length of the "mount" command, it does not have anything to do with not being able to mount a partiton at all.

----------

## ONEEYEMAN

Hi, ALL,

Can I use SAMBA to access the XP partition on the same PC (dual-boot machine)?

Thank you.

----------

## arwing

 *ONEEYEMAN wrote:*   

> Hi, ALL,
> 
> Can I use SAMBA to access the XP partition on the same PC (dual-boot machine)?
> 
> Thank you.

 No. Samba is an SMB filesever not a filesystem driver.

----------

## ONEEYEMAN

OK, thanx.

I guess, I AM stuck with the "ntfs" and either "ntfs-3g" or "CaptiveFS"...   :Sad: 

Thank you.

----------

## batistuta

Samba is a client/server protocol for exchanging data between Win or Mac products and Linux. So if you have a RUNNING XP inside a virtual machine running at the same time as your linux, you could access the ntfs partition on that virtual machine. But the idea of samba is to exchange data between two running systems (either physical or virtual), not to access a local partition.

ONEEYEMAN, if you tell us what is that you are trying to do (what is the problem and goals) then maybe we can suggest you another option. What is that you need? Simply exchange data between WinXP and linux?

----------

## ONEEYEMAN

Thank you for the reply, batistuta.

I am on the network with the 2 router. I have 2 PC running Windows (ME and XP), 1 running Gentoo, which is dead at the moment after upgrading to gcc-3.4.6, and the DELL Notebook with the Dual boot.

From the notebook, I'd like to access everything: all 3 desktops, and the WinXP partition. For the WinXP partition, it will be just file transfer - copy/move and some file editing stuff.

Also, since I will do a programming through Anjuta, I'd like to be able to compile my source on the XP partition....

Hope I answered your question.   :Question:   :Smile: 

Thank you.

----------

## batistuta

I would suggest then:

- To exchange data between the two Gentoos and your Me and XP machines install samba on your Gentoo systems. NFS doesn't work two well with Windows so I'd use Samba.

- To exchange data between your Linux and XP partition on the laptop use, if you can, vfat (FAT32) unless the 4GB limit is an issue. This is the safest.

- If this is not an option (you don't have the extra partition), etc, then try one of the two ntfs write methods for linux. I've been using ntfs-3g for some time without any problems (of course permissions are not kept when copying files), but if you try these two methods then backup of your ntfs partitions is a must.

That's it!

----------

## ONEEYEMAN

 *batistuta wrote:*   

> 
> 
> I would suggest then:
> 
> - To exchange data between the two Gentoos and your Me and XP machines install samba on your Gentoo systems. NFS doesn't work two well with Windows so I'd use Samba.
> ...

 

Thank you for the reply.

1. I already installed Samba

2. What do you mean by "if you can"?

Thank you.

----------

## drescherjm

 *Quote:*   

> 2. What do you mean by "if you can"? 

 

I can answer this. Since fat32 does not allow files bigger than 4GB you can not use this option if you have such files... If you do not have files this big use fat32...

----------

## ONEEYEMAN

Thank you, for the reply.

I jus tried the "vfat" file system, and unfortunately it oes no recognize the "ntfs" one.

I put

```

/dev/sda1      /mnt/winxp       vfat       rw,users      0 0

```

in /etc/fstab, and got the 

```

FAT: bogus number of reserved sectors

VFS: Can't find a valid FAT filesystem

```

in he output of "dmesg | tail".

In my 2.6.17-r4 gentoo-sources I selected bot FAT and VFAT filesystem, since according to the docs second can't work without first.

I'm going to try and remove the FAT filesystem, and see what happens...

Thank you.

----------

## batistuta

ONEEYEMAN, ntfs and vfat are different filesystems so you can't mount an ntfs filesystem using a vfat driver.

So first, decide which filesystem to use. If different from the one installed, you need to first format the partition with the desired filesystem. Then mount with the appropriate driver.

WindowsXP usually (if not always) installs on ntfs so if you wanna mount the WinXP partition, you must use one of the ntfs drivers. Now the thing is that usually, under WinXP you use one partition for the filesystem and one for data (home, etc). For example, my Win partitions look like this

partition C:\

This is where WinXP gets installed. Since I never access this from Linux or if at all only read only, I mounted with the ntfs kernel driver (read only, no writes allowed)

partition H:\

This is where I put "My documents". I separate WinXP base and my documents in case I need to do a reinstall, because I just reinstall the base image on the C and H remains intact. I used to mount this partition as read only from linux, but now I mount it with ntfs-3g

partition X:\

I have this one since long time formated with fat32, and mount it with the vfat driver. This partition can be written by both Linux and Windows, so it was used for data exchange. If ntfs-3g works correctly (gotta test it for a bit longer) I will eventually move to ntfs since sometimes I want to exchange dvd iso images and this is a problem with fat32.

So what I meant by "if you can" is:

- You don't need files bigger than 4G

- You don't need file permissions under XP (fat32 doesn't handle permissions)

- you have a spare partion that you can format with fat32. I recommend keeping WinXp in ntfs, your home in a separate partition also with ntfs (for permissions), and third partition with fat32.

----------

## ONEEYEMAN

Thank you, batistuta.

And also, I presume, there is no way of accessing the ext3 partition from the WinXP, right?

Thank you.

----------

## sonicbhoc

Search it on google, there was a driver but I forgot where.

----------

## drescherjm

http://www.fs-driver.org/

----------

## batistuta

be careful when creating ext2/3 files from Windows, because it doesn't repect file permissions. If you have a partition that you want to hide from Windows, you'll need to use volume encryption

----------

## spielc

 *ONEEYEMAN wrote:*   

>  *batistuta wrote:*   
> 
> I would suggest then:
> 
> - To exchange data between the two Gentoos and your Me and XP machines install samba on your Gentoo systems. NFS doesn't work two well with Windows so I'd use Samba.
> ...

 

Just to add more confusion  :Wink: 

Why don't you use a ext3-partition to exchange data between windows and linux?

there is something called fs-driver for windows and can be found here. I use it here on my machine and i had much more luck with anything else i used before...

----------

## batistuta

To be honest, when I suggested that I didn't know that you could *write* on ext3 from Windows. This seems to be something relatively new, things evolve quickly on the community   :Wink: 

So I agree with spielc that this is indeed a very attractive option (maybe someone who has tried it could report on any hints, problems, tips, etc).

Don't forget about file permissions. I know that fat is not any better in this regard, but at least fat doesn't claim any permissions, and here you might be doing something different from what you want.

According to their FAQ, fs-driver inherits all group and file permissions from the parent directory (Except for the "X"). So make a directory "share" or something own by root and a group "shareXP" or something and put all users that you want in there. 

Then again, be careful if you are using ACLs or quotas, as these would not be respected from win. I would probably disable ACL and quotas alltogether for this partition.

----------

## drescherjm

 *Quote:*   

> To be honest, when I suggested that I didn't know that you could *write* on ext3 from Windows.

 

I believe the driver writes an ext3 as an ext2. I mean the writes do not do journaling. See the faq here:

http://www.fs-driver.org/faq.html#acc_ext3

Anyways I have briefly used this to sync a ~600MB cvs repository from my XP desktop at work to my linux box at home and back using a pen drive and unison. This worked great, but right now I can not remember why I did that because our cvs server has been on gentoo for years.

----------

