Linux系统挂载NTFS分区–最简单的方法

     现在使用Windows 操作系统时最常用的是NTFS的分区格式。但是,因为这个格式在Linux下默认不能直接使用,所以Linux用户不能充分利用NTFS格式的硬盘空间。

    因为Linux没有将挂载NTFS格式这项功能编译到内核里面,所以用户必须重新编译内核。但是编译过程比较复杂又很难保证一定能够挂载NTFS分区。下面介绍一种最简单有效的方法让Linux支持挂载NTFS分区(以CentOS为例)


一.下载所需源码

fuse最新版本官网下载地址:http://sourceforge.net/projects/fuse/files/fuse-2.X/2.8.3/fuse-2.8.3.tar.gz/download

ntfs-3g最新版本官网下载地址:http://tuxera.com/opensource/ntfs-3g-2010.3.6.tgz


二.安装源码

建议安装前阅读INSTALL、REDEME文档里面有详细的安装方法和参数说明。

1.安装fuse

[root@localhost ~]#tar –zxvf fuse-2.8.3.tar.gz

[root@localhost ~]#cd fuse-2.8.3

[root@localhost ~]#./configure

[root@localhost ~]#make && make install

[root@localhost ~]#modprobe fuse

2.安装ntfs-3g

[root@localhost ~]#tar –zxvf ntfs-3g-2010.3.6.tgz

[root@localhost ~]#cd ntfs-3g-2010.3.6

[root@localhost ~]#./configure

[root@localhost ~]#make && make install 


三.挂载NTFS分区

查看NTFS分区位置

[root@localhost ~]#fdisk –l

p_w_picpath

挂载NTFS分区

[root@localhost ~]#mount –t ntfs-3g /dev/sdb1 /mnt/windows

现在已经能完美实现对NTFS分区进行读写的操作了,是不是很简单,前后不到10分钟的时间。

四.最有可能出现的错误

当在安装fuse时执行”modprobe fuse”命令式出现报错信息”FATAL: Module fuse not found.”本人认为是安装Linux系统时没有安装上相应的包所致。然后用google找到了解决方法。

[root@mail ~]# modprobe fuse FATAL: Module fuse not found.

I have searched around but I cannot find an answer to get encfs working. Help!

A:

If you have not done so, refer to the CentOS wiki: http://wiki.centos.org/Repositories and set up the rpmforge repository. Then, yum install –enablerepo=rpmforge fuse dkms dkms-fuse Make sure you have the kernel-devel package that matches your running kernel. If you don't have it, run: yum install kernel-devel before running the first yum command.

Success!

——————http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14292

============================================

How to fix "FATAL: Module fuse not found." on CentOS 4

> cat /etc/*-release

will tell you your CentOS's version.

First, get rmpforge from HERE according to your OS version.
then,

> rpm -ivh rpmforge-release-$version.$arch.rpm

CentOS 4

> yum install  kernel-smp-devel dkms dkms-fuse

CentOS 5

> yum install  dkms dkms-fuse

Then,

> dkms remove -m fuse -v 2.7.4-1.nodist.rf --all
> dkms add -m fuse -v 2.7.4-1.nodist.rf
> dkms build -m fuse -v 2.7.4-1.nodist.rf --kernelsourcedir=/usr/src/kernel/yourkenerlsource
> dkms install -m fuse -v 2.7.4-1.nodist.rf
> modprobe fuse

No error inputs will received.

PS: Above method does not work on my CentOS 4.4 servers, and I figured out another way:

> uname -a

To check your kernel's version. For me, it's 2.6.17.14.
Go to get the kernel's source.

> wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.17.14.tar.bz2
> tar zxjf linux-2.6.17.14.tar.bz2
> cd linux-2.6.17.14
> cp /boot/config-2.6.17.14.WBXsmp .config
> make oldconfig
> make prepare
> make modules_prepare

Get fuse's source code down.(I use FUSE for gluster, an open source distributted file system, it pathes fuse for its own optimization)

> wget http://ftp.gluster.com/pub/gluster/glusterfs/fuse/fuse-2.7.4glfs11.tar.gz
> tar zxvf fuse-2.7.4glfs11
> cd fuse-2.7.4glfs11
> ./configure --with-kernelsource=/usr/src/linux-2.6.17.14
> ./configure && make && make install

It should be ok. In my case, I still got "Module fuse not found." error once I reboot my system.
I fixed that this way, may be can work for you too:

> echo "mknod /dev/fuse -m 0666 c 10 229">>/etc/rc.local