2

CentOS 7 挂载NTFS磁盘

 2 years ago
source link: https://blog.51cto.com/u_2510220/5111730
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

CentOS 7 挂载NTFS磁盘

原创

yzz_128 2022-03-17 10:24:56 博主文章分类:Linux ©著作权

文章标签 3g centos 文件系统 文章分类 其他 服务器 阅读数761

本文记录在CentOS7服务器上挂载NTFS格式磁盘所遇到的问题及解决方法

CentOS7系统中默认的文件系统格式为XFS,无法直接挂载NTFS格式的磁盘,提示如下:

[root@localhost ~]# fdisk -l /dev/sdb
……省略部分输出……
10   1825409024   1953521663   61.1G  Microsoft basic Basic data partition
[root@localhost ~]# mount -t ntfs /dev/sdb10 /mnt
mount: 未知的文件系统类型“ntfs”

CentOS无法直接识别NTFS文件系统,需要手动下载安装NTFS文件系统的驱动,通过使用yum来下载并安装ntfs-3g组件。

1、通过yum安装ntfs-3g组件。

[root@localhost ~]# yum install -y ntfs-3g
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
没有可用软件包 ntfs-3g。
错误:无须任何处理

安装报错是因为这些软件包没有正式获得任何的CentOS的支持,CentOS是RedHat企业版编译过来的,去掉了所有关于版权问题的东西,EPEL(Extra Packages for Enterprise Linux )即企业版Linux的扩展包,提供了很多可共Centos使用的组件。

2、通过如下命令添加aliyun的epel源。

[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
--2022-03-17 09:58:15--  http://mirrors.aliyun.com/repo/epel-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 221.204.195.21, 221.204.195.27, 221.204.195.22, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|221.204.195.21|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:664 [application/octet-stream]
正在保存至: “/etc/yum.repos.d/epel.repo”

100%[==========================================================>] 664         --.-K/s 用时 0.002s  

2022-03-17 09:58:15 (341 KB/s) - 已保存 “/etc/yum.repos.d/epel.repo” [664/664])

[root@localhost ~]# ll /etc/yum.repos.d/
总用量 40
……省略部分输出……
-rw-r--r--. 1 root root  664 12月 26 2020 epel.repo
[root@localhost ~]# 

3、安装ntfs-3g组件

[root@localhost ~]# yum install -y ntfs-3g
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
……省略部分输出……
已安装:
  ntfs-3g.x86_64 2:2021.8.22-2.el7                                                                  
作为依赖被安装:
  ntfs-3g-libs.x86_64 2:2021.8.22-2.el7                                                             
完毕!

4、挂载NTFS磁盘,成功

[root@localhost ~]# mount -t ntfs /dev/sdb10 /mnt
[root@localhost ~]# ll /mnt
总用量 0
drwxrwxrwx. 1 root root 0 3月  16 11:43 $RECYCLE.BIN
drwxrwxrwx. 1 root root 0 3月  16 11:41 System Volume Information
drwxrwxrwx. 1 root root 0 3月  16 11:34 WindowsImageBackup
[root@localhost ~]# 

通过安装epel-release组件,代替下载repo源
CentOS 7 挂载NTFS磁盘_centos
CentOS 7 挂载NTFS磁盘_文件系统_02

注意:
(1)、rpm安装完后,rpm -ql epel*,确提示未安装,此时要导入rpm的签名信息

#rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7(root身份执行)

(2)、对ntfs格式的磁盘分区应使用-t ntfs 参数,对fat32格式的磁盘分区应使用-t vfat参数。若汉字文件名显示为乱码或不显示,可以使用下面的命令格式。
CentOS 7 挂载NTFS磁盘_3g_03

  • 1收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK