views:

13533

answers:

5

Hello guys,

I want to mount some internal and external NTFS drives in CentOS 5.2, preferably automatically upon boot-up. Doesn't matter if it's read/write or read-only, but read/write would be preferred, if it's safe.

Edit: Thanks for all answers, I summarized them below =)

+2  A: 

You should already have ntfs available, read-write support is now pretty reliable.
You can test it with "mount -t ntfs /dev/sdX1 /mnt/tmp" you need to know what drive the external disk is identified as (check dmesg) and you need to make a mount point.

To mount automatically everytime put a line in /etc/fstab, use one of the existing lines as an example - you will have to be root to do this.

Martin Beckett
+5  A: 

first do a

fdisk -l

get the harddrive partition, ie /dev/sda2

then

mount /dev/sda2 /mnt/windows

if this fails, try a

yum install ntfs-3g

* Just noted this is not included by default, so you can check out NTFS-3g here, and find a suitable package for your system.

to auto mount this, add a line to /etc/fstab saying

/dev/sda2      /mnt/temp     ntfs    defaults 0 0

and this should auto mount on a reboot

PostMan
+4  A: 

To answer my own question: PostMan and mgb led me to the right path, but their answers did not contain complete solution.

Note: A short manual/wiki on this question is here: http://wiki.centos.org/TipsAndTricks/NTFSPartitions

So, I am using a fresh, bare install of CentOS 5.2 with latest updates. First of all, I ran the su command to avoid any permission issues.

I created mount points for a couple of external NTFS drives:

mkdir /mnt/iomega80
mkdir /mnt/iogear250

I had to use the fdisk command, but it wasn't in my system. Here's what installs it:

yum install util-linux

Then I ran /sbin/fdisk -l and found the device names:

Disk /dev/sdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
**/dev/sdc1**   *           1       30401   244196001    7  HPFS/NTFS

Disk /dev/sdd: 82.3 GB, 82348278272 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
**/dev/sdd1**   *           1       10011    80413326    7  HPFS/NTFS

For me, they are /dev/sdc1 and /dev/sdd1.

I had to install NTFS-3G, a package that enables NTFS support on CentOS. To install NTFS-3G, I first had to include RPMFORGE in YUM repository list.

To include RPMFORGE in YUM repository list, I used these instructions: http://rpmrepo.org/RPMforge/Using. For my system, the two commands I had to run were:

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Finally, I installed NTFS-3G using this YUM command:

yum install fuse fuse-ntfs-3g dkms dkms-fuse

At last, I could use the mount command to mount the filesystems:

mount -t ntfs-3g /dev/sdc1 /mnt/iogear250
mount -t ntfs-3g /dev/sdd1 /mnt/iomega80

By adding these two lines to /etc/fstab, like previous answers suggested, I got the drives to mount upon boot-up:

/dev/sdc1               /mnt/iogear250          ntfs-3g rw,umask=0000,defaults 0 0
/dev/sdd1               /mnt/iomega80           ntfs-3g rw,umask=0000,defaults 0 0
DV
Thanks, this is exactly the sort of well researched and well written answer that is needed. The question will presumably now be locked as not programming relatedQ
Martin Beckett
+1  A: 

You forgot to mention that you need to do a reboot after installing fuse, etc.

A: 

hi, i can not mount my ntfs partition.

i have follow the above procedure, i entered below commands

[root@localhost /]# mount -t ntfs-3g /dev/sda9 /mnt/H

FATAL: Module fuse not found.

ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root

[root@localhost /]#

please can u suggest how this issue can be resolved.

thanks in advance!!

If the answers above do not solve your problem, then you should ask a *new* question. This is not a regular forum: this space is explicitly reserved for *answers*.
Stephan202