Jump to content
anyweb

How to read NTFS partitions in 5 minutes or less

Recommended Posts

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.

 

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)

 

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

 

uname -a

The console should display something like this

 

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

 

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.

 

[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

 

fdisk -l

 

to list the partitions on your linux/windows system.

 

the output should look something like this:-

 

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

 

 

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:-

 

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

 

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

 

 

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

 

mount -a

 

cheers

 

anyweb

Edited by anyweb

Share this post


Link to post
Share on other sites

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? :blink:

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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:

2.6.15-1.1833_FC4
Hard drive which I've been trying to access:
Device Boot Start End Blocks Id System

/dev/sda1 1 20023 160834716 7 HPFS/NTFS

Mount dir: /media/Paikallinen_levy

Fstab:

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

Share this post


Link to post
Share on other sites

hi,

 

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

 

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

Share this post


Link to post
Share on other sites
hi,

 

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

 

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

 

Nope still it keeps blocking me :/

 

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

[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

Share this post


Link to post
Share on other sites
Hi!

 

Hello :D

 

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..

 

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

 

So in your example:

 

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

 

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

 

^_^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...