windows mtp_您是否需要“弹出”连接到Windows的MTP设备?

windows mtp

windows mtp

can-you-simply-pull the-usb-plug-on-mtp-devices-connected-to-windows-00

We all know that there is a right way and a wrong way to detach USB mass storage devices from our computers, but does the same principle apply to MTP devices? Today’s SuperUser Q&A post has the answer to a curious reader’s question.

众所周知,将USB大容量存储设备从计算机上拆下来是正确的方法,但是对MTP设备是否适用相同的原理? 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader RockPaperLizard wants to know if you can simply pull the USB plug on MTP devices connected to Windows:

超级用户阅读器RockPaperLizard想知道您是否可以简单地拔出连接到Windows的MTP设备上的USB插头:

I know that after attaching a typical USB mass storage device to Windows, it is important to properly unmount the device before unplugging it in order to avoid the possibility of losing data. But for MTP devices (such as many Android devices) connected to a Windows computer via USB, is it necessary to perform any special or particular procedure before disconnecting the USB cable?

我知道,在将典型的USB大容量存储设备连接到Windows之后,重要的是在拔出设备之前正确卸载该设备,以避免丢失数据的可能性。 但是对于通过USB连接到Windows计算机的MTP设备(例如许多Android设备),是否需要在断开USB电缆连接之前执行任何特殊的步骤?

I am interested in understanding this for all versions of Windows (XP and later), so please include the applicable Windows version(s) in your answer.

我有兴趣了解所有Windows版本(XP和更高版本)的知识,因此请在答案中包括适用的Windows版本。

Can you simply pull the USB plug on MTP devices connected to Windows?

您能否简单地将USB插头拔出连接到Windows的MTP设备?

答案 (The Answer)

SuperUser contributor Carrein has the answer for us:

超级用户贡献者Carrein为我们提供了答案:

When plugging in USB mass storage devices, it gives a host computer undifferentiated access to the mass storage. It assumes absolute control over the file system similar to that of a hard drive.

插入USB大容量存储设备时,它使主机可以无差别地访问大容量存储。 它假定对文件系统的绝对控制类似于硬盘驱动器。

As such, unless explicitly commanded by the host system to sever the connection between the devices, there is a chance that the host computer might corrupt the file system. Hence, the “Safely Remove Hardware and Eject Media” message.

这样,除非主机系统明确命令切断设备之间的连接,否则主机可能会损坏文件系统。 因此,出现“安全删除硬件并弹出媒体”消息。

However, MTP, or Media Transfer Protocol, operates at the file level rather than as a large unit of mass storage at the block level. When plugging in a device such as an MTP device, the host system queries the files on the device.

但是,MTP或媒体传输协议在文件级别运行,而不是在块级别作为大容量海量存储单元运行。 当插入诸如MTP设备之类的设备时,主机系统会查询该设备上的文件。

This is often maintained as a database or index in the root file system of the MTP device. The MTP device’s system does not have to rescan the entire device when its content is modified; it only needs to update the database/index.

通常将其作为数据库或索引维护在MTP设备的根文件系统中。 修改其内容后,MTP设备的系统不必重新扫描整个设备。 它只需要更新数据库/索引。

The host system can then send a message to the device requesting that a file be downloaded, which will be sent by the device after acknowledging the signal. Deleting files works much the same way. The host system sends a message to the device, marking a file for deletion, then the device removes the file upon acknowledging the signal.

然后,主机系统可以向设备发送一条消息,请求下载文件,该消息将在确认信号后由设备发送。 删除文件的方法几乎相同。 主机系统向设备发送一条消息,标记要删除的文件,然后设备在确认信号后将其删除。

This works much like a transactional file system, where either the file is modified or it is not. The storage will not be affected by a failed transfer. This is also the reason why MTP only allows one file transfer at a time (atomic file transfer), so that corruption cannot occur as operations are run sequentially.

这非常类似于事务性文件系统,在该系统中,文件被修改或未被修改。 传输失败不会影响存储。 这也是MTP一次仅允许一个文件传输(原子文件传输)的原因,因为按顺序运行操作不会发生损坏。

So yes, you can just pull the USB plug on your device.

因此,是的,您只需拔下设备上的USB插头即可。

Further Reading: Media Transfer Protocol [Wikipedia]

相关阅读: 媒体传输协议 [Wikipedia]



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

Image Credit: Jeremy Keith (Flickr)

图片提供: Jeremy Keith(Flickr)

翻译自: https://www.howtogeek.com/275622/do-you-need-to-eject-mtp-devices-connected-to-windows/

windows mtp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值