開啟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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM