安全移除闪存驱动器 - git bash - Windows 7 x 64

Safely remove flash drive - git bash - Windows 7 x 64

我正在尝试弹出 USB 闪存驱动器,但我找不到通过 git bash 执行此操作的方法。当然我可以用传统的方式来做,但我想知道是否有通过 git bash 的选项。谢谢

如果您 运行 git bash 作为管理员,您可以这样卸载标有 E: 的驱动器:

cmd.exe /C 'mountvol  E:\ /P'

但请小心使用。使用

仔细检查您的卷标
cmd.exe /C 'mountvol' 

之前并确保您没有碰到任何不应删除的分区。

以下是微软的一些评论:

  • /p : Removes the volume mount point from the specified directory, dismounts the basic volume, and takes the basic volume offline, making it unmountable. If other processes are using the volume, mountvol closes any open handles before dismounting the volume.
  • Volumes that are dismounted by using /p are listed in the volumes list as "NOT MOUNTED UNTIL A VOLUME MOUNT POINT IS CREATED." If the volume has more than one mount point, use /d to remove the additional mount points before using /p. You can make the basic volume mountable again by assigning a volume mount point.

检查这个:Mountvol man