CentOS 5.5 掛載windows ntfs 文件系統

1, 首先確認fuse,CentOS 5.5 帶有fuse,可以使用 rpm -qa | grep fuse 查看是否安裝。

[root@localhost ntfs-3g-2010.5.22]# rpm -qa | grep fuse
fuse-2.7.4-8.el5

說明已經安裝fuse

2,安裝ntfs-3g, 系統默認的軟件庫更新不到ntfs-3g,可以自己下載編譯安裝。
下載網址:http://www.tuxera.com/community/ntfs-3g-download/

下載完後安裝,安裝方法下載點有。

簡單介紹一下, 下載後解壓

[root@localhost packages]# tar -zxvf ntfs-3g-2010.5.22.tgz 

進入解壓後的目錄

[root@localhost packages]# cd ntfs-3g-2010.5.22
[root@localhost ntfs-3g-2010.5.22]#

文件夾中的文件   

[root@localhost ntfs-3g-2010.5.22]# ls
aclocal.m4    config.h       configure.ac  INSTALL       m4           README
AUTHORS       config.h.in    COPYING       install-sh    Makefile     src
autogen.sh    config.log     COPYING.LIB   libfuse-lite  Makefile.am  stamp-h1
ChangeLog     config.status  CREDITS       libntfs-3g    Makefile.in
compile       config.sub     depcomp       libtool       missing
config.guess  configure      include       ltmain.sh     NEWS
[root@localhost ntfs-3g-2010.5.22]# 

接着依次執行     

[root@localhost ntfs-3g-2010.5.22]#./configure 
[root@localhost ntfs-3g-2010.5.22]#make 
[root@localhost ntfs-3g-2010.5.22]#make install

完了之後就可以正常mount ntfs 文件了

[root@localhost ntfs-3g-2010.5.22]# mount -t ntfs-3g /dev/sda2 /mnt
[root@localhost ntfs-3g-2010.5.22]# ls /mnt
centos    RECYCLER                                vm2k3
IDE       System Volume Information               vmdesk
Incoming  TDDOWNLOAD                              w2003SP2.iso
kankan    the brothers four                       windows  
music     ubuntustudio-10.04-alternate-amd64.iso  讀書
news      vm

3, 設置開機自動掛載文件系統

編輯/etc/fstab 文件, 在其中加入想要加載的分區即可,
如果不知道是哪個分區,可以使用fdisk -l 

[root@localhost ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        3825    30724281    7  HPFS/NTFS
/dev/sda2            3826       29322   204804652+   7  HPFS/NTFS
/dev/sda3   *       29323       31871    20474842+  83  Linux
/dev/sda4           31872       60801   232380225    5  Extended
/dev/sda5           31872       32125     2040223+  82  Linux swap / Solaris
/dev/sda6           32126       34674    20474811   83  Linux
[root@localhost ~]# 

如上,我要掛載的是windows下面的D盤,即是/dev/sda2 ,如果想掛載C盤,即是/dev/sda1

好了,開始往/etc/fstab 文件 中添加如下一行:

/dev/sda2    /winD      ntfs-3g  defaults  0 0

/winD這個文件是我在根目錄下建來專門掛載D盤的,你也可以新建在別的地方,例如: /mnt/wind
如此,則要改成 /dev/sda2    /mnt/wind      ntfs-3g  defaults  0 0  了。

好正式編輯:

[root@localhost ~]# vi /etc/fstab


LABEL=/                 /                       ext3    defaults        1 1
LABEL=/home             /home                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                 devpts  gid=5,mode=620   0 0
sysfs                   /sys                     sysfs   defaults        0 0
proc                    /proc                    proc    defaults        0 0
LABEL=SWAP-sda5         swap                     swap    defaults       0 0
/dev/sda2               /winD                    ntfs-3g defaults        0 0

wq!保存退出了。 開機試試看有沒有自動掛載吧!
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章