標籤:eal 支援 title image 支援ntfs 軟體 實現 完全 led
問題背景
我想很多使用Mac的同學都會遇到讀寫NTFS磁碟的問題,因為預設情況下Mac OSX對NTFS磁碟的掛載方式是唯讀(read-only)的,因此把一個NTFS格式的磁碟插入到Mac上,是只能讀不能寫的,用起來很是不便。
因此也就出現了一些第三方工具,例如Tuxera NTFS for Mac、Paragon NTFS for MAC等,這些工具都可以實現Mac下NTFS的寫操作,但是這些工具都是收費的,當然也有些破解的版本,但是破解軟體畢竟存在安全風險,so,I don‘t really like that.
此外Tuxera也提供了開源的NTFS讀寫方案:NTFS-3G,基於GPL授權的NTFS-3G也可以通過使用者空間檔案系統在Mac OS X上實現NTFS分區的讀寫。這個方案也比較不錯,只是需要簡單的安裝,本文不再展開。具體的可以參考官方連結:http://www.tuxera.com/community/open-source-ntfs-3g/
但其實,我們完全可以不藉助任何第三方工具就能解決這個問題,因為其實OSX原生就是支援NTFS的。後來由於微軟的限制,蘋果把這個功能給屏蔽了,但是我們可以通過命令列手動開啟這個選項。
How to do that?
mount查看磁碟掛載情況
thatsitdeMacBook-Pro:~ thatsit$ mount/dev/disk4s2 on /Volumes/Untitled (ntfs, local, nodev, nosuid, read-only, noowners)thatsitdeMacBook-Pro:~ thatsit$
這時候如果我們要實現/dev/disk4s1分區的可寫掛載,我們只需要做做一下兩個步驟:卸載、重新掛載
卸載
thatsitdeMacBook-Pro:~ thatsit$ sudo umount /Volumes/Untitled/
重新掛載
thatsitdeMacBook-Pro:~ thatsit$ sudo mount -t ntfs -o rw,auto,nobrowse /dev/disk4s2 /Volumes/Udisk/
這時候/dev/disk4s2已經以讀寫的方式掛載到/Volumes/Udisk/了,下面我們來進行掛載結果的確認
確認掛載
thatsitdeMacBook-Pro:~ thatsit$ mount|grep ntfs/dev/disk4s2 on /Volumes/Udisk (ntfs, local, noowners, nobrowse)thatsitdeMacBook-Pro:~ thatsit$
測試寫入
thatsitdeMacBook-Pro:~ thatsit$ cd /Volumes/Udisk/thatsitdeMacBook-Pro:Udisk thatsit$ touch test_writingthatsitdeMacBook-Pro:Udisk thatsit$ ll|grep test_writing -rwxr-xr-x 1 thatsit staff 0 12 24 17:14 test_writingthatsitdeMacBook-Pro:Udisk thatsit$ thatsitdeMacBook-Pro:Udisk thatsit$ echo heheda >> test_writing thatsitdeMacBook-Pro:Udisk thatsit$ cat test_writing hehedathatsitdeMacBook-Pro:Udisk thatsit$ thatsitdeMacBook-Pro:Udisk thatsit$ ll|grep test_writing -rwxr-xr-x 1 thatsit staff 7 12 24 17:15 test_writingthatsitdeMacBook-Pro:Udisk thatsit$
上述掛載參數的詳細說明:
mount -t ntfs -o rw,auto,nobrowse /dev/disk4s2 /Volumes/Udisk/-t ntfs # 執行要掛載的分區檔案系統格式-o # 執行掛載的選項rw # read-write,以讀寫的方式掛載auto # 自動檢測檔案系統,此參數可以省略nobrowse # 這個選項非常重要,因為這選項指明了在finder裡不顯示這個分區,只有開啟了這個選項才能將磁碟以讀寫的方式進行掛載/dev/disk4s2 # 要掛載的分區,也就是我們在mount命令中看到的盤符/Volumes/Udisk/ # 掛載點* /Volumes/Udisk這個目錄是需要存在的,如果不存在需要手動建立下:sudo mkdir /Volumes/Udisk* 如果目錄不存在會收到如下報錯:mount: realpath /Volumes/Udisk: No such file or directory
通過上面的測試大家也看到了,此時的NTFS分區已經是可寫的了;但是這個時候還存在另一個小問題,因為我們在掛載的時候使用nobrowse選項,這個分區在finder裡是不顯示的。
總會有些同學不習慣一直使用命令列進行操作,所以需要高解決這個問題:
解決辦法其實很簡單,因為這個分區是掛/Volumes下的,我們把這個目錄在案頭做一個軟連結就OK了。
建立軟連結
thatsitdeMacBook-Pro:Udisk thatsit$ sudo ln -s /Volumes/Udisk/ ~/Desktop/UdiskPassword: # <----輸入使用者密碼thatsitdeMacBook-Pro:Udisk thatsit$
效果如下:案頭上會顯示如下的盤符,點擊即可進入Finder
----Done----
參考連結:
https://zh.wikipedia.org/wiki/NTFS
Mac下如何不藉助第三方工具實現NTFS分區的可寫掛載