• 开启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

  • 相关阅读:
    vue 中简单路由的实现
    Vue中对生命周期的理解
    内存泄漏
    前端工程化
    exports 和 module.exports 的区别
    Nodejs的url模块方法
    MongoDB 的获取和安装
    Anjular JS 的一些运用
    移动端vconsole调试
    安装fiddler时,电脑浏览器没网
  • 原文地址:https://www.cnblogs.com/linxmouse/p/9184220.html
Copyright © 2020-2023  润新知