How to enable Linux to support NTFS partitions

Source: Internet
Author: User
Tags hex code

We all know that Linux does not support the NTFS partition type by default, but if your computer is a dual system, it is a pleasure to make Linux support the NTFS partition! In this way, you can easily ask the information on the Windows disk, or upload the information to the Linux disk in Windows. In fact, Linux supports NTFS partition types by installing corresponding software. Next I will introduce how to implement it.

1, download ntfs-3g_ntfsprogs software source package online, and unzip to the desktop

[Root @ localhost Desktop] # ls

Ntfs-3g_ntfsprogs-2013.1.13.tgz

[Root @ localhost Desktop] # tar-zxvfntfs-3g_ntfsprogs-2013.1.13.tgz-C ./

2. Prepare the installation environment of the source code package.

[Root @ localhost ~] # Yum install gc *-y ...... Configure the gcc and g ++ development environments

Failed to set locale, defaulting to C

Loaded plugins: product-id, security, sub‑manager

This system is not registered to Red Hat SubscriptionManagement. You can use sub‑manager to register.

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package gcc. x86_64. 1.2-54. el5 set to beupdated

...............................................

..............................

....

3. Enter the extract directory and execute the configuration file.

[Root @ localhost ntfs-3g_ntfsprogs-2013.1.13] #./configure

Checking build system type... x86_64-unknown-linux-gnu

Checking host system type... x86_64-unknown-linux-gnu

Checking target system type... x86_64-unknown-linux-gnu

Checking for a BSD-compatible install.../usr/bin/install-c

.............................................

.......................

.......

4. Compile and install

[Root @ localhost ntfs-3g_ntfsprogs-2013.1.13] # make & make install

...................................

...............

5. Add a partition to sda and specify the file type.

[Root @ localhost ~] # Fdisk/dev/sda

The number of cylinders for this disk is set to10443.

There is nothing wrong with that, but this is largerthan 1024,

And coshould in certain setups cause problems:

1) software that runs at boot time (e.g., oldversions of LILO)

2) booting and partitioning software from other OSs

(E.g., DOSFDISK, OS/2 FDISK)

Command (m for help): n ...... Add a partition

First cylinder (4103-10443, default 4103 ):

Using default value 4103

Last cylinder or + size or + sizeM or + sizeK (4103-10443, default 10443): + 10G ...... Size: 10 GB

Command (m for help): t ...... Partition type

Partition number (1-6): 6 ...... Select the second logical Partition

Hex code (type L to list codes): 7 ...... Type 7 is NTFS

Changed system type of partition 6 to 7 (HPFS/NTFS)

Command (m for help): p ...... View results

 

Disk/dev/sda: 85.8 GB, 85899345920 bytes

255 heads, 63 sectors/track, 10443 cylinders

Units = cylinders of 16065*512 = 8225280 bytes

DeviceBoot Start End Blocks Id System

/Dev/sda1*1 13 104391 83 Linux

/Dev/sda2 14 2624 20972857 + 83 Linux

/Dev/sda3 2625 2885 2096482 + 82 Linux swap/Solaris

/Dev/sda4 2886 10443 60709635 5 Extended

/Dev/sda5 2886 4102 9775521 83 Linux

/Dev/sda6 4103 5319 9775521 7 HPFS/NTFS

Command (m for help): w ...... Write

 

6. format the new partition.

[Root @ localhost ~] # Partprobe ...... Retrieve partition information again

Warning: Unable to open/dev/sr0 read-write (Read-only file system)./dev/sr0 hasbeen opened read-only.

[Root @ localhost ~] # Mkfs. ntfs/dev/sda6 ...... Format a disk with ntfs

Failed to set locale, using default 'C '.

Cluster size has been automatically set to 4096bytes.

Initializing device with zeroes: 100%-Done.

Creating NTFS volume structures.

Mkntfs completed successfully. Have a nice day.

7. Create/NTFS/folder

[Root @ localhost ~] # Mkdir-p/NTFS/

8. Mount sda6 to the new NTFS.

[Root @ localhost ~] # Mount-tntfs-3g/dev/sda6/NTFS /...... Mount the specified file system as a ntfs-3g or it will not be mounted

9. View mounting information

[Root @ localhost ~] # Df-lT

Filesystem Type 1K-blocks Used Available Use % Mounted on

/Dev/sda2 ext3 20315844 2713692 16553512 15%/

/Dev/sda1 ext3 101086 12200 83667 13%/boot

/Dev/sda6 fuseblk 9775520 49624 9725896 1%/NTFS

Tmpfs 511920 0 511920 0%/dev/shm

10. The above mounting will become invalid after restart, so you need to configure sda6 to automatically mount after boot.

[Root @ localhost ~] # Vim/etc/fstab

 

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-sda3 swap defaults 0 0

/Dev/sda6/NTFS ntfs-3g defaults 0 0

The ntfs file type in fstab is specified as a ntfs-3g, otherwise automatic mounting will not be available

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.