用 diskutil mount 挂载或卸载磁盘卷

外置硬盘的卷没挂载上?用 diskutil 的 mount/unmount 重新挂载,或在不弹出的情况下卸载。

macOS文件磁盘diskutil 磁盘工具中风险
运行 diskutil mount /Volumes/MyUSB 重新挂载该卷,或运行 diskutil unmount /Volumes/MyUSB 在硬盘保持通电的情况下卸载它。

01命令

命令
$ diskutil mount /Volumes/MyUSB

02作用说明

与 diskutil eject 会断电并移除整个设备不同,unmount 只把卷从文件系统中分离,磁盘本身仍保持通电。因此卸载“时间机器”分区而保留同一硬盘上其他分区时,或者需要用脚本安全访问硬盘时,它是更合适的工具。当卷因不安全拔出而无法挂载时,对它的 /Volumes 路径执行 diskutil mount 通常无需重启即可重新挂载。

03风险

风险中风险
!注意: 卸载不等于安全拔出——必须等 unmount 或 eject 完成后再拔线,否则可能损坏仍在写入的文件。

04撤销

撤销
$ diskutil unmount /Volumes/MyUSB

05来源

  • DISKUTIL(8) - macOS manual page
    Apple (Xcode man pages mirror) · vendor-doc · 2026-09-17
    依据: The manual page documents 'diskutil mount' and 'diskutil unmount' as mounting and unmounting a single volume.
  • diskutil - Modify, verify and repair local disks
    SS64 · technical · 2026-09-17
    依据: Lists diskutil's mount and unmount verbs, including 'diskutil unmount /Volumes/MyUSB' as an example, for attaching and detaching volumes without ejecting them.

最后验证: 2026-09-19 · 分类: 文件与文件夹

06相关方案