Supports mounting exFAT and NTFS file systems in CentOS

Source: Internet
Author: User
Tags rpmbuild

Supports mounting exFAT and NTFS file systems in CentOS
1 problem

1.1 Problem Description

Installed a broken machine in the lab.CentOS 7Today, I want to copy something from a mobile hard drive to my machine,mountWhen mounting the file system, the system prompts an unknown file system.CentOSThese are not supported by default.WindowsFile System.UbuntuFriendly, the packages are installed, and the mobile hard disk is inserted for automatic mounting,CentOSLet's go over it.

1.2 Windows File System

WindowsCommon formats of subpartitions are:FAT,FAT32,NTFSAndexFAT

In the early days, the most common format isFATAndFAT32But at present, because a single file is getting bigger and bigger4GFile,FATAndFAT32The format is not supported, so the current hard disk format will be convertedNTFSOrexFATFormat,

1.3 features and differences of NTFS and exFAT partition formats

NTFS(New Technology File System)YesWindowsNTAnd Advanced Server network operating system environment file system, designed to provideFAT32Higher reliability and EliminationFAT32File System capacity limit. It not only supports larger partitions and files, but also saves hard disk space, it also providesFAT32The 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?NTFSWhat about partitioning? AlthoughNTFSThere 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 orSSDThis type of storage media brings additional burden. At the same time,NTFSThe 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.

exFATThe 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 formattedexFATTraditional hard disks cannot be formattedexFATTherefore, it is a file system dedicated to flash memory.

2. Support mounting the NTFS file system

exfatThe format of the file system isfuse(Filesystem in userspace).

2.1 install fuse-exfat

exfatSupportedfuseThe 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 addedrpmfusionSource, add download rpmfusion-free-release-7.noarch.rpm first

  • You can try to add the source before installing

  • Downloadfuse-exfatPackages (required) andexfat-utilsPackage Installation

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.RPMSource code Construction RPMInstall

Although I do not want to talk about this method, in general, the release version for eachrpmOrdebThe package provides its source code package to help developers build their own installation packages from the source code,UbuntuAnd other releasesapt-get sourceDownload the source code and useapt-get build-depBuild its environment,RedhatAnd other releases.RPMBUILDAnd the package becomessrc.rpm

Downloadable'Src. rpm source code package and self-useSconsAndGccCompile, you can alsoRpmfusionDownload source codeRPMAnd then buildRPM '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/

  • Compile and install:

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/RPMSFind the generatedRPM(According to the system architecturex86_64Ori386Directory 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

RPMThe NTFS file system supportsntfs-3gSoftware Package to complete

3.1 install ntfs-3g Module 3.1.1 install yum:

Are you sure you have installedrpmforgeSource 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-3gNo more standard sources. If you are prompted that the software package is not found, addEPELFor 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 installELRepoOfmod-fuse

3.1.2 use ntfs-3g official source code compilation and Installation

Currently2017-04-19,ntfs-3gThe latest version2017-03-23

Official Website: http://www.tuxera.com/community/open-source-ntfs-3g/

ntfs-3gDownload 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

yumApplicable onlyRedhatSystem, compilation and installation applies to allLinuxRelease

3.2 mount the NTFS file system

Assume that yourNTFSThe file system is/dev/sdb1And 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 NTFS partitions:
mount -t ntfs-3g /dev/sdb1 /mnt/windows/cORmount /dev/sdb1 /mnt/windows/c

Note:sdb1YesSATAOrSCSIThe first partition of the hard disk.IDEHard Disk, yeshda1, Usefdisk -lView.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.