close

使用ntfs-3g掛上的ntfs HD可以在Linux下正常讀寫。不知道為甚麼,ntfs-3g現在直接用yum沒法安裝,需要另行下載並安裝,所以安裝方式跟之前不太一樣。安裝時要用root權限安裝,所以請小心。

 

1. 首先,請先安裝需要的compiler:

# yum install gcc gcc-c++

or

# yum groupinstall "Development Tools"     //空間很大而且很懶(如我)的話,就直接用這個把所有可能會用到的工具一次全裝完算了!XDDD

 

2. 請到https://www.tuxera.com/community/open-source-ntfs-3g/ 下載最新版的:ntfs-3g_ntfsprogs-2017.3.23

# tar -zxvf ntfs-3g.tar.gz                    //到下載的目錄中先解壓縮。

# cd ntfs-3g_ntfsprogs-2017.3.23     //到解開的目錄下進行安裝。如果上面的compiler沒有安裝,這裡會失敗。如果不確定有沒有安裝,也可以先跑這個看看有缺甚麼,再補裝就行了。

# ./configure

............................
config.status: creating src/ntfs-3g.probe.8
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
/bin/rm: cannot remove `libtoolT': No such file or directory
You can type now 'make' to build ntfs-3g.

# make
...................
make[2]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23/src'
make[2]: Entering directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'
make[2]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'
make[1]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'

# make install
............................
ln -s -f ntfs-3g.8 "/usr/local/share/man/man8/mount.lowntfs-3g.8"
make[2]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23/src'
make[1]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23/src'
make[1]: Entering directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'
make[2]: Entering directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'
make[2]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/usr/local/share/doc/ntfs-3g'
 /usr/bin/install -c -m 644 README '/usr/local/share/doc/ntfs-3g'
make[2]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'
make[1]: Leaving directory `/root/下載/ntfs-3g_ntfsprogs-2017.3.23'

↑ ntfs-3g安裝完成!

 

3. 建立掛載點:
# mkdir /mnt/usbhd

 

4. 檢查外掛的HD的dev名稱:
# fdisk -l

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1      243202  1953512032+   7  HPFS/NTFS

↑ 最後這個就是我們要掛的hd。

 

5. 把ntfs格式的usb HD掛上。
# mount -t ntfs-3g /dev/sdc1 /mnt/usbhd/
# cd /mnt/usbhd/

# ls                //如果可以看到HD上的東西,表示掛載成功。

 

6. 建好現成的格式設定,以後掛載比較方便:
# vi /etc/fstab     //請在這個檔案中加入下面這行:

/dev/sdc1 /mnt/usbhd     ntfs-3g                        defaults        0 0

存檔退出。

以後每次掛USB HD時,直接打:

# mount /mnt/usbhd

即可順利掛載NTFS格式的外接HD了。

卸載時就直接寫:

# umount /mnt/usbhd

 

參考文獻:

http://benjr.tw/23708

https://www.tuxera.com/community/open-source-ntfs-3g/

http://download.ithome.com.tw/article/index/id/156

https://www.vultr.com/docs/how-to-install-gcc-on-centos-6

 

arrow
arrow
    文章標籤
    rhel NTFS HD gcc ntfs-3g
    全站熱搜

    貓熊麗麗 發表在 痞客邦 留言(0) 人氣()