用 diskutil eject 安全弹出 Mac 上的磁盘

diskutil eject 会刷新缓存并卸载磁盘,等同于访达里的“推出”,终端即可完成。

macOS卷磁盘diskutil 磁盘工具中风险
运行 `diskutil eject /Volumes/MyUSB`(或 /dev/diskN 设备名)即可卸载并断开该磁盘。

01命令

命令
$ diskutil eject /Volumes/MyUSB

02作用说明

推出操作会卸载磁盘上的所有卷并让硬盘盒断电停转,之后拔线才是安全的。diskutil 支持挂载点或设备名两种写法;用 `diskutil list` 查到的设备标识可以一次性推出整块盘。如果弹出失败,说明还有程序占用文件——`lsof +D /Volumes/MyUSB` 能找出是谁,访达报错常常只是聚焦索引或预览窗口在作怪。重新插入或运行 `diskutil mountDisk` 即可重新挂载。

03风险

风险中风险
使用条件Closing apps using the volume, or `lsof +D /Volumes/MyUSB` to find them, fixes 'eject failed' errors.

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

最后验证: 2026-09-18 · 分类: 系统与设置

06相关方案