How to put the ntfs module into the kernel

Source: Internet
Author: User
Article Title: how to put the ntfs module into the kernel. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. Find the. config file required to compile the kernel.

The/usr/src/linux/configs directory contains several configurations used to compile the kernel. Select the desired configuration, copy it to the/usr/src/linux directory, and change it to. config.

Cp/usr/src/linux/configs/kernel-2.2.16-i686.config/usr/src/linux/. config

2. Modify the. config file, remove unnecessary modules, and add the desired modules.

Open. config, there are many XXXX = m items, these are to be compiled as module items, because we do not want to compile these modules, so we need to remove all XXXX = m items. And then add the module we want #

Change CONFIG_NTFS_FS is not set to CONFIG_NTFS_FS = m. Of course, you can use various tools to do this.

3. Compile the NTFS module.

Run the make modules command in the/usr/src/linux directory to compile the NTFS module.

4. Install the NTFS module.

The ntfs. o obtained after compilation is under the/usr/src/linux/fs/ntfs directory and manually copied to the correct directory.

Cp/usr/src/linux/fs/ntfs. o/lib/modules/2.2.16-22/fs/

2.2.16-22 is the version number of your linux core.

Note: Do not run the make command

Modules_install. Otherwise, it will cause serious consequences. It will delete all modules in your system and only install the compiled modules (ntfs. o ).

5. Load the NTFS module.

Run the command depmod; modprobe ntfs and try to access your NTFS file system. Wish you success!

Some modules depend on your system kernel, so the methods provided in this article are not applicable. Some modules are dependent on other modules. If you are not familiar with these dependencies, we recommend that you use make

Menuconfig to add the desired module.

Compile the NTFS partition module by yourself (take 2.4.18-3 as an example)

1. Use uname-a to [view your own kernel version.]

2. Run the rpm-q kernel-source-2.4.18-3 command to check whether the kernel source program is installed.]

3. Assuming that the source program has been installed, to the/usr/src/linux-2.4.18-3/directory.

4. Use make mrproper to [clear unnecessary useless modules.]

5. Use rpm-q? Pf '% {ARCH} \ n' kernel-2.4.18-3

[Check which ixxx. config file under configs is used. (the local machine is i686)]

6. Open/usr/src/linux-2.4.18-3/configs/kernel-with your familiar Editor (vi-

2.4.18-3. Check NTFS in i686.config and change the two rows to config NTFS fs = m and config NTFS rw = m to save.

7. Select m when using make config to NTFS, and press enter by default. [some articles use make menuconfig or make

Xconfig, but I don't have these two in Redhat7.3?]

8. Open the/usr/src/linux-2.4.18-3/Makefile file with your familiar Editor (vi ),

-Change Xcustom to EXTRAVERSION =-X to save and exit. (X is a number)

9. Use make dep

10. Use make modules SUBDIRS = fs/ntfs (now ntfs. o has been generated)

11. Use mkdir/lib/modules/2.4.18-3/kernel/fs/ntfs

12. Use cp/usr/src/linux-2.4.18-3/fs/ntfs. o to the directory just created.

13. Use chmod 644/lib/modules/2.4.18-3/kernel/fs/ntfs. o

14. Use depmod-

15. Add the following content with vi/etc/fstab:

/Dev/hdxy ___/mnt/XXX ___ ntfs ___ noauto, user, uid = z, gid = z, umask = 007, iocharset = cp936 ___ 0_0 save and exit. [hdxy, x is the IDE number. b. c. d and y are the partition numbers. XXX is your own name. z is the ID of the user and group]

16. Use mount/mnt/XXX to exit umount/mnt/XXX

Fully Automated Loading

If files are frequently exchanged and you want to load specific partitions as soon as you enter Linux, and you want to mount this partition to a fixed directory,

You can use this method.

Open the fstab file in the/ect directory in any text editor

/Dev/hda5/mnt/win-c ntfs umask = 0000 defaults, iocharset = cp936 0 0

/Dev/hda3/mnt/win-c vfat defaults, codepage = 936, iocharset = gb2312 0 0

Add to the end of the last line, save and exit. It will be automatically loaded every time the system is restarted. Note: "vfat" indicates the FAT32 file system is loaded, "msdos" indicates the FAT16 file system, and "ntfs" indicates the NTFS file system of NT. Without umask = 0000, only the root user can access the ntfs disk.

Mount-o iocharset = cp936-t ntfs/dev/hdaX/mnt

Supports Chinese Characters

Mount usage (sakulagi)

Fat32 partition mount-o codepage = 936, iocharset = cp936/dev/hda7/mnt/cdrom

Ntfs partition mount-o iocharset = cp936/dev/hda7/mnt/cdrom

Iso file mount-o loop/abc. iso/mnt/cdrom

Floppy Disk mount/dev/fd0/mnt/floppy

USB flash mount/dev/sda1/mnt/cdrom

Mount-a for all/etc/fstab content

You can specify the file format "-t format", which can be vfat, ext2, and ext3.

Installation is a little different from uninstallation, for example, the file to be installed is a ntfs-1.0.2.rpm

When uninstalling:

Rpm-e ntfs, the above part is for reference only. After completing this, you can mount ntfs successfully, but you will find a problem and cannot write data to ntfs)

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.