An error occurs when an ntfs U disk or mobile hard disk is mounted to centos.

Source: Internet
Author: User

An error occurs when an ntfs U disk or mobile hard disk is mounted to centos.

This article is based on fine102's blog on 51CTO.
Centos Mount ntfs format or mobile hard disk when an error occurs, this time you need to install ntfs-3g to solve.

NTFS-3G is designed to provide trusted, functional, high-performance solutions for hardware platforms and operating systems that require reliable interconnectivity with NTFS.
For more information, see NTFS-3G home: http://www.ntfs-3g.org
2. Install NTFS-3G
2.1 System Environment
Redhat rh5 (kernel 2.6.18-8. el5)
2.2 software and support libraries
NTFS-3Ghttp: // www.ntfs-3g.org
FUSEhttp: // fuse.sourceforge.net
2.3 software download and Installation
2.3.1 install FUSE
Download the source code package:
Wgethttp: // nchc.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.1.tar.gz
Decompress the source package:
Tar zxvf fuse-2.7.1.tar.gz
Configure the compiling environment:
Cd fuse-2.7.1
./Configure
Compile:
Make
Installation:
Make install
2.3.2 install NTFS-3G
Download the source code package:
Wgethttp: // www.ntfs-3g.org/ntfs-3g-1.1104.tgz
Decompress the source package:
Tar zxvf ntfs-3g-1.1104.tgz
Configure the compiling environment:
./Configure
Compile:
Make
Installation:
Make install
3. Use NTFS-3G
After the installation is correct, we need to load the NTFS partition through the ntfs-3g.
3.1 obtain the NTFS partition device name
Run the following command:
Fdisk-l | grep NTFS
The result is as follows:
/Dev/sdb1 1 10443 83883366 7 HPFS/NTFS
The first field/dev/sdb1 is the name of the required partition device.
3.2 Create a mount point
Mkdir/mnt/ntfs-p1 create a directory
If necessary, grant specific Access Permissions
Chmod 755/mnt/ntfs-p1
3.3 temporarily Mount NTFS partitions
You can use the following command to temporarily load an NTFS partition to the mount point in read/write mode.
Mount-t ntfs-3g
Where:
-- Name of the device in the partition where NTFS is located, for example,/dev/sdb1 in 3.1
-- Mount point, such as/mnt/ntfs-p1 in 3.2
For example:
Mount-t ntfs-3g/dev/sdb1/mnt/ntfs-p1 or: ntfs-3g/dev/sdb1/mnt/ntfs-p1
For more options and examples, see the mount command and ntfs-3g documentation with the following command
Man mount
Man ntfs-3g
3.4 when the system starts, NTFS partitions are loaded.
Edit/etc/fstab
Vi/etc/fstab
Add lines in the following format at the end of the file
Ntfs-3g ults 0 0
Where:
-- Name of the device in the partition where NTFS is located, for example,/dev/sdb1 in 3.1
-- Mount point, such as/mnt/ntfs-p1 in 3.2
For example:
/Dev/sdb1/mnt/ntfs-p1 ntfs-3g defaults 0 0
After saving the file, restart the system or simply execute the following command to load the NTFS partition to the specified mount point.
Mount-

The above section describes how to mount ntfs in centos on a dual system to read windows files. The following section describes how to mount a USB flash drive.
Install a ntfs-3g, similar to mounting a hard disk.

Create the path to be mounted and mount the hard disk to the temp folder on the desktop.
Mkdir/home/temp
View the location of the hard disk (the path is displayed, and my path is under/dev/sdb)
Fdisk-l
Mount
Mount-t ntfs-3g/dev/sdb/home/temp/
Unmount
Umount/home/temp/

Note:
1. Sometimes, the attach of a USB flash drive fails. The common cause is that the Mount fails to be unmounted after the last mount, resulting in a conflict with the previous mount point.
Solution: (1) run the df-k Command to check the disk that has been mounted. If the disk has been mounted, run the command to unmount the disk and re-mount the disk. (2) Attach the disk as prompted, that is, add force to the backend.
2. After attaching a hard disk or USB flash drive, you may not be able to create Chinese files on a mobile hard disk or USB flash drive, or copy Chinese files.
Error message: "…… : Invalid or incomplete multibyte or wide byte"
Solution:
View the system code: add the system code to the mount.
The details are as follows:

# Echo $ LANG // view the Encoding

Shown as follows:

zh_CN.UTF-8
  • 1

Add the encoding after mount:

# mount -t ntfs-3g /dev/sdb /home/temp/ -o iocharset=utf8
  • 1

That's all.

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.