
我正在使用MacOS Mojave 10.14.3
,並且我想實現與此類似的目標。
在Ubuntu
我的配置中,能夠使用其 UUID 將外部磁碟安裝到相同資料夾。在此範例中,它將安裝到/media/external1/
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=9e474079-5228-40c4-8bb2-36218c11c467 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=1C5A-B867 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
UUID=5C2A-23AD /media/external1/ exfat nofail,auto,noatime,rw,user 0 0
path/folder
這允許我在打開電腦或連接磁碟時安裝外部磁碟(僅當已連接時)
有沒有辦法在 MacOS 10.14.3 中實現此目的?
答案1
您可以fstab
在 macOS 上使用,就像在 Linux 上一樣。man fstab
在終端機中查看特定於 macOS 的文檔,特別是有效的文件類型和選項。您可以使用 取得 UUID diskutil info /dev/diskX
,其中 X 對應於裝置編號(請參閱diskutil list
)。用於sudo vifs
安全地編輯/創建/etc/fstab
.