Pages

Friday, 30 August 2013

如何更加方便的在FreeBSD中使用ntfs-3g

很多人应该试过在FreeBSD里装ntfs-3g来代替原来的mount_ntfs命令(pkg_add -r ntfs-3g),原来的那个命令在NTFS根目录会有很多乱七八糟的东西,而且最纠结的是居然不能写。可是FreeBSD的桌面环境们貌似是不太待见 ntfs-3g。如果你用ntfs-3g的文件替换原来在/sbin中的命令文件,会提示如下错误。(俺用的KDE4)

An error occurred while accessing '19.5 GiB Hard Drive', the system responded: org.freedesktop.Hal.Device.Volume.UnknownFailure: ntfs-3g: Unknown option '-u'.  ntfs-3g 2010.10.2 external FUSE 27 - Third Generation NTFS Driver         Configuration type 1, XATTRS are off, POSIX ACLS are off  Copyright (C) 2005-2007 Yura Pakhuchiy Copyright (C) 2006-2009 Szabolcs Szakacsits Copyright (C) 2007-2010 Jean-Pierre Andre Copyright (C) 2009 Erik Larsson  Usage:    ntfs-3g [-o option[,...]] <device|image_file> <mount_point>  Options:  ro (read-only mount), remove_hiberfile, uid=, gid=,           umask=, fmask=, dmask=, streams_interface=.           Please see the details in the manual (type: man ntfs-3g).  Example: ntfs-3g /dev/sda1 /mnt/windows  Ntfs-3g news, support and information:  http://ntfs-3g.org

看来FreeBSD的加载命令比较奇葩呃。。。
我就找啊找啊,终于在某个藏的很深的文件里找到了办法。
1、把/usr/local/share/hal/mount-fuse文件拷贝到/sbin里

cd /sbin
cp /usr/local/share/hal/mount-fuse ./mount-fuse

2、修改其中的内容,把FUSE_HELPER改成ntfs-3g
3、把/sbin中的mount_ntfs备份一下
mv mount_ntfs mount_ntfs.backup

4、替换。 
mv mount-fuse mount_ntfs

好啦.