Wednesday, December 19, 2012


How to Mount To NTFS Windows Partition in RHEL or CentOS Linux

I will describe how to mount ntfs partition or enable NTFS support in Linux CentOS Ver 5 and 6 .

Preparing and Installing EPEL repository

Login as root into the server
#cd /root
#wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noa...
#rpm -ivh epel-release-6-5.noarch.rpm</code>

Next We need to install NTFS-3G.

What is NTFS-3g ?

NTFS-3G is a opensource GPL Licensed, POSIX, read and write NTFS driver for linux.
It Provides a very safe handling of the windows XP, 2003 and all other windows variants NTFS file systems.

NTFS-3G also can help you create, remove, rename, moved directories, hard links, streams etc.
it's handle a special files like symbolic links, devices and FIFOs, ACL, extended attributes.


Install NTFS-3G


Still with root access
type the command below to install it

#yum install ntfs-3g
You will see an output like below

============= Quote From Linux Console ===========================
#yum install ntfs-3g
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntfs-3g.x86_64 2:2011.4.12-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================
 Package         Arch           Version                     Repository    Size
===============================================================================
Installing:
 ntfs-3g         x86_64         2:2011.4.12-3.el6           epel         247 k

Transaction Summary
===============================================================================
Install       1 Package(s)

Total download size: 247 k
Installed size: 624 k
Is this ok [y/N]:Y

================== END ==================================
Next We need to Find out the NTFS Partition Name

Find NTFS Partitions Name
We can simply type the command below :

#fdisk -l /dev/sda
#fdisk -l /dev/sdb

You will see an output like below
=========== Quote From Linux Console =============

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf0000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              14       60802   488281089    5  Extended
/dev/sda5              14       59767   479970304   83  Linux
/dev/sda6           59767       60802     8309760   82  Linux swap / Solaris
================ END ======================
From the output above you can see /dev/sda1 with filesystem HPFS/NTFS
Next, We need to mount the NTFS Partition in /mnt/ntfs

Mount Partition in /mnt/ntfs


First we need to load the fuse driver
type the following command below to load the driver
Load fuse Driver

#modprobe fuse

Create a mount point directory
#mkdir /mnt/ntfs

Mount the NTFS partition
#mount -f ntfs-3g /dev/sda1 /mnt/ntfs

After that you can access the /mnt/ntfs
You can use a linux command below to copy or access any files on the directory
#cd /mnt/ntfs
#ls -al
etc.. etc...

Done.

No comments:

Post a Comment