Compile a kernel module that supports NTFS

Source: Internet
Author: User
Article title: compile a kernel module that supports NTFS. 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.
Author: zhyj
  
The traditional kernel module compilation method is cumbersome and time-consuming. This article will show you how to quickly compile the required kernel module
New method.
  
When you have installed the Linux system and started it, congratulations! If the WinNT/2000 series are installed on your hard disk
When you try to access another NTFS partition. Because the Linux system you are using has not been compiled
The NTFS file system. What should I do? Maybe you will run make menuconfig and re-customize what you need
And then run make modeules; make modeules_install. This is not only tedious,
Time-consuming, and problems may occur. Or because it is difficult for you to compile the kernel, too many choices make you helpless.
, You have no good way at all. This article provides you with a simple method, you can easily compile what you need
The NTFS. o module ). For example, I hope it will help you compile other modules.
  
The system I used when writing this article is Red Hat Linux release 7.0 (Guinness) Kernel 2.2.16-22 on
An i686. From a newly installed system, we will compile a file system that we want to support NTFS.
System module.
  
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 its name 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. Then add the module we want to add # CONFIG_N
TFS_FS is not set to CONFIG_NTFS_FS = m. of course, you can use a variety of 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/
  
Note: do not run the command make modules_install. Otherwise, it will cause serious consequences and delete you.
Only the compiled module (ntfs. o) is installed for all modules in the system ).
  
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 and other modules
Dependencies. If you are not familiar with these dependencies, we recommend that you remove the unused module options in step 2.
Add the desired module through make menuconfig.
  
I used this method to compile a module that supports the NTFS file system for three minutes. what about you?
  
Author profile
  
Liu Junmin, an engineer of Haichen Tianze company (www.hisen.com), followed by the source code open-source movement.
Write a program to send time. You can contact him by email fancao0515@0451.com.
  
  

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.