ubuntu、debian下eject与safeley remove drive、umount的区别

本文介绍了如何通过命令行安全地卸载并使外部硬盘停止旋转的方法,使用udisks工具可以轻松实现这一过程,无需sudo权限。同时,文章还解释了在Ubuntu中“弹出”、“安全移除”及“卸载”设备之间的区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原链: http://askubuntu.com/questions/86019/what-is-the-difference-between-eject-and-safely-remove-device

http://askubuntu.com/questions/56270/how-can-i-spin-down-external-hard-drive

You can safely unmount and spin-down an external hard disk from the terminal most easily by using the command-line functionality of udisks, which does not require the use of sudo if your system is set up correctly. (To list your device names, enter mount in the terminal first.)

When you have found your external drive, use the following commands. You must first unmount the partition (use sdb1 or whatever mount showed as the location):

udisks --unmount /dev/sdb1

Then to safely remove (i.e. spindown- you will hear it click and spin-down), use only sdb, for example:

udisks --detach /dev/sdb

NOTE: It is of crucial importance here that you use sdb or sdc without a partition number when using the detach option; i.e. sdb1 or sdc1 will not work. The partition must be unmounted first and then the disk itself spun down as the examples show.

The udisks commands work successfully for all my pata and sata external hard disks.

-----------------another answer---三者的区别--------------------------------------------------------------------

umount removes the device from the file system (mount point).

Eject and Safely remove both do basically the same thing on a flash drive.

sync the data , then un-mount (remove the drive from the file system).

In addition, eject would eject the media (think CD/DVD).

It is sort of a bug that both these options show with flash drives.

The expected behavior would be

Safely Remove - USB/Flash drive - sync data && unmount ; user then physically removes the drive

Eject - CDROM/DVD - unmount && eject physical media



总结:很多人都被这几个选项给困惑了,gnome的开发人员也给出了解释(参考链接1),算是一个bug,而且已经被提交了。

参考链接:https://bugzilla.gnome.org/show_bug.cgi?id=598690#c8====对bug的提交,回答较为官方且权威

http://thread.gmane.org/gmane.linux.usb.general/22706/focus=22748==好像是开发人员的回答,排版看不出来是什么论坛

http://git.gnome.org/browse/gvfs/commit/?id=6e70902ee77cb0bd6063bcf4d215b13a13bf5ee4===开发人员回答,且用源码解释

http://ubuntuforums.org/showthread.php?t=1301556====论坛的提问,很多人回答,可见很多人困惑。

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/453072=====对bug的提交,回答较为官方且权威

https://bugzilla.gnome.org/show_bug.cgi?id=598690====对bug的提交,回答较为官方且权威

https://bugs.freedesktop.org/show_bug.cgi?id=24343====bug提交,底层级别回答


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值