实现步骤

终端输入下面代码 获得硬盘的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


王铁手
4.1k 声望279 粉丝

怀着一颗铁匠的心,凭借一双铁手,打造自己的人生。