If you are using systemd then use udisksctl utility with power-off option:

power-off

Arranges for the drive to be safely removed and powered off. On the OS side this includes ensuring that no process is using the drive, then requesting that in-flight buffers and caches are committed to stable storage.

I would recommend first to unmount all filesystems on that usb. This can be done also with udisksctl, so steps would be:

udisksctl unmount -b /dev/sda1
udisksctl power-off -b /dev/sda
分类: Linux

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据