The partition format of Windows 2003/XP/is NTFS. The NTFS format supports a large hard drive of up to 2 TB, and its performance will not decrease as the disk capacity increases. However, because this format cannot be used directly in Linux, Linux users cannot make full use of the hard disk space in NTFS format. Because Linux does not compile the NTFS format mounting function
The partition format of Windows 2000/XP/2003 is NTFS. The NTFS format supports a large hard drive of up to 2 TB, and its performance will not decrease as the disk capacity increases. However, because this format cannot be used directly in Linux, Linux users cannot make full use of the hard disk space in NTFS format.
Because Linux does not compile the NTFS format mounting function into the kernel, you must re-compile the kernel. However, after compilation, it is difficult to ensure that NTFS partitions can be mounted. The following describes how to correctly and reliably install, compile, and Mount NTFS to Linux.
Install
1. RPM
The RPM Component Management program is generally used to install software in Linux. First, use the following command to query the current Linux kernel version:
# Uname-r
After obtaining the version information, go to the release. After the download is complete, run the following command to install the component:
# Rpm ivh kernel-ntfs-2.4.28-27.8.0.i686.rpm
2. CD
First, log on to Linux as root, put the second installation disk of Linux into the optical drive, find the kernel-2.4.xx-x-i386.rpm under the/redhat/RPMS Directory (here x represents a number) file, enter the following command:
# Rpm ivh kernel-2.4.xx-x.i386.rpm
Compile
After the NTFS software package is installed, you can compile it. First enter the/usr/src/linux-2.4.xx-x/configs Directory, directly select kernel-2.4.xx-x. i686.config, copy the file to the/usr/src/linux2.4.xx-x Directory. Open it in a text editor and change the line # CONFIG_NTFS_FS is not set to CONFIG_NTFS_FS = m.
Then go to the/usr/src/linux-2.4.xx-3 directory and enter the following command to compile the NTFS module:
# Make modules
After compilation, find an ntfs under the/usr/src/linux-2.4.xx-x/fs/ntf directory. to the/lib/modules/2.4.xx-x/kernel/fs directory. Finally return to the/usr/src/linux-2.4.xx-3 Directory, enter the following command:
# Depmod
# Modprobe ntfs
Mount NTFS
After installation and compilation, you can create a directory under/mnt as a mount point. For the author, the mount point is set to windows1. Use the mount command to mount the file, as shown in the following example:
# Mount t ntfs/dev/hdc1/mnt/windows1
After NTFS is successfully mounted, you can switch to the Directory of the created mount point (for example, switch to/mnt/windows1) and run the following command to view the files in the NTFS partition:
# Ls-l
After installing the NTFS partition components in RPM Mode, Linux can only read and run related files in the mounted NTFS partition, you cannot write any information or store any files in the NTFS partition.
In this case, the general user cannot use the content in the NTFS partition, because the mounting permission is only available to the system administrator root. The owner (UID) and owner group (GID) of the mounted partition are both root. If you want users to use the mounted files, you must reset the settings. The procedure is as follows:
First, before running the mount command, the root user must consider how many users will use files in the NTFS partition. for example, if abc users need to use files, enter the following command:
# Mount/dev/hdc1/mnt/windows1 t ntfs r o uid = abc
After mounting, you can see that the owner of windows1 has changed to abc. Now, abc can use any file in the windows1 directory, so as to use NTFS disk space.
Automatically mount the FAT partition at startup in linux
1. run the fdisk-l command to obtain the names of all partitions.
2. create a folder at the Mount point
3. mount command: mount-o iocharset = cp936-t vfat/dev/hda1/mnt/win/C
In this way, the C disk is mounted.
-O iocharset = cp936 is used to support Chinese characters for mounted files
4. add the Mount command to the fstab file under/etc/If you want to start the mounting.