Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



Does Linux support NTFS?

acidosmosis
07-22-2003, 06:27 PM
Does Linux support NTFS?

This was a question asked and talked about in #3dspotlight (unofficial IRC chatroom for TechSpot).

There is an article at www.anandtech.com about this. I am posting this article with a link so people can find this here if the question comes up again.



This article is located at http://www.anandtech.com/guides/viewfaq.html?i=121

I in no way claim that this is my work.


All modern Linux kernels (all 2.4.x and many 2.2.x) DO support NTFS in read-only mode.

Long Answer:
Although you can read NTFS partitions created with any version of Windows NT, you can not WRITE to an NTFS partition created with Windows 2000, XP, or anything yet to come. NTFS partitions created with Windows NT 4.0 and earlier CAN be written to, but this tends to make a mess of the file system, so make sure to do a chkdsk when you boot into NT after writing from Linux.

Below are in-depth instructions on how to gain access to your NTFS partition from Linux.

To access your NTFS partition:


Open a shell if you haven't already.

Become root. Do this by running su and entering your root password when prompted.

Create a mount point for the NTFS partition. mkdir /mnt/ntfs

Mount your NTFS partition. mount -t ntfs -o umask=644 /dev/device /mnt/ntfs
Replace device with the name of your NTFS partition. See below for advice on how to find this if you don't know.

The contents of the NTFS partition is now part of your tree. When you want to access a file on it, just think of /mnt/ntfs as C:\ and you're all set.

When you are done, repeat steps 1 and 2 (if you exited the shell) and run umount /mnt/ntfs
If you want all that to be done automatically when you boot Linux (doesn't take effect until you reboot of course):

Open a shell and become root as described before.

Open your fstab file. kedit /etc/fstab
Note that this assumes you have KEdit (part of the kdeapps package) installed. If you don't, replace kedit with vim, xemacs, gnotepad, or whatever text editor you like.

Add this line somewhere in the file:
/dev/device /mnt/ntfs ntfs umask=000 0 0

Save and exit.
Note that you have to make sure the directory /mnt/ntfs exists before you reboot, or else it just won't work.

To figure out what device your NTFS partition is:

What kind of hard drive is it on?
If it's on an internal IDE drive, it will be HDxy
If it's on a SCSI drive, or a pen drive, or an IDE drive hooked up to USB or FireWire, or any number of bizarre methods, it will be SDxy


Which device letter (x) is it?
IDE drives will be A for primary master, B, for primary slave, C for secondary master, and so on.
SCSI and other drives will be A for the first detected, B for second, and so on.

If that doesn't help, run dmesg | less and look through it for clues.


Which partition number (y) is it?
The first partition on the disk will be 1, and the second will be 2, and so on.

So if it's the second partition on your primary master IDE drive, the device is HDA2
If you get an error about NTFS not being supported by your kernel, the first thing you should try is to install the NTFS kernel module:

Open a shell and become root.

Install the module. modprobe ntfs
If no errors, try mounting again. If you do get an error, you might have to build yourself a new kernel

Phantasm66
07-22-2003, 07:16 PM
It can read NTFS no problem.

It can write to it to, however this is EXTREMELY problematic, and can cause data corruption.

You will have to have NTFS compiled as a kernel module, or into the kernel itself.

Ad
07-22-2003, 07:16 PM
  

acidosmosis
07-22-2003, 07:24 PM
Phant, have any links about that you can post here?

Phantasm66
07-22-2003, 07:43 PM
First and foremost, have you actually tried to mount an ntfs partition ? The module may already be compiled...

mount -t ntfs /dev/hda3 /mnt/mountpoint

where /dev/hda3 is the ntfs partition and /mnt/mountpoint is - you guessed it - the mount point

acidosmosis
07-22-2003, 08:24 PM
Not I. I just posted this information because I figured someone would find it useful.

Phantasm66
07-23-2003, 04:28 AM
I will post instructions on how to compile the kernel if you want....

Spike
03-10-2004, 02:47 AM
Seem to recall from compiling it, that the 2.6.2 kernel has slightly better NTFS write support? You guys probably know better than I do. :D

MattG
03-12-2004, 06:26 PM
the new 2.6.4 kernel is at stable now...anyone know if this has NTFS support, or...much better than before?

Nodsu
03-15-2004, 03:36 AM
NTFS read support has been in Linux kernel since 2.4. 2.6 kernels up to 2.6.4 support very limited NTFS writing - you can write to an existing file if you don't change its size (you can enable full writing also if you don't mind trashing the whole NTFS filesystem).

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

TechSpot Blog: Disable Windows automatic check for solutions after a program crashes

Weekend Open Forum: Google Chrome OS and the future of cloud computing

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Another iPhone worm spotted, this time it's dangerous

Stardock CEO: Steam holds 70% of digital game distribution market

Google: Android, Chrome OS to converge eventually

Microsoft to showcase Natal at Gamefest in February

Microsoft and News Corp potential alliance, against the open Web

More Tech News

  
 Software Downloads

FlashGot 1.2.0.9

RemoveIT Pro XT - SE 23.11.2009

Vuze (Formerly Azureus) 4.3.0.4

RemoveIT Pro v7 Enterprise 23.11.2009

Aloaha PDF Suite 3.9.172

Blindwrite Suite 6.3.1.5

RemoveIT Pro v7 Ultra 23.11.2009

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.