Linux enables read-write mounting of NTFS-formatted disks using Ntfs-3g__linux

Source: Internet
Author: User

On a host with dual systems, it is necessary to mount the disks under the Windows system under Linx, which can be implemented using the Mount command.


The Mount command is in the following format:

Mount [options] <-t type > [o mount Options] < devices > < mount point >



-T
option is used to specify the type of file system on the partition, and the most frequently encountered file system should be EXT2FS (gnu/linux file system) or EXT3FS (improved log performance

EXT2FS), VFAT (for all dos/windows® partitions: FAT12, OR), NTFS (NTFS-formatted partitions in Windows), and ISO9660 (CD-ROM
File system, if you do not specify any type, mount will try to read the blocks in the partition to guess the file system.

-O
option is used to specify one or more mount options that are related to the file system you want to mount, for example, in NTFS format:

Iocharset=<charset> set the encoding, if there are garbled words, you can try this option.

RW/RO Specifies whether it is writable or read-only. You can use the RO option if you mount something that you don't want to write incorrectly.

uid=<uid>,gid=<gid> specifies the UID and GID of the mounted file.

umask=<umask> Specifies the Umaks after the mount.

Mount Step:



1, start the terminal, input fdisk-l, get all the file partitions, to determine the partition required to mount the name of the device.



2, input mount-t vfat-o rw/dev/sad2//mnt, without any information prompts, it indicates that the mount is successful.



If you need to mount an NTFS-formatted disk, you need to modify the module in the source code, find the System source directory (/USR/SRC/LINUX-2.6.XX-XXX), input from the terminal
cd/usr/src/linux-2.6.xx-xxx/, after entering the source directory, enter make Menuconfig, the graphical interface appears, under the file system Dos/fat/ntfs

FileSystem option, select VFAT fs support,ntfs file system Support,ntfs write support (to change the symbol in the preceding bracket to *

, use the SPACEBAR to modify). Then exit, recompile the module at the terminal input make modules and makes Modules_install, and then use the Mount command to

Mount up.


Mount-t Ntfs-o rw/dev/sad2/mnt



But there are special cases, I now use the system is LINUX-2.6.32-GENTOO-R7, using the above command to mount an NTFS-formatted disk, you can only read data from the mounted disk

, and not write data, prompted permission denied, after tracking, found that the system using the Mount command, not to call the underlying module, but in the application layer simulation of the real

Now that the Mount function, may be different distributions defined different, then need to use a new tool to achieve this function, that is ntfs-3g.


Enter Emerge-s ntfs3g from terminal

Find the name of the package, enter emerge sys-fs/ntfs3g, and install the package


Run cd/usr/src/linux-2.6.xx-xxx/again and enter the make Menuconfig start graphical interface to add fuse in the file system (file system in

Userspace) support option selected (that is, the content in the <> before the option is changed to M), and then exit and insert the module in the terminal input Insmod Fs/fuse/fuse.ko. and

Use Mount command after

Mount-t ntfs-3g/dev/sad2/mnt

You can implement NTFS-formatted disk mounts and read and write.


If you want to uninstall the module, you can use the umount/mnt.


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.