LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 03-10-2005, 01:13 PM   #1
mac57
Member
 
Registered: Nov 2004
Location: Texas
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253

Rep: Reputation: 30
HOWTO - Write Access to NTFS Partitions


Great news! I have just achieved full write access to the Windows XP NTFS partition on my dual boot MDK 10.1 / Win XP computer. I know that this is a bit of a "holy grail" and I thought I would pass along the winning "recipe" to the group, lest others wish to use it.

The secret is using a package called "captive", short for captive-ntfs. Captive uses Windows' own ntfs drivers, via a wine-like set of interfaces which allows them to run successfully on top of MDK (most linux distros in fact). Because it uses Windows' own drivers, it is uncondititionally safe.

To get captive, go to

http://www.jankratochvil.net/project/captive/

and download captive-static-1.1.5-0.i386.rpm

I did this on my Mandrake 10.1 CE system, and so can't vouch for other Mandrake versions, but I suspect that the following will work on any 10.x Mandrake (and it says it has been verified on Mandrake 9.1 as well).

To use captive:

1. su to root
2. Make sure that you have your NTFS windows C: drive mounted
3. Install the captive rpm, via "rpm -Uvih captive-static-1.1.5-0.i386.rpm"

This will seem to take a long time, and you will hear your hard drive being accessed a lot. This is because as part of the install, this package searches your hard drive to find the existing Window's NTFS drivers (that is why there is a need to have the Windows C: drive mounted before you do this).

4. When done, check that the drivers you want were found via the following command (still as root)

captive-install-acquire

This should pop up a window showing all of the drivers that were found, and offer to scan your hard drive for more. In my case, it listed all the right drivers. I clicked Next to have it scan anyway - I would recommend against this, if all the right drivers were found anyway - in my case it got stuck here, and I had to kill the process.

5. Update /etc/fstab:
- the install of the captive package updates your /etc/fstab, backing up your original to /etc/fstab.pre-captive
- the /etc/fstab update is a little brain dead - it just adds a new line at the bottom, but doesn't delete the original Mandrake fstab line for your windows drive. Delete it now.
- In its default state, the line added to fstab only grants root write access to the NTFS partition. To fix that, I added the keywords "gid=users,uid=my_userid" (where I put my actual userid in place of "my_userid") to the fstab line, and made a few other changes.

Here is the final fstab line I am working with (my userid is "emcee"):

/dev/hda1 /mnt/win_c captive-ntfs auto,rw,gid=users,uid=emcee,users 0 0

Save off fstab.

That's it! You are now ready to use captive-ntfs. To do this, either restart or do the following:

a) unmount your Windows NTFS partition if it mounted, and then issue the above command as root:
b) mount /mnt/win_c

Either of these two actions will result in your /mnt/win_c now using the captive-ntfs drivers.

You should now be able to cd to /mnt/win_c, and do an "ls -al" and observe that all of the files are owned by group "users" and user "emcee" (of course, you would have substituted your own userid in the /etc/fstab entry, and so your userid would show up not mine!).

You can now freely create, delete, copy, etc. files on the NTFS partition. Because you are using Windows' own drivers, you are assured that you will not damage the partition.

Have fun!
 
Old 03-10-2005, 03:14 PM   #2
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
Yes, it works just fine with 10.1 Powerpack & Retail.

I've been using it this way since 10.1 came out.

Good writeup.
 
Old 03-14-2005, 09:02 AM   #3
mac57
Member
 
Registered: Nov 2004
Location: Texas
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253

Original Poster
Rep: Reputation: 30
Hold the presses! I seem to have spoken too soon.

While everything appears to work just fine, when I boot into Win XP, the files and/or directories I created do not show up. Thinking I perhaps has older NTFS drivers on my Win XP setup, I even forced the captive-install-acquire to download new ones, but the same result. I have tried it using the default fstab that captive installed and the modified one I wrote about in my first post. No joy either way. The files copy over and look great from MDK, but don't show up under Win XP.

Has anyone encountered this? Any thoughts on how to resolve it? It sure would be nice to be able to write to that Win XP partition. Thanks.
 
Old 03-19-2005, 10:31 AM   #4
Zendar
LQ Newbie
 
Registered: Mar 2005
Location: Málaga, Spain
Distribution: Linux Mandrake 10.1
Posts: 3

Rep: Reputation: 0
Same thing to me.... żanybody can help us?
 
Old 03-19-2005, 10:36 AM   #5
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
Did you set the writes to "sync?" on that partition?

Otherwise Linux will cache all writes to the NTFS volume, and because of the Windows Driver involved, never seems to actually flush the write cache.

I remember running into this problem too.
 
Old 03-19-2005, 04:00 PM   #6
mac57
Member
 
Registered: Nov 2004
Location: Texas
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253

Original Poster
Rep: Reputation: 30
Thanks, no I hadn't done that. I will give it a try and see what happens.

In the meantime, I seem to have discovered that if I create a top level directory entry on the NTFS volume, and confine my writes to there, all is well. My initial tests were WAY down in the directory hierarchy, and I decided to try one from the top just as a test. It seemed to work out just fine. Hope use of the "sync" option make the rest of it work well. Thanks again.
 
Old 03-19-2005, 04:23 PM   #7
mac57
Member
 
Registered: Nov 2004
Location: Texas
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253

Original Poster
Rep: Reputation: 30
That did it! I unmounted and remounted my NTFS volume, this time specifying the "snyc" option, and it worked like a champ. I created a directory and file WAY WAY down in the NTFS file tree, and then rebooted over to Windows. There is was! Using "sync" seems to have done it.

For everyone else out there, you can do this one of two ways:

1) fstab

Simply add "sync" to the list of options I specified in my first post on this (same area where I had reported setting the "rw", "gid" and "uid" options - just add ",sync" to the end of that list

2) Manually mounting (unmount first, then remount with the right options)

# umount /mnt/win_c

# mount -t captive-ntfs /dev/hda1 /mnt/win_c -o rw,sync,gid=users,uid=emcee,users

That did it for me! Of course, you will need to substitute your own userid where I show "emcee" in the above line, and use the appropriate disk for your system where I show "/dev/hda1" in the above line.

Thanks for the tip!
 
Old 03-19-2005, 04:36 PM   #8
Zendar
LQ Newbie
 
Registered: Mar 2005
Location: Málaga, Spain
Distribution: Linux Mandrake 10.1
Posts: 3

Rep: Reputation: 0
Cool, i'll try too thanks for the help
 
Old 03-20-2005, 01:15 AM   #9
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
No problem!
 
Old 03-20-2005, 06:50 AM   #10
Zendar
LQ Newbie
 
Registered: Mar 2005
Location: Málaga, Spain
Distribution: Linux Mandrake 10.1
Posts: 3

Rep: Reputation: 0
I tried, but...

Hey guys, still not working for me this is the my line added to fstab....

/dev/hda1 /mnt/win_c captive-ntfs rw,sync,gid=users,uid=zen,users 0 0

Do you see something wrong here?

Regards, Zen

P.D. Lol, i just realized i've forgotten de parameter 'auto'... I have added it but still it isn't working....

Last edited by Zendar; 03-20-2005 at 07:02 AM.
 
Old 03-20-2005, 12:13 PM   #11
mac57
Member
 
Registered: Nov 2004
Location: Texas
Distribution: openSUSE 10.3, Yoper Linux 3.0 , Arch Linux 2007.08
Posts: 253

Original Poster
Rep: Reputation: 30
One last thought. If you unmount the drive manually (i.e. su to root and umount /dev/hda1) that *should* force Mandrake to flush the disk buffer, no matter what options you have specified on the fstab line. Try that and see. I have to admit that my trial with the sync option was done manually; I haven't gone back to the fstab version yet, since I don't want to write to that NTFS volume all that often. Try manually unmounting before booting to Windows and see if that helps.
 
Old 03-21-2005, 03:21 PM   #12
Siryel
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Rep: Reputation: 0
Hya,

I recently installed Suse 9.2 on my machine, and was trying to have write access to my windows drive.
I followed all the instructions above and it seems to work fine up to the 'restart' point.

I restarted, tried, still no write access
Went to check my mounted drives and none were there

entered:
mount -t captive-ntfs /dev/hda1 mnt/captive-noname -o rw,sync,gid=users,uid=ST,users

as advised and get the following message:
Mount point directory not a valid directory: mnt/captive-noname at /sbin/mount.captive-ntfs line 47.

Went to:
/sbin/mount.captive-ntfs line 47.
and that looks like chinese to me

Any advice please

btw: very green newbie here, so please speak slowly


Cheers,
Steph
 
Old 03-21-2005, 04:06 PM   #13
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
Syntax error!

mkdir /mnt/captive-noname
mount -t captive-ntfs /dev/hda1 /mnt/captive-noname -o rw,sync,gid=users,uid=ST,users

Or

mkdir /mnt/captive
mount -t captive-ntfs /dev/hda1 /mnt/captive -o rw,sync,gid=users,uid=ST,users

Notice the slash in front of /mnt ?

It's needed.
 
Old 03-22-2005, 03:23 AM   #14
Siryel
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Rep: Reputation: 0
Thanks

Feeling very blonde now, how well....


Although mounting my drive again + restarting still hasn't given me write access to them...

Any idea?

Cheers,
Steph
 
Old 03-22-2005, 04:34 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,309

Rep: Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032
Hate to rain on everyones parade, but this is not safe.
From the captive site;
Quote:
Mounting of NTFS devices usually works, but is no longer supported by the author of Captive.
Your data, your decision ...

Me, I mount read only.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting NTFS partitions with write access Tinky1901 Debian 13 04-09-2005 09:22 AM
read/write ntfs partitions!!!! mlu Linux - Software 2 01-20-2005 01:42 PM
Does captive support write access for Win2k NTFS partitions? dreamtheater Linux - Software 1 03-09-2004 02:06 AM
Can't write to vfat and ntfs partitions linuxfond Linux - Newbie 7 11-12-2003 04:54 PM
I can't write enable my ntfs partitions ItWillNeverWork Linux - Hardware 5 10-26-2003 02:23 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration