實現步驟
終端輸入下面程式碼 獲得硬碟的UUID
diskutil info /Volumes/磁碟名 | grep UUID
寫入配置檔案
echo "UUID=EC9AB3F7-9AF6-F2EC-C4EC-F22419F32464 none ntfs rw,auto,nobrowse" | sudo tee -a /etc/fstab
重新連線此USB裝置,桌面上不再顯示這個 USB 分割槽的白色盒子圖示。
建立訪問磁碟連結
sudo ln -s /Volumes ~/Desktop/Volumes
在桌面會出現Volumes
的快捷方式,開啟即可找到硬碟。
相關文件
/*
* We only allow read/write mounts if the “nobrowse” option was also
* given. This is to discourage end users from mounting read/write,
* but still allows our utilities (such as an OS install) to make
* changes to an NTFS volume. Without the “nobrowse” option, we force
* a read-only mount. Note that we also check for non-update mounts
* here. In the case of an update mount, ntfs_remount() will do the
* appropriate checking for changing the writability of the mount.
*/
if ((vfs_flags(mp) & MNT_DONTBROWSE) == 0 && !vfs_isupdate(mp))
vfs_setflags(mp, MNT_RDONLY);
http://www.opensource.apple.com/source/ntfs/ntfs-83/kext/ntfs_vfsops.c