开启macOS的原生写入Ntfs的功能

在使用原生写入Ntfs功能前,测试了第三方的ntfs-3g的方案超级不稳定,害怕数据丢失果断放弃.

基于osxfuse的ntfs-3g:https://github.com/osxfuse/osxfuse/wiki/NTFS-3G


 方案一

  1.打开终端

    sudo mkdir /Volumes/ntfs 

    sudo mount_ntfs -o rw,auto,nobrowse /dev/disk2s1 /Volumes/ntfs

   2.可以方便的进入写入操作了,可以在Findar中shift+command+g,查找/Volumes,或者开启隐藏文件夹显示shift+command+.然后进入/Volumes文件夹,也可以创建桌面的软连接

    sudo ln -s /Volumes/ ~/Desktop/Volumes

   3.unmount系统默认挂载的ntfs分区的Shell脚本:

 1 #!/bin/bash
 2 
 3 #Check sudo
 4 if [[ $(/usr/bin/id -u) -ne 0 ]]; then
 5     echo "This script should be run as ROOT. Try sudo"
 6     exit
 7 fi
 8 echo "___________________________________"
 9 echo "umount all ntfs disk on this system"
10 echo ""
11 
12 for FILENAME in "/Volumes"/*
13 do
14     filetype=$(diskutil info "$FILENAME" | grep "Type (Bundle):" | cut -d ':' -f2 | tr -d ' ')
15     if [ "$filetype" = "ntfs" ]; then
16         uuid=$(diskutil info "$FILENAME" | grep UUID | cut -d ':' -f2 | tr -d ' ')
17         # volumeName=$(diskutil info "$FILENAME" | grep "Volume Name" | cut -d ':' -f2 | tr -d ' ')
18         device=$(diskutil info "$FILENAME" | grep "Device Node" | cut -d ':' -f2 | tr -d ' ')
19         echo Now unmounting the device name [$device] the uuid [$uuid];
20         diskutil unmount "$FILENAME"
21     fi
22 done

 方案二

  编辑/etc/fstab文件

    sudo vim /etc/fstab

    UUID=C627AE3A-AC93-4258-87E2-17DAB9579F6A none ntfs ro,auto,nobrowse

    LABEL=Windows_NTFS_A none ntfs rw,auto,nobrowse

    LABEL=Windows_NTFS_B none ntfs rw,auto,nobrowse

    LABEL=Windows_NTFS_C none ntfs rw,auto,nobrowse

转载于:https://www.cnblogs.com/linxmouse/p/9184220.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值