CentOS 5.3 挂载 读写 ntfs硬盘

http://blog.chinaunix.net/u3/101502/showart_2033408.html

先安装第三方源


CentOS 5.x Installing RPMforge

原文地址:

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge


1.安装 yum-priorities


yum install yum-priorities


2.priorities的配置文件是/etc/yum/pluginconf.d/priorities.conf,确认其是否存在。

其内容为:

[main]
enabled=1  # 0禁用 1启用


3.编辑 /etc/yum.repos.d/目录下的*.repo 文件来设置优先级。


参数为:


priority=N  # N的值为1-99


推荐的设置为:

[base], [addons], [updates], [extras] ... priority=1
[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N  (where N is > 10 and based on your preference)

4.安装RPMforge

下载rpmforge-release

#i386

wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

#x86_64

wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm


导入GPG key


rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt


确认rpmforge-release的完整性

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

会输出:

rpmforge-release-0.3.6-1.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK



安装rpmforge


rpm -ivh rpmforge-release-0.3.6-1.el5.rf.*.rpm


测试rpmforge


yum check-update

会输出:

Loading "priorities" plugin
...
76 packages excluded due to repository priority protections


修改/etc/yum.repos.d/rpmforge.repo

添加

priority=3


之后就可以使用rpmforge安装各种应用程序了

例如:

yum install mplayer





CentOS Linux系统默认安装支持只读挂载ntfs硬盘分区,如果需要写ntfs分区需要安装NTFS-3G软件,CentOS安装ntfs-3G需要安装以下软件:



kernel-PAE-2.6.18-128.1.10.el5.centos.plus

kernel-xen-devel-2.6.18-128.1.10.el5

kernel-PAE-devel-2.6.18-128.1.10.el5.centos.plus 

其中2.6.*是CentOS的版本号,


​http://www.ntfs-3g.org/index.html#download​​  NTFS-3G软件




一、采用yum方式进行安装:

     yum install fuse fuse-ntfs-3g dkms dkms-fuse (安装fuse ntfs-3g软件)


     yum install kernel-xen-devel (安装kernel-xen包)


yum install kernel-PAE-devel (安装kernel-PAE包)




二、命令方式挂载读写ntfs分区,(假设/dev/hda6是硬盘 /mnt/win是目录)

只读方式挂载: mount -t ntfs-3g /dev/hda6 -o ro /mnt/win

读写方式挂载: mount -t ntfs-3g /dev/hda6 -o rw /mnt/win




三、系统自动挂载读写ntfs分区,(假设/dev/hda6是硬盘 /mnt/win是目录)

修改 /etc/fstab 

只读方式挂载:



/dev/hda6       /mnt/win   ntfs-3g  ro,umask=0222,defaults 0 0


读写方式挂载:

/dev/hda6       /mnt/win  ntfs-3g  rw,umask=0000,defaults 0 0