文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>如何快速为RedHat加入NTFS支持

如何快速为RedHat加入NTFS支持

时间:2006-08-29  来源:飞天二狭

默认Redhat 7.3 和 Redhat 8.0是不支持NTFS的,可以通过以下的方式
以单独的Module来支持NTFS,注意下列步骤只是以只读方式mount ntfs。
但是你在make xconfig的时候可以选择支持ntfs写入,但是正如界面上提示
的-这样做比较危险。
--------------------------【原文】-----------------------------------------------
Red Hat: A quick way to enable NTFS Support
Created: June 9, 2002
Modified: June 20, 2002
Author: Jim Hayward
Author E-mail: [email protected]
Copyright 2002, Jim Hayward. All Rights Reserved.
Distro Specific: Red Hat Linux

Relevant Links:
http://www.redhat.com/
http://linux-ntfs.sourceforge.net/

Title: Red Hat: A quick way to enable NTFS Support
Section: Distribution Specific
Sub-Section: Red Hat Linux

What is NTFS?

NTFS is the filesystem used by Windows NT, Windows 2000, and Windows XP.

Why didn't Red Hat enable NTFS support in their kernels?

Editors note: Anton Altaparmakov, the ntfs maintainer, took offense to my stating that read only support can cause data corruption problems. You can read his e-mail to me here

My prior statement was not in any way meant to be offensive to him, so I have removed the passage he objected too. However, in the past even while using read only support the ntfs module has been known to cause filesystem corruption. Enabling write support for the ntfs module, WILL EAT YOUR DATA!

Why is NTFS support poor under Linux?

Microsoft chooses not to release the information necessary to write a driver to access the NTFS filesystem for operating systems other then Windows. This basically makes writing a driver a case of trial and error.

This may lead you to ask the question, "Then why is Linux support for FAT and FAT32 filesystems any good?". The NTFS filesystem is a lot more complex then FAT and FAT32, thus making it harder to write a driver.

Alternatives to using NTFS support

Create an FAT32 (vfat) partition and store the data you need to access from Linux on it.

Is your system up to date?

I am going to assume you have updated your Red Hat 7.3 install with all of the currently available updates. Kernel version 2.4.18-5 is the latest official kernel available for Red Hat 7.3

Installing the kernel sources.

First check and see what kernel you are running. You must use the kernel source for the same kernel you are running.

[jimh@garfield jimh]$ uname -r
2.4.18-5

Check to see if you already have the kernel source installed with:

[jimh@garfield jimh]$ rpm -q kernel-source-2.4.18-5
kernel-source-2.4.18-5

If you don't have the kernel-source installed you will see:

[jimh@garfield jimh]$ rpm -q kernel-source-2.4.18-5
package kernel-source-2.4.18-5 is not installed

If the kernel source is not installed, download the source from your favorite Red Hat mirror site. You will need to be logged in as root to install the kernel source. Install the kernel source with:

rpm -ivh kernel-source-2.4.18-5.i386.rpm

If you are registered with The Red Hat Network you can also use up2date to install the kernel. This will download and then install the kernel-source for you.

up2date kernel-source

Preparing the kernel source

Login as the root user.

Change to the /usr/src/linux-2.4.18-5 directory
[root@garfield root]# cd /usr/src/linux-2.4.18-5

"make mrproper"
[root@garfield linux-2.4]# make mrproper

"make xconfig"
[root@garfield linux-2.4]# make xconfig

Load the default Red Hat kernel config that was used to compile the kernel you have installed.

[root@garfield linux-2.4]# rpm -q --qf '%{ARCH}\\n' kernel-2.4.18-5
athlon

Click "Load Configuration from file"

Side note: Red Hat did not ship an i586 uniprocessor kernel with 7.3. If you have a uniprocessor i586 system the command above will probably return i386. Use the i386.config if it does.

You can look in /usr/src/linux-2.4.18-5/configs to see what the default kernel configs Red Hat uses to compile their kernels.

