You are on page 1of 9

CentOS6.

5 系统(本地)挂载 NTFS 分区的移动硬盘

及远程挂载 windows ntfs 共享目录

一. Centos6.5 本地挂载 ntfs 分区的移动硬盘: 


 对于一个 IT 工作者,避免不了使用 Linux 系统,为了锻炼自己对 CentOS 的熟练操作,您可以把自己的笔记本装了

CentOS,强制自己使用,使自己在平时的工作中逐渐掌握 Linux 的学习。如果您使用的系统是 CentOS6.5 64 位版本,但是

插入移动硬盘后却没有办法识别。那么通过下面介绍的三步就可以使 CentOS 识别 NTFS 分区的移动硬盘。

  第一步:下载 rpmforge,下载对应的版本,就是对应 CentOS 版本,还有 32 位与 64 位也要对应上。rpmforge 拥有

4000 多种 CentOS 的软件包,被 CentOS 社区认为是最安全也是最稳定的一个软件仓库。

    下载地址“http://pkgs.repoforge.org/rpmforge-release/”

   您可选择下载版本“rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm”

  第二步:安装 rpmforge,使用如下命令:

    # rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

  第三步:安装完成后,yum 安装 ntfs-3g

    # yum install fuse-ntfs-3g

  通过上面三步就可以使 CentOS 系统识别 NTFS 分区的移动硬盘了。

下面就实例讲述具体的操作过程:

【准备工作,因为事先我这台机器系统没有安装 wget,为了方便下载,在此先安装 wget】

安装 wget

[root@C3 ~]# yum -y install wget

Loaded plugins: fastestmirror, refresh-packagekit

Loading mirror speeds from cached hostfile

* base: mirrors.nwsuaf.edu.cn

* extras: mirrors.nwsuaf.edu.cn

* updates: mirrors.nwsuaf.edu.cn

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package wget.x86_64 0:1.12-1.11.el6_5 will be installed

--> Finished Dependency Resolution

……(略)

Install 1 Package(s)
Total download size: 483 k
Installed size: 1.8 M

Downloading Packages:

wget-1.12-1.11.el6_5.x86_64.rpm

| 483 kB 00:00

Running rpm_check_debug

Running Transaction Test


Transaction Test Succeeded

Running Transaction

Installing : wget-1.12-1.11.el6_5.x86_64

1/1

Verifying : wget-1.12-1.11.el6_5.x86_64

1/1

Installed:

wget.x86_64 0:1.12-1.11.el6_5

Complete!

(一)下载 rpmforge,下载对应的版本

[root@C3 ~]# wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz

--2014-10-09 11:57:20-- http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz

Resolving tuxera.com... 77.86.224.47

Connecting to tuxera.com|77.86.224.47|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://www.tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz [following]

--2014-10-09 11:57:23-- http://www.tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz

Resolving www.tuxera.com... 77.86.224.47

Connecting to www.tuxera.com|77.86.224.47|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

2014-10-09 11:57:25 ERROR 404: Not Found.

[root@C3~]#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-

1.el6.rf.x86_64.rpm

--2014-10-09 12:00:39-- http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-

1.el6.rf.x86_64.rpm

Resolving pkgs.repoforge.org... 78.46.17.228

Connecting to pkgs.repoforge.org|78.46.17.228|:80... connected.

HTTP request sent, awaiting response... 302 Found

Location: http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-

1.el6.rf.x86_64.rpm [following]

--2014-10-09 12:00:41-- http://rpmforge.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-

release-0.5.3-1.el6.rf.x86_64.rpm

Resolving rpmforge.sw.be... 78.46.17.228

Connecting to rpmforge.sw.be|78.46.17.228|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-

1.el6.rf.x86_64.rpm [following]

--2014-10-09 12:00:42--

http://tree.repoforge.org/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-

1.el6.rf.x86_64.rpm

Resolving tree.repoforge.org... 78.46.17.228

Connecting to tree.repoforge.org|78.46.17.228|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-
1.el6.rf.x86_64.rpm [following]

--2014-10-09 12:00:43-- http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-

release-0.5.3-1.el6.rf.x86_64.rpm

Resolving apt.sw.be... 193.1.193.67

Connecting to apt.sw.be|193.1.193.67|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 12640 (12K) [application/x-redhat-package-manager]

Saving to: 鈥渞 pmforge-release-0.5.3-1.el6.rf.x86_64.rpm 鈥?

100%

