Mount NTFS to centos

Source: Internet
Author: User

PHP Technology Exchange Group 170855791

Centos want to access NTFS partition, now the common method is to use ntfs-3g or kernel module.

1. Install the ntfs-3g Module

1. How to install Yum:

Make sure that you have installed the source of the rpmforge 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

Note: If you are using centos 5.3 or an earlier version, you need to install kmod-fuse from elrepo.

2. Use ntfs-3g official source code compilation and installation method:

Ntfs-3g download page: http://www.tuxera.com/community/ntfs-3g-download/

Installation steps:

Wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz

Tar zxvf ntfs-3g_ntfsprogs-2011.4.12.tgz

Cdntfs-3g_ntfsprogs-2011.4.12

./Configure

Make

Make install

Either of the above two methods, yum is only applicable to the RedHat system, and compilation and installation is applicable to all Linux distributions.

Ii. Mount the NTFS file system

Assume that your NTFS file system is/dev/sda1 and you will attach it to/mnt/Windows/C. perform the following steps.

1. Create a mount point. (It is generally recommended to store it in the MNT directory)

Mkdir/mnt/Windows/C

2. Mount the NTFS partition:

Mount-T ntfs-3g/dev/sda1/mnt/Windows/C

Note: sda1 refers to the first partition of the SATA or SCSI hard disk. If it is an old-fashioned IDE hard disk, it will be hda1. For details, see fdisk-L. For example, a single server:

[Root @ centos ~] # Fdisk-l

Disk/dev/SDA: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes

Device boot start end blocks ID system
/Dev/sda1*1 2550 20482843 + 7 HPFs/NTFS
/Dev/sda2 2551 20022 140343840 F w95 ext 'd (LBA)
/Dev/sda5 5101 8924 30716248 + 7 HPFs/NTFS
/Dev/sda6 8925 12748 30716248 + 7 HPFs/NTFS
/Dev/sda7 12749 16572 30716248 + 7 HPFs/NTFS
/Dev/sda8 16573 20022 27712093 + 7 HPFs/NTFS
/Dev/sda9 2551 2584 273042 83 Linux
/Dev/sda10 2585 4928 18828148 + 83 Linux
/Dev/sda11 4929 5016 706828 + 82 Linux swap/Solaris

Partition Table entries are not in disk order

3. If you want to automatically mount the NTFS partition when the system is started, edit the vim/etc/fstab file and add the following content:

Read-Only mount:/dev/sda1/mnt/Windows/C ntfs-3g Ro, umask = 0222, defaults 0 0

Read/write mount:/dev/sda1/mnt/Windows/C ntfs-3g RW, umask = 0000, defaults 0 0
Or:/dev/sda1/mnt/Windows/C ntfs-3g defaults 0 0

For example, the/etc/fstab file is as follows:

Label = // ext3 defaults 1 1
Label =/boot ext3 defaults 1 2
Tmpfs/dev/SHM tmpfs defaults 0 0
Devpts/dev/PTS devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0
Label = SWAP-sda11 swap defaults 0 0

/Dev/sda1/mnt/Windows/C ntfs-3g Ro, umask = 0222, defaults 0 0
/Dev/sda5/mnt/Windows/e ntfs-3g default 0
/Dev/sda6/mnt/Windows/F ntfs-3g defaults 0 0
/Dev/sda7/mnt/Windows/g ntfs-3g defaults 0 0
/Dev/sda8/mnt/Windows/h ntfs-3g defaults 0 0

Other notes:

From centos 5.4 (2.6.18-164 or newer kernel), the fuse module is included in the kernel. Therefore, dkms and dkms-fuse are no longer required. If you have installed dkms-fuse before, run the yum remove dkms-fuse command to uninstall it. Note that users of centos4.x need these two components.

Users who use centosplus Kernel

Starting from the CentOS-5.3, The centoplus kernel does not enable the NTFS module. This is because NTFS within 5.3 cannot run. See https://bugzilla.redhat.com/show_bug.cgi for details? Id = 481495. If you want to use the NTFS module from the centos kernel, you can install kmod-NTFS from elrepo. But this module does not have a good ntfs-3g and only provides extremely limited write functionality.

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.