- 论坛徽章:
- 0
|
转自:
http://www.devfront.com:8080/?q=node/153
在当前2.6版本的内核里,包含了Linux-NTFS项目组的驱动,该驱动可以对NTFS分区进行快速而可靠的读取操作,然而写操作虽然可用,稳定性无法保障。
关于Linux对NTFS文件系统的支持,渊源已久,完美的解决方案还在继续挖掘中。
几年前,Jan Kratochvil发布了Captive NTFS(http://www.jankratochvil.net/project/captive/)。该驱动利用ReactOS(http://www.reactos.org/)对Windows的NTFS原始驱动NTFS.SYS进行包装,从而提供了对NTFS读写的完全支持。
听起来这是一个不错的解决方案,可是由于版权的问题,NTFS.SYS文件是不能随便发布的,这给应用带来了问题。
本月,来自Linux-NTFS项目组的 Szabolcs Szakacsits出台了他的新思想,给NTFS写操作的支持带来了曙光。
通常驱动程序工作在内核空间(kernel space),然而也有些驱动程序工作在用户空间(user space),FUSE(http://fuse.sourceforge.net/)就是一个例子。通过FUSE的支援,你可以开发出具有完全功能的用户空间文件系统。
新的驱动暂时命名为NTFS-3g,在FUSE的基础上,提供了对NTFS文件系统的完全读写支持,而不用微软的NTFS驱动。测试情况如下:
在一台运行Gentoo Linux的Athlon 64 4400+ X2机器,从一个只有NTFS分区的磁盘读/写2G数据。
对于读操作,Linux-NTFS内核驱动花费了37秒时间,CPU占用率为35%。NTFS-3g也花费了37秒,CPU占用率为50%。对于写操作,Linux-NTFS没有测试(它对NTFS提供的写支持不完善),NTFS-3g可以毫无故障地完成,当然速度上比较慢,占用了10分钟。
根据官方的声明,大分区小文件的创建和删除操作和ext3性能相当,但是仍有提升的可能。而且,由于NTFS-3g运行在用户空间,内核和用户空间可以做到100%的隔离,系统的稳定性不会受到影响。
虽然NTFS-3g仍在测试阶段,无疑它解决了Linux对NTFS支持的长而未决的问题。也许有一天,它会并入Linux内核中。
参考资料:
http://www.apcstart.com/site/amills/2006/08/870/linux-to-get-reliable-ntfs-write-support
Linux has had NTFS support for many years now, but as a reverse engineered filesystem, progress hasn’t exactly been fast.
Currently, the original
[color="#3f71ff"]Linux-NTFS
project’s driver is included in all 2.6 kernels, and is extremely fast and reliable — if all you want to do is read your NTFS partitions.
Write support is available, but it comes with a big fat warning in the kernel that relying on its operation would be a very bad thing indeed.
A few years ago, and not to be outdone, a smart chap called Jan Kratochvil released
[color="#3f71ff"]Captive NTFS
, which used Windows’ own NTFS.SYS bound in a
[color="#3f71ff"]ReactOS
wrapper to provide full read/write support.
It was a great idea — after all, why rewrite a filesystem driver when you can just Windows’ own? However for obvious reasons the Microsoft NTFS.SYS driver can’t be (legally) publicly distributed, so it’s not the ideal solution.
This month, however, the holy grail came within sight with Szabolcs Szakacsits from the Linux-NTFS team presenting a new beta NTFS filesytem driver built to work with
[color="#3f71ff"]FUSE
, an extensible system for userspace filesystems.
Tentatively titled
[color="#3f71ff"]NTFS-3g
, it features full/read write support for NTFS filesystems without the need for the proprietary Microsoft NTFS driver.
The question, of course, is how does it perform?
Testing on an Athlon 64 4400+ X2 running Gentoo Linux, and using a simple time-d operation to copy a 2G pagefile (from Windows, no less!) to and from an NTFS partition on a separate drive, using both the original Linux-NTFS kernel driver and the new NTFS-3g we got the following results:
For reading, the Linux-NTFS driver used about 35% CPU time and took 37 seconds to complete. Write speed wasn’t tested, for obvious reasons.
For NTFS-3g, CPU usage was at around 50% while reading, and performed the operation in exactly the same time frame at 37s. Writing — that is copying to the NTFS partition — was a different story. It worked flawlessly, but it was slow.
CPU usage was 100% split between kernel (presumably through the FUSE driver plugin) and userspace and the operation took 10 minutes to complete. A tad slow, but we were throwing a 2GB file at it. According to the official announcement, large volume small file creation and deletion performs at similar speeds to ext3, but there’s clearly room for improvement, a fact acknowledged by the NTFS-3g development team.
While it’s beta and early days yet, NTFS-3g looks to be solving an age-old problem with Linux and Windows interoperability and undoubtedly, as a full open-source solution, NTFS-3g will eventually find its way into a future kernel release.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/22778/showart_155755.html |
|