PDA

View Full Version : How can i WRITE to HDA1 (primary ntfs partition)????



XeoNoX
05-20-2004, 09:16 PM
How can i read and write to HDA1 wich is my hard drive that contains my windows partition as NTFS? I am just able to read it but i can't write to it.

Craig2
05-21-2004, 01:14 AM
What does your fstab say (with hda1 mounted)?

I can't answer specifically for NTFS partitions, but partitions are mounted read only on purpose. In order to write to a partition, you need to unmount it, then remount it so its writeable.

umount hda1 should unmount it.

First, make sure you have everything closed that was accessing the partition. If you have konqueror open, for example, and were browsing the partition, you'll get an error message that says that the partition can't be unmounted, its in use. Close konqueror (or just the tab that you were browsing the partition with), and you should then be able to unmount. If you still can't unmount, type:
fuser -m /dev/hda1

and that will tell you the process numbers of the applications that are still using the partition. If there aren't any, then try typing:

umount -l hda1

and that should work in a just a couple of seconds.

Once the partition is unmounted, then you mount it, with the writeable flag,

mount -o rw hda1
or
mount -w hda1

may work, or

mount -w -t ntfs hda1

may work.

After trying one of the above, you may be able to write to the partition only while logged on as root. If that is the case, then you need to change the uid, gid, and umask settings in fstab. You can google for the correct settings if that is the case. And if this is the case, your partition is correctly mounted as writeable, you just need to change permissions as indicated in the previous sentence.

I don't have any ntfs partitions, so the above is without warranty, and I'm not responsible if you damage your system. You should wait for someone else to post their solution, as I know there are issues with writing to ntfs (it wasn't even possible in earlier versions of knoppix, or any earlier Linux distros). Always backup first.

Also look at man mount, man unmount. Also, if there are other users on the system, it is possible to change the flag to writeable on a partition without unmounting it, man mount should have that info, I don't know how reliable/safe it is to do so.

eco2geek
05-21-2004, 05:10 AM
Don't try mounting your NTFS partition read-write and writing to it using the NTFS drivers that come with the kernel. Data corruption could result. Mounting your NTFS partition read-only is perfectly safe, however.

In order to write to it, you can use the Captive project's (http://www.jankratochvil.net/project/captive/) software, to which there's a handy link in the Knoppix menu on the K menu (Knoppix > Utilities > Captive NTFS) or on the panel. It uses binaries from Windows XP in order to (safely) mount NTFS partitions in read-write mode.

Clicking the "Captive NTFS" menu entry will bring up a GUI-based installer, named "captive-install-acquire," that will allow you to a) scan a local partition for the needed files; b) specify where the files are, including network shares; or c) download them from Microsoft. It will then copy the files (cdfs.sys, fastfat.sys, ntfs.sys and ntoskrnl.exe) to /var/lib/captive and set up the program. At the end, it will give you a short explanation of how to mount your NTFS partition; e.g. as root, type the command

mount captive-ntfs /dev/hda1 /mnt/hda1

(use whatever mountpoint you desire).

You should read the man page for captive-install-acquire for information on how to run it from the bash prompt (i.e. without the GUI).

And you should definitely browse through the Captive user support/bug list (http://www.jankratochvil.net/pipermail/captive-list/) mailing list archives before you start using it. It'll provide answers to quite a few questions.

My experience with it is that a) it's better to use partitions mounted with it from the bash prompt, because using it with graphical file managers like Konqueror eats up a ton of memory; b) it's somewhat flaky; and c) it's much more reliable at creating files than it is at editing existing files. Plus, the data isn't permanently saved until you unmount the partition.

XeoNoX
05-21-2004, 05:44 AM
thanks guys, i just ended up right clicking on the drive within konquer and unmounting the drive then mounting the drive again and it seemed to have worked fine on the fat32 partition, i didnt want to attpempt it on my ntfs partition from what i have been reading. thanks again guys.