Centos 默认不支持 NTFS 格式的U盘,如果要加载只能借助第三方软件 ntfs-3g 。
实现方式:1、通过网络yum源方式,在线安装(忽略);
2、 通过官网下载,然后手动编译安装。
我推荐选择第二种方式,对于初学者来说,通过官网下载方式更简单更直接,可以省去不会写配置文件的烦恼。
具体步骤: 第一步、进入官网下载1、官网地址:
https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2021.8.22.tgz
2、百度网盘:
第二步、上传到虚拟机链接:https://pan.baidu.com/s/152QykTkXNa4NJrqYStBHKw
提取码:g5xh
通过远程传输工具,将下载的安装包上传传到虚拟机/usr/local/src/目录;
第三步、解压 ntfs-3g_ntfsprogs-2021.8.22.tgz进入目录/usr/local/src/,解压ntfs-3g_ntfsprogs-2021.8.22.tgz
[root@localhost src]# cd /usr/local/src [root@localhost src]# ls ntfs-3g_ntfsprogs-2021.8.22.tgz [root@localhost src]# tar -zxvf ntfs-3g_ntfsprogs-2021.8.22.tgz第四步、解压完毕,ls查看解压结果
[root@localhost src]# ls ntfs-3g_ntfsprogs-2021.8.22 ntfs-3g_ntfsprogs-2021.8.22.tgz第五步、进入目录ntfs-3g_ntfsprogs-2021.8.22
[root@localhost src]# cd ntfs-3g_ntfsprogs-2021.8.22 [root@localhost ntfs-3g_ntfsprogs-2021.8.22]#第六步、编译准备./configure
[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports the include directive... yes (GNU style) checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
当前编译出错,提示如下
configure: error: no acceptable C compiler found in $PATH
解决办法:安装gcc编译器即可解决
安装编译器直通车:
CentOS6 安装gcc编译器,解决【configure: error: no acceptable C compiler found in $PATH】问题_走向运维的老男孩的博客-CSDN博客
第七步、重新编译准备 ./configure[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# ./configure checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk ... checking for dlopen in -lc... no checking for dlopen in -ldl... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile ... config.status: creating src/Makefile config.status: creating src/ntfs-3g.8 config.status: creating src/ntfs-3g.probe.8 config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands /bin/rm: cannot remove `libtoolT': No such file or directory You can type now 'make' to build ntfs-3g.
说明:编译准备完成后,提示“You can type now 'make' to build ntfs-3g”,接下来进行编译。
第八步、编译make[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# make make all-recursive make[1]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' Making all in include make[2]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/include' Making all in ntfs-3g ... make[2]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/src' make[2]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' make[2]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' make[1]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22'第九步、编译安装make installl
[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# make install Making install in include make[1]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/include' Making install in ntfs-3g make[2]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/include/ntfs-3g' make[3]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/include/ntfs-3g' make[3]: Nothing to be done for `install-exec-am'. ... make[2]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/src' make[1]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22/src' make[1]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' make[2]: Entering directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' make[2]: Nothing to be done for `install-exec-am'. /bin/mkdir -p '/usr/local/share/doc/ntfs-3g' /usr/bin/install -c -m 644 README '/usr/local/share/doc/ntfs-3g' make[2]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22' make[1]: Leaving directory `/usr/local/src/ntfs-3g_ntfsprogs-2021.8.22'第十步、验证
[root@localhost ntfs-3g_ntfsprogs-2021.8.22]# ntfs-3g --version ntfs-3g 2021.8.22 integrated FUSE 27
验证成功!
小结:只要解决了编译器问题,其他问题都是小问题。另外注意一下编译安装时make和install之间要有空格隔开,否则执行不了命令。