[================================================================

===================================================>] 12,640

29.9K/s in 0.4s

2014-10-09 12:00:45 (29.9 KB/s) - 鈥 渞 pmforge-release-0.5.3-1.el6.rf.x86_64.rpm 鈥 ?saved

[12640/12640]

[root@C3 ~]# ls

anaconda-ks.cfg Desktop Downloads install.log iso1 Pictures rpmforge-

release-0.5.3-1.el6.rf.x86_64.rpm Videos winiso

????CentOS6.5????windows????? 募 ?? Documents initialize.sh install.log.syslog Music Public

Templates

(二)安装 rpmforge

[root@C3 ~]# rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

warning: rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID

6b8d79e6: NOKEY

Preparing... ########################################### [100%]

1:rpmforge-release ########################################### [100%]

(三)yum 安装 ntfs-3g

[root@C3 ~]# yum install fuse-ntfs-3g

Loaded plugins: fastestmirror, refresh-packagekit

Loading mirror speeds from cached hostfile

* base: mirrors.nwsuaf.edu.cn

* extras: mirrors.nwsuaf.edu.cn

* rpmforge: mirrors.neusoft.edu.cn

* updates: mirrors.nwsuaf.edu.cn

rpmforge |

1.9 kB 00:00

rpmforge/primary_db

| 2.7 MB 00:03

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package fuse-ntfs-3g.x86_64 0:2013.1.13-2.el6.rf will be installed

--> Finished Dependency Resolution

Dependencies Resolved

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

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

Package Arch Version Repository

Size

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

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

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

Installing:

fuse-ntfs-3g x86_64 2013.1.13-2.el6.rf

rpmforge 483 k

Transaction Summary

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

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

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

Install 1 Package(s)

Total download size: 483 k

Installed size: 1.5 M

Is this ok [y/N]: y

Downloading Packages:

fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64.rpm

| 483 kB 00:01

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

Installing : fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64

1/1

Verifying : fuse-ntfs-3g-2013.1.13-2.el6.rf.x86_64

1/1

Installed:

fuse-ntfs-3g.x86_64 0:2013.1.13-2.el6.rf

Complete!

验证 centos 6.5 系统是否能够识别并挂载 NTFS 分区的移动硬盘

【下面我们故意做一次错误的操作,目的是希望系统给以一些提示帮助信息,因为我这里手头暂时没有移动硬盘可

供测试,看是否可以从系统的信息中获得验证?呵呵。。。】

[root@C3 ~]# mount -t ntfs-3g //192.168.6.181/centiso iso1

ntfs-3g: Failed to access volume '//192.168.6.181/centiso': No such file or directory

ntfs-3g 2013.1.13 integrated FUSE 27 - Third Generation NTFS Driver

Configuration type 1, XATTRS are on, POSIX ACLS are off

Copyright (C) 2005-2007 Yura Pakhuchiy

Copyright (C) 2006-2009 Szabolcs Szakacsits

Copyright (C) 2007-2012 Jean-Pierre Andre

Copyright (C) 2009 Erik Larsson


Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options: ro (read-only mount), windows_names, uid=, gid=,

umask=, fmask=, dmask=, streams_interface=.

Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows


News, support and information: http://tuxera.com

备注:上面红色加粗部分,其实就是系统提示用户“Centos6.5 本地挂载 ntfs 分区移动硬盘”的语法格式举例,例如:

Mount -t ntfs-3g /dev/sda1 /mnt/windows

(将 ntfs 分区的移动硬盘 挂载到本地”/mnt/windows”目录下)

说明至此已经可以使 CentOS 系统识别 NTFS 分区的移动硬盘了!!!

二.Centos6.5 远程挂载 windows 主机的 ntfs 共享目录:


执行命令:

Mou nt -t cifs -o username=<共享目录授权账号> ,passwd=<共享目录授权密码> <WINDOWS 主机 IP>/<共享

目录> <挂载点>

例如:

Mount -t cifs -o username=administrator , passwd=123456 //192.168.6.199/share iso

具体操作如下:

1.在远程 windows 主机上创建共享目录 ,并指定访问该共享目录的用户及其权限 (本例指定共享目录的用户

“mincl”,权限“读取/写入”. 注:该 windows 主机上事先创建了管理员账号 mincl, 密码为:123456)


2.在 centos6.5 主机上远程挂载 windows 主机共享目录”share”

3.查看挂载效果:
证明:已顺利挂载!!!

You might also like