[jimh@garfield jimh]$ ll /usr/src/linux-2.4.18-5/configs
total 564
-rw-r--r-- 1 root root 39830 May 2 14:36 kernel-2.4.18-athlon.config
-rw-r--r-- 1 root root 39858 May 2 14:36 kernel-2.4.18-athlon-smp.config
-rw-r--r-- 1 root root 49146 May 2 14:36 kernel-2.4.18-i386-BOOT.config
-rw-r--r-- 1 root root 40020 May 2 14:36 kernel-2.4.18-i386.config
-rw-r--r-- 1 root root 39960 May 2 14:36 kernel-2.4.18-i386-smp.config
-rw-r--r-- 1 root root 39957 May 2 14:36 kernel-2.4.18-i586.config
-rw-r--r-- 1 root root 39897 May 2 14:36 kernel-2.4.18-i586-smp.config
-rw-r--r-- 1 root root 40021 May 2 14:36 kernel-2.4.18-i686-bigmem.config
-rw-r--r-- 1 root root 39968 May 2 14:36 kernel-2.4.18-i686.config
-rw-r--r-- 1 root root 40414 May 2 14:36 kernel-2.4.18-i686-debug.config
-rw-r--r-- 1 root root 39966 May 2 14:36 kernel-2.4.18-i686-smp.config
-rw-r--r-- 1 root root 35944 May 2 14:36 kernel-2.4.18-i686-uml.config
-rw-r--r-- 1 root root 40170 May 2 14:36 kernel-2.4.18-x86_64.config
-rw-r--r-- 1 root root 40170 May 2 14:36 kernel-2.4.18-x86_64-smp.config

In the dialog box type the full path to the config file you want to use.
Example: /usr/src/linux-2.4.18-5/configs/kernel-2.4.18-i686.config

Click "Ok" to load the config and exit the dialog box.

Click "File Systems"
Scroll down and find "NTFS filesystem support (read only)"

Click "m" to build NTFS support as a module.

Click "Main Menu"

Click "Save & Exit"

An informational dialog box will popup telling you to run "make dep"
Click "Ok"

Open the toplevel Makefile in a text editor. This would be /usr/src/linux-2.4.18-5/Makefile
Look at the first four lines in the Makefile.

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 18
EXTRAVERSION = -5custom

Remove the word "custom" from the end of the EXTRAVERSION line.
Save the changes and exit

"make dep"
[root@garfield linux-2.4]# make dep

Compile the the ntfs module.

"make modules SUBDIRS=fs/ntfs"
[root@garfield linux-2.4]# make modules SUBDIRS=fs/ntfs

Create a directory for the ntfs module

mkdir /lib/modules/2.4.18-5/kernel/fs/ntfs

Copy the ntfs.o module to the directory you just created.

cp /usr/src/linux-2.4.18-5/fs/ntfs/ntfs.o /lib/modules/2.4.18-5/kernel/fs/ntfs

Set the permissions on the ntfs.o module to make sure they are correct.

chmod 0644 /lib/modules/2.4.18-5/kernel/fs/ntfs/ntfs.o

Update your modules.dep

/sbin/depmod -a

Thats it. You are now ready to use the new ntfs.o module.

Accessing your NTFS partitions

You will have to create a mount point and add an entry to /etc/fstab for the NTFS partitions you want to access.

There are many different options you can use to mount the partition depending upon your needs.

If you have a single user system or don't need to give others access to the partition, you can use this.
Replace "xxx" on uid and gid with your userid and group id.

/dev/hdc2 /mnt/windows ntfs noauto,user,uid=xxx,gid=xxx,umask=007 0 0

You can find out what your userid and groupid is with:

$ cat /etc/passwd | grep username
username:x:500:500:realname:/home/username:/bin/bash

If you were using the above user, the /etc/fstab entry would be:

/dev/hdc2 /mnt/windows ntfs noauto,user,uid=500,gid=500,umask=007 0 0

Description of the options above.

noauto = Don't mount at boot

user = Allow an ordinary user to mount, but only the user who mounted it can unmount the drive.

uid = sets owner for the partition and the files on it.

gid = sets group for the partition and the files on it.

umask = sets the permissions on the partition.

The above mount options will not be correct for all situations. This is just an example.

For more information you should read the manpage for the "mount" command. This manpage explains the mount options available for the NTFS and other filesystems.

-->Additional Information

The Linux-NTFS Project http://linux-ntfs.sourceforge.net/

All software titles and services are copyrighted by their respective owners.

下面是看录像后的总结:

如何让Linux支持NTFS分区(视频演示)

cd /usr/src/linux2.4

make menuconfig

file system

<m>NTFS file system support (read only)

save

uname -r

2.4.21-27.0.2.EL

make dep

make modules SUBDIRS=fs/ntfs

mkdir /lib/modules/2.4.21-27.0.2.EL/kernel/fs/ntfs

cp -f fs/ntfs/*.o /lib/modules/2.4.21-27.0.2.EL/kernel/fs/ntfs

depmod -a

modprobe ntfs

相关阅读 更多 +
排行榜 更多 +
独角兽装扮物语

独角兽装扮物语

休闲益智 下载
多格和迷失的猫

多格和迷失的猫

休闲益智 下载
模拟赛车精英

模拟赛车精英

赛车竞速 下载