Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read NTFS partitions in 5 minutes or less
#1

How to enable NTFS read support in Red Hat Linux 8/9/Fedora Core Release 1/2/3.

 

NTFS partitions can be read and even written to in Linux, but by default in Red Hat, it's not included for legal reasons. I do not recommend write support unless you don't care about your data.

 

Windows NT/2000/XP/2k3 Server all use NTFS so using this howto will allow you to mount shares on a dual boot system.

 

Quote:To installl NTFS read support in Red Hat 9 (or 8.0) or Fedora Core release 1/2/3 do this:- First go here (click on the link)

 

[/url][url=http://www.linux-ntfs.org/]http://www.linux-ntfs.org/

 

You must match your kernel version with the NTFS rpm download in the tables listed on the link above.

 

For example, if your kernel version is 2.4.20-18.9 then download the corresponding rpm.
 

To find out what your kernel version is open a console and login as su -

 

then type

 



Code:
uname -a




The console should display something like this

 

Quote:root@c-1daa70d5 root]# uname -a 2.4.20-18.9
 

That's your kernel version. If you have a Pentium 4 then download the i686 version, if its a Pentium 3, go for I586 and so on.

 

Once downloaded do as follows:

 

Login as root and type

 



Code:
rpm -ivh kernel-ntfs-version.cpu.rpm




 

Obviously, in the example above, kernel-ntfs-version.cpu.rpm must match your downloaded rpm otherwise it will not work. Look at how it appears below when i installed the rpm.

 

Quote:[root@c-1daa70d5 rpms]# rpm -ivh kernel-ntfs-2.4.20-9.i686.rpm Preparing...

########################################### [100%] 1:kernel-ntfs ########################################### [100%]

[root@c-1daa70d5 rpms]#
Thats it, now you have read access to NTFS partitions, now its time to mount a those partitions.

 

 

Open a console and as root type

 



Code:
fdisk -l




 

to list the partitions on your linux/windows system.

 

the output should look something like this:-

 

Quote:Disk /dev/hda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes 

Device Boot Start End Blocks Id System

 

/dev/hda1 * 1 1360 10924168+ c Win95 FAT32 (LBA)

/dev/hda2 1361 4863 28137847+ f Win95 Ext'd (LBA)

/dev/hda5 1361 3059 13647186 7 HPFS/NTFS

/dev/hda6 3060 3077 144553+ 83 Linux

/dev/hda7 3078 4776 13647186 83 Linux

/dev/hda8 4777 4863 698796 82 Linux swap
 

The fdisk -l command (that's as lowercase L as in list) we did above tells us that Windows XP in this case, is on /dev/hda5. We now have enough info to start mounting it.

 

Now you must create a directory that will hold the windows XP 'mount point'.

 

To do that type

 

 



Code:
mkdir /home/anyweb/winXP




or similar. It will be read/write as root but thats sufficient for this TIP. Once you have created the directory, now is time to mount it, so as root type the following:-

 



Code:
mount -t ntfs /dev/hda5 /home/anyweb/winXP




The two important parts above are

 

/dev/hda5

 

which we identified with fdisk -l and

 

/home/anyweb/winXP

 

which is simply a directory that we created to 'hold' the winXP mount.

 

to let NON root users have access to your NTFS mnt, add a line similar to the following (change to suit your mount setup) to /etc/fstab

 



Code:
/dev/hda5 /home/anyweb/winXP ntfs ro,umask=000 0 0




 

 

once done, lets 'submit' those changes to /etc/fstab

 



Code:
mount -a




 

cheers

 

anyweb

Reply
#2
I was able to mount the NTFS drive just fine. But I am unable to access it under my profile. I have to be root and I can not change the permissions for some reason even if I log in as root. Did I miss a step or do something wrong? o_O
Reply
#3
By default, NTFS is going to be read only. So you can't really change permissions on something that's read only. But even if you mount it with write support, NTFS doesn't "understand" linux permissions.
Reply
#4

Hi

 

does this work for SuSe 9.1, too?

Reply
#5

no need

 

\i have suse 9.1 here and it already reads ntfs

 

the professional edition that is. are you using suse 9.1 pro ?

 

cheers

 

anyweb

Reply
#6
I am planning to install it the next days and wanted to make sure i can take over my data from ntfs partitions. Of course i will change to a linux filesystem then...
Reply
#7

Hi!

 

I've been trying to get access to my USB hard driver on my non-root user for few hours and still no luck.

I've tryed to change the fstab settings and it didn't work so I followed this tutorial and still nothing. :(

 

Some info:

Fedora Core 4

Kernel versio:

Quote:2.6.15-1.1833_FC4
Hard drive which I've been trying to access:
Quote:Device Boot Start End Blocks Id System/dev/sda1 1 20023 160834716 7 HPFS/NTFS
Mount dir: /media/Paikallinen_levy

Fstab:

Quote:/dev/sda1 /media/Paikallinen_levy ntfs ro,umask=000 0 0
Reply
#8

hi,

 

try make your umask as the following 022 so your fstab should look like:

 



Code:
/dev/sda1 /media/Paikallinen_levy ntfs ro,umask=022 0 0




Reply
#9

Quote:hi, 

try make your umask as the following 022 so your fstab should look like:

 



Code:
/dev/sda1 /media/Paikallinen_levy ntfs ro,umask=022 0 0

<div>


</div>
 

Nope still it keeps blocking me :/

 

I checked the access things with ls -l and this is what i got:



Code:
[root@localhost media]# ls -l
total 102
drwxr-xr-x  2 root root  4096 Apr  2  2006 cdrecorder
dr-xr-xr-x  1 root root  2048 Apr  2 15:42 cdrecorder1
drwxr-xr-x  2 root root  4096 Apr  2 17:23 D
dr-x------  1 root root 86016 Apr  2 12:57 Paikallinen_levy




Reply
#10

Quote:Hi!
 

Hello :)

 

Quote:I've been trying to get access to my USB hard driver on my non-root user for few hours and still no luck. I've tryed to change the fstab settings and it didn't work so I followed this tutorial and still nothing. :(
 

Non-root mount.. to do this you need to add an entry into your fstab..

 



Code:
/dev/DEVICE  /mnt/POINT  FSTYPE OPTIONS,user  0  0




 

So in your example:

 



Code:
/dev/sda1  /media/Paikallinen_levy  ntfs  ro,umask=000,user  0  0




 

Adding "user" will allow a user to mount/umount the drive.

 

:)

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)