Supports mounting exFAT and NTFS file systems in CentOS
1 problem
1.1 Problem Description
Installed a broken machine in the lab.CentOS 7
Today, I want to copy something from a mobile hard drive to my machine,mount
When mounting the file system, the system prompts an unknown file system.CentOS
These are not supported by default.Windows
File System.Ubuntu
Friendly, the packages are installed, and the mobile hard disk is inserted for automatic mounting,CentOS
Let's go over it.
1.2 Windows File System
Windows
Common formats of subpartitions are:FAT
,FAT32
,NTFS
AndexFAT
In the early days, the most common format isFAT
AndFAT32
But at present, because a single file is getting bigger and bigger4G
File,FAT
AndFAT32
The format is not supported, so the current hard disk format will be convertedNTFS
OrexFAT
Format,
1.3 features and differences of NTFS and exFAT partition formats
NTFS(New Technology File System)
YesWindowsNT
And Advanced Server network operating system environment file system, designed to provideFAT32
Higher reliability and EliminationFAT32
File System capacity limit. It not only supports larger partitions and files, but also saves hard disk space, it also providesFAT32
The file system cannot provide long file names, compressed partitions, event tracking, file indexing, high fault tolerance, data protection and recovery, and encrypted access.
But why are flash disks and various memory cards rarely used?NTFS
What about partitioning? AlthoughNTFS
There are many advantages, but it is designed for traditional mechanical hard drives. It uses a "log-type" file system, which requires frequent recording of disk detailed read/write operations, will give flash disks orSSD
This type of storage media brings additional burden. At the same time,NTFS
The frequent reading and writing of the file system also affects the performance of the flash drive, resulting in a reduction in the transmission rate.
To this end, Microsoft has developed an exFAT File System (Extended File Allocation Table FileSystem) based on the traditional FAT 32 partition, which makes up for the limitations and shortcomings of FAT32, there is no NTFS function that will affect the life of flash memory, suitable for a variety of mobile memory cards and flash disks.
exFAT
The file system has the following advantages:
Partition size and maximum size of a single file supported16EB
;
The remaining space allocation table is used, and the space utilization is higher;
The maximum number of files in the same directory is 65536;
Supports access control.
Currently, only SSDS, flash drives, and memory cards can be formattedexFAT
Traditional hard disks cannot be formattedexFAT
Therefore, it is a file system dedicated to flash memory.
2. Support mounting the NTFS file system
exfat
The format of the file system isfuse
(Filesystem in userspace
).
2.1 install fuse-exfat
exfat
Supportedfuse
The Project address is:
Https://code.google.com/p/exfat/, the current region is:1.0.1
Currently, exfat supports all functions and supports reading and writing.
2.1.1 install the yum source or rpm package
Run the following command to install the SDK directly from the source:
sudo yum install fuse-exfat
If the prompt is not found, it means you have not addedrpmfusion
Source, add download rpmfusion-free-release-7.noarch.rpm first
fuse-exfat-1.0.1-1.el7.x86_64.rpm
exfat-utils-1.0.1.el7.x86_64.rpm
Then install
sudo rpm -ivh fuse-exfat-1.0.1-1.el7.x86_64.rpmsudo rpm -ivh exfat-utils-1.0.1-1.el7.x86_64.rpm
2.1.2
SRC.RPM
Source code Construction
RPM
Install
Although I do not want to talk about this method, in general, the release version for eachrpm
Ordeb
The package provides its source code package to help developers build their own installation packages from the source code,Ubuntu
And other releasesapt-get source
Download the source code and useapt-get build-dep
Build its environment,Redhat
And other releases.RPMBUILD
And the package becomessrc.rpm
Downloadable'Src. rpm source code package and self-use
SconsAnd
GccCompile, you can also
RpmfusionDownload source code
RPMAnd then build
RPM 'to install. Here we use the RPM build method (this makes installation and uninstallation very convenient ).
: Http://download1.rpmfusion.org/free/el/updates/6/SRPMS/repoview/index.html
Download: fuse-exfat-1.0.1-1-el6.src.rpm and exfat-utils-1.0.1-1.el6.src.rpm
Http://download1.rpmfusion.org/free/el/updates/7/x86_64/f/
Check the system before compiling. If scons and gcc are not in the system, install them using yum:
sudo yum install scons gcc
This software is the fuse module, and fuse-devel package is required for compilation:
sudo yum install fuse-devel
After downloading, install the source code RPM:
rpm -ivh fuse-exfat-1.0.1-1-el6.src.rpm exfat-utils-1.0.1-1.el6.src.rpm
The rpmbuild directory appears in the main directory:
cd ~/rpmbuild/SPECSrpmbuild -ba fuse-exfat.specrpmbuild -ba exfat-utils.spec
After the build is complete, you can~/rpmbuild/RPMS
Find the generatedRPM
(According to the system architecturex86_64
Ori386
Directory withdebuginfo
):
cd ~/rpmbuild/RPMS/x86_64sudo rpm -ivh fuse-exfat-1.0.1-1.el7.x86_64.rpmsudo rpm -ivh exfat-utils-1.0.1-1.el7.x86_64.rpm
This completes the installation.
2.2 Mount exfat
Run the following command to mount the exfat USB flash drive:
sudo mount.exfat /dev/sdc1 /mntORsudo mount /dev/sdc1 /mnt
3. Support mounting the exFAT File System
RPM
The NTFS file system supportsntfs-3g
Software Package to complete
3.1 install ntfs-3g Module 3.1.1 install yum:
Are you sure you have installedrpmforge
Source of the software library.
Refer to: using third-party software libraries in RHEL/CentOS 5.5
Then install the following components
yum install fuse ntfs-3g -y
nfts-3g
No more standard sources. If you are prompted that the software package is not found, addEPEL
For more information about how to install the EPEL extension repository in CentOS7/RHEL7
Note: If you are using CentOS 5.3 or an earlier version, you need to installELRepo
Ofmod-fuse
3.1.2 use ntfs-3g official source code compilation and Installation
Currently2017-04-19
,ntfs-3g
The latest version2017-03-23
Official Website: http://www.tuxera.com/community/open-source-ntfs-3g/
ntfs-3g
Download Page: https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz
Installation steps:
wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgztar zxvf ntfs-3g_ntfsprogs-2017.3.23.tgzcdntfs-3g_ntfsprogs-2017.3.23./configuremakemake install
yum
Applicable onlyRedhat
System, compilation and installation applies to allLinux
Release
3.2 mount the NTFS file system
Assume that yourNTFS
The file system is/dev/sdb1
And you will mount it in/mnt/windows/c
, Perform the following steps.
- Create a mount point. (It is generally recommended to store it in the mnt directory)
mkdir /mnt/windows/c
mount -t ntfs-3g /dev/sdb1 /mnt/windows/cORmount /dev/sdb1 /mnt/windows/c
Note:sdb1
YesSATA
OrSCSI
The first partition of the hard disk.IDE
Hard Disk, yeshda1
, Usefdisk -l
View.