CentOS6.3 mount Windows NTFS partition.

Source: Internet
Author: User

First, you need to load the local physical disk to the virtual machine, click Virtual Machine-> Settings, add disk.

By default, CentOS6.3 does not support reading and writing Widows NTFS hard disk partitions. to mount an NTFS disk to CentOS 6.3
Third-party plug-in ntfs-3g needs to be installed, here we use compile to install the plug-in.
1. Install the compiler. Otherwise, compilation fails.
Yum install gcc
Follow the prompts to complete Y Installation

2. Install ntfs-3gcd

/Home # Go To The/home directory and download the software to this directory.
Wget http://tuxera.com/opensource/ntfs-3g_ntfsprogs-2011.4.12.tgz # download
Tar zxvf ntfs-3g_ntfsprogs-2011.4.12.tgz # Extract
Cd ntfs-3g_ntfsprogs-2011.4.12 # Go To The Directory
./Configure # compile
Make # Installation
Make install # install
Cd .. # Return to the upper-level directory
Rm-r-f ntfs-3g_ntfsprogs * # Delete installation package
3. View and use
Fdisk-l # display Widows NTFS hard disk partition information
######################################## #############################

Disk/dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders
Units = cylinders of 15120*512 = 7741440 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x18fd18ff

Device Boot Start End Blocks Id System
/Dev/sda1*1 5093 38503048 + 7 HPFS/NTFS
/Dev/sda2 5094 20673 117784800 f W95 Ext 'd (LBA)
/Dev/sda5 5094 9357 32234496 7 HPFS/NTFS
/Dev/sda6 9358 13621 32235520 7 HPFS/NTFS
/Dev/sda7 13622 17885 32233472 7 HPFS/NTFS
/Dev/sda8 17885 17899 102400 83 Linux
/Dev/sda9 17899 18731 6291456 83 Linux
/Dev/sda10 18731 19009 2097152 82 Linux swap/Solaris
/Dev/sda11 19009 19286 2097152 83 Linux
/Dev/sda12 19287 20673 10484736 83 Linux


######################################## ###########################
The above information shows my Widows NTFS hard disk partition information, a total of 160 GB, with four NTFS partitions

4. Mount the partition.
Mount the/dev/sda1 partition to/mnt/winC
Mount the/dev/sda5 partition to/mnt/winD
Mount the/dev/sda6 partition to/mnt/winE
Mount the/dev/sda7 partition to/mnt/winF

Go to the/mnt directory and create four winC winD winE winF Mount directories.
Cd/mnt
Mkdir winC winD winE winF

Mount-t ntfs-3g/dev/sda1/mnt/winC # mount
Mount-t ntfs-3g/dev/sda5/mnt/winD
Mount-t ntfs-3g/dev/sda6/mnt/winE
Mount-t ntfs-3g/dev/sda7/mnt/winF

After the partition is mounted, you can view the corresponding folder under the/mnt directory, that is, the partition of your mobile hard disk.

To uninstall the SDK, run the following command:

Umount/dev/sda1 # uninstall
Umount/dev/sda5
Umount/dev/sda6
Umount/dev/sda7

5. Edit the/etc/fstab file if you want to enable the system to automatically mount the mobile hard disk.
Cp/etc/fstab/etc/fstabbak # back up before changing
Vi/etc/fstab # Edit

Use the insert command to add the following information at the end to mount the disk in read/write mode.

/Dev/sda1/mnt/winC ntfs-3g defaults 0 0
/Dev/sda5/mnt/winD ntfs-3g defaults 0 0
/Dev/sda6/mnt/winE ntfs-3g defaults 0 0
/Dev/sda7/mnt/winF ntfs-3g defaults 0 0

Run the ESC command to exit.
: Wq! Save and exit
Now, you only need to restart the machine and the mobile hard disk will be automatically mounted.

Unmount:
The following prompt appears when umount:
# Umount/dev/sda1
Umount:/mnt/upan: device is busy.
(In some cases useful info about processes that use
The device is found by lsof (8) or fuser (1 ))

Solution:
Root@rekfan.com/] # lsof-w/mnt/upan
Command pid user fd type device size/OFF NODE NAME
Bash 31761 root cwd DIR 8192 2316326 120526/mnt/upan/rekfan.com _
Root@rekfan.com/] #

Using lsof-w/mnt/upan, we can see that there is a command window in the/mnt/upan/rekfan.com _ 120526 directory, close this window, or exit this mount directory, you can use umount to safely exit the mounted device!

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.