Linux下写NTFS文件系统

最近因为工作需要,安装了Debian Linux,保留了机器上原有的Windows2000操作系统。不幸的是我的磁盘分区格式都是NTFS的,在Linux下读是不成问题的:mount -tntfs /dev/hda1 /mnt/c -o iocharset=utf8, 并且我把他添加到了/etc/fstab文件中,这样就能开机自动mount了。但是碰到的问题是这样不能够写,即使指定rw选项依然不能够写入。据说2.6的内核支持NTFS的写操作,只好试试看了。下了一个2.6.17的内核,修改配置,增加对NTFS文件系统的写支持,重新编译,修改grub,重新起动,等待奇迹的出现。很失望,和原来一模一样。没办法,只有google了,一个叫做captive的软件出现在视线中,据说能够写NTFS分区,赶紧down下来试试看。http://www.jankratochvil.net/project/captive/dist/captive-static-1.1.7.tar.gz,下来之后
tar xzvf captive-static-1.1.7.tar.gz
cd captive-static-1.1.7
./install
然后执行
captive-install-acquire
这里需要拷贝xp系统的ntfs.sys文件和ntoskrnl.exe到/var/lib/captive目录下,fastfat.sys与cdfs.sys是可选的,如果愿意也可以拷贝进来,接着往下走
mount -t captive-ntfs /dev/hda1 /mnt/c
出现错误,如下
/usr/libexec/captive-fusermount: Notice: Created FUSE device: /dev/fuse
FATAL: Module fuse not found.
/usr/libexec/captive-fusermount: Warning: "/dev/fuse" cannot be opened and even failed: /sbin/modprobe fuse
/usr/libexec/captive-fusermount: fuse device not found, try 'modprobe fuse' first
fuse: Failed to find functional 'fusermount'. Tried locations below:
/usr/local/bin/fusermount: No such file or directory
/usr/bin/fusermount: No such file or directory
/bin/fusermount: No such file or directory
/usr/local/sbin/fusermount: No such file or directory
/usr/sbin/fusermount: No such file or directory
/sbin/fusermount: No such file or directory
/usr/libexec/captive-fusermount: Success
看来captive确实已经安装成功了,错误是缺少fuse模块,继续google,看看fuse是何方神圣。
http://fuse.sourceforge.net/ 找到了,原来是Filesystem in Userspace,简单的说就是用户空间的文件系统,不多说了,有兴趣看看他的文档。我下的是fuse-2.5.3.tar.gz,然后
tar xzvf fuse-2.5.3.tar.gz
cd fuse-2.5.3
./configure
make
make install
modprobe fuse
一切OK,好了,可以试试了
mount -t captive-ntfs /dev/hda1 /mnt/c
不好,又出现错误了
/usr/local/bin/fusermount: mountpoint is not empty
/usr/local/bin/fusermount: if you are sure this is safe, use the 'nonempty' mount option
/usr/libexec/captive-fusermount: mountpoint is not empty
/usr/libexec/captive-fusermount: if you are sure this is safe, use the 'nonempty' mount option
fuse: Failed to find functional 'fusermount'. Tried locations below:
/usr/local/bin/fusermount: Success
/usr/bin/fusermount: No such file or directory
/bin/fusermount: No such file or directory
/usr/local/sbin/fusermount: No such file or directory
/usr/sbin/fusermount: No such file or directory
/sbin/fusermount: No such file or directory
/usr/libexec/captive-fusermount: Success
redleaf:~#
Captive-WARNING **: CORBA Exception occured: id="IDL:omg.org/CORBA/COMM_FAILURE:1.0", value=0x846ce7c
aborting...

什么,mountpoint is not empty,居然说我挂载点是空的,搞没搞错,我的东西可是实实在在存在的,仔细想想,原来我系统是自动mount的,没有umount就重新mount了,会不会是这个错误,umount先,
#umount /dev/c
#mount -t captive-ntfs /dev/hda1 /mnt/c
#
哈哈,终于没有错误了,写NTFS分区试试
#mkdir test
#rmdir test
#
没有错误,大功告成!!!!
感谢GNU,感谢那些伟大的程序员!!!!

你可能感兴趣的:(Linux)