各位一定常碰到在 Linux平台無法存取NTFS的檔案格式,核心本
身有支援,新版 Fedora 核心通常已開啟,多數的核心預設還是
沒有開啟支援NTFS,因此網路上有人寫了這樣的套件「NTFS-3G」。


目前小弟碰到的情形是抓下 kernel.x.src.rpm 重新編譯時,出
現了問題,加上又懶得下載新版的核心重新編譯,因此想起了在
Ubuntu 時看到的這個套件,後來發現原來也可以應用在其他
不同版本的 Linux平台上,因為沒有時間找問題重新編譯核心的
前提下,就將套件抓回來安裝。

安裝 NTFS-3G 前,請先安裝 FUSE,以下分別有這兩個套件的簡
單說明,有興趣的朋友在自行前往查看。


FUSE: http://fuse.sourceforge.net/

With FUSE it is possible to implement a fully functional
filesystem in a userspace program. Features include:



 * Simple library API
 * Simple installation (no need to patch or recompile the kernel)
 * Secure implementation
 * Userspace - kernel interface is very efficient
 * Usable by non privileged users
 * Runs on Linux kernels 2.4.X and 2.6.X
 * Has proven very stable over time


NTFS-3G: http://www.ntfs-3g.org/index.html



The NTFS-3G driver is an open source, freely available read/write
NTFS driver for Linux, FreeBSD, Mac OS X, NetBSD, and Haiku.
It provides safe and fast handling of the Windows XP,
Windows Server 2003, Windows 2000 and Windows Vista file systems.

Most POSIX file system operations are supported,
with the exception of full file ownership and access right support.


【安裝步驟】


§ 先建立欲掛載 NTFS 的目錄:

# mkdir /mnt/ntfs-1


§ 下載 fuse & ntfs-3G 套件,並將檔案放置 /usr/local/src 安裝:

# wget http://nchc.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.1.tar.gz
# wget http://www.ntfs-3g.org/ntfs-3g-1.1104.tgz
# cp fuse-2.7.1.tar.gz ntfs-3g-1.1104.tgz /usr/local/src
# cd /usr/local/src


§ 安裝 fuse:

# tar zxvf fuse-2.7.1.tar.gz
# cd fuse-2.7.1
# ./configure
# make;make install


§ 安裝 ntfs-3g:

# tar zxvf ntfs-3g-1.1104.tgz
# cd ntfs-3g-1.1104
# ./configure
# make;make install


§ 將 NTFS 的檔案掛載至剛剛建立的目錄:(示範兩種掛載方式)

# mount -t ntfs-3g /dev/sda1 /mnt/ntfs-1

or

# ntfs-3g /dev/sda1 /mnt/ntfs-1


補充說明:

若要開放全部使用者可以使用這個掛載區,可以加上 -o 這個參數

ntfs-3g /dev/sda1 /mnt/ntfs-1 -o silent,umask=0,locale=zh_TW.UTF-8



§ 寫入 fstab 內,方便下次重新開機自動掛載:

# vi /etc/fstab

 /dev/sda1 /mnt/ntfs-1 silent,umask=0,locale=zh_TW.UTF-8 0 0

 * 主機語系設定需 與 NTFS語系相同,查詢方式為「locale」。

  http://ntfs-3g.org/support.html#questions



【問題排除】

假如開機時,遇到下面發生的錯誤訊息,主要原因在於開機時,
核心並未掛載fuse,所以導致 mount失敗,而無法使用NTFS的掛
載區。

fusermount: failed to open /dev/fuse: No such file or directory
fuse_mount failed.

此時,只要使用 root 執行以下指令即可!

# modprobe fuse



有些 Linux 版本已經可以透過 yum 更新 ntfs-3g的套件,自然
就不用大費周章的下載安裝檔重新編譯,至於 kernel.src.rpm
為什麼再編譯 ntfs.ko出現問題,只好過個幾天在繼續測試看看
,看看能不能解決這個麻煩的問題,要不然花點時間抓新核心回
來重編,也是個好主意,不過..最近沒空這樣搞啊! Orz...

筆記就先寫到這邊,該出門上班了!以後再繼續胡言亂語。 XD



※ 今天是麻吉 Allen 的生日,也祝福他「生日快樂」唷!


                          Paul

                       2007.11.23
arrow
arrow
    全站熱搜

    paul 發表在 痞客邦 留言(0) 人氣()