PHP*_*ner 13 usb-drive usb hard-drive 14.04
我有一个 USB 供电的外部硬盘驱动器连接到我的戴尔笔记本电脑。有时,在侧栏中单击其图标弹出菜单中的“安全删除”项后,驱动器被卸载并从/dev/文件夹中删除(sdb并且sdb1两者都被删除)并且lsusb不显示设备,但硬盘驱动器仍然在旋转,我可以通过将手指放在上面来感觉到振动。但是有时在单击“安全删除”几秒钟后,它会停止旋转并且没有振动。有没有办法(可能是 CLI 命令)将其关闭?
小智 17
尝试这个:
udisksctl unmount -b /dev/sdXY
udisksctl power-off -b /dev/sdX
Run Code Online (Sandbox Code Playgroud)
在 Linux Mint 或 Ubuntu 上
kas*_*erd 14
hdparm -y /dev/sdb以 root 身份运行将导致磁盘停止旋转。如果有任何东西访问磁盘,它会再次旋转。
手册页建议这仅对 IDE 驱动器有用。但是,我已经测试过它确实可以与连接到运行 14.04 的戴尔的 USB 驱动器一起使用。手册页说该命令通常会导致驱动器减速,这表明存在一些在发出此命令时不会减速的驱动器。
如果你的桌面做了一些可疑的事情,你总是会退回到终端。
sudo umount /dev/sdXY
# (this will umount, it will complain on opened files, if so lsof and see which ones.)
sudo sync
# ( this flushes all buffers to disk. It will ensure that no data is lingering in ram.)
sudo eject /dev/sdX
# ( this works on dvd/cds and some, not all usb devices, it detaches the device from the port. Some devices "get smart" and try to reset and readd themselves to the disk, however all caches are clean and safe to unplug).
Run Code Online (Sandbox Code Playgroud)
另一方面,一旦设备未被识别为 USB 上的块设备,您就可以在该设备上使用sdparm或hdparm来停放磁头(如果需要),但是使用此类工具不会刷新缓冲区。如果您忘记设备正在睡眠并拔掉电源,则可能会损坏您的数据。
| 归档时间: |
|
| 查看次数: |
18213 次 |
| 最近记录: |