Skip to main content

您是否需要“彈出”連接到Windows的MTP設備?

您是否需要“彈出”連接到Windows的MTP設備?

Geoffrey Carr

我們都知道將USB大容量存儲設備與我們的計算機分離是正確的方法和錯誤的方法,但是同樣的原則是否也適用於MTP設備?今天的超級用戶問答帖子有一個好奇的讀者問題的答案。

今天的問答環節由SuperUser提供,這是Stack Exchange的一個細分,Stack Exchange是一個社區驅動的問答網站分組。

問題

超級用戶閱讀器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?

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的MTP設備上的USB插頭嗎?

答案

超級用戶貢獻者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.

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.

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.

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.

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

Further Reading: Media Transfer Protocol [Wikipedia]


有什麼要補充說明嗎?在評論中發聲。想要從其他精通技術的Stack Exchange用戶那裡閱讀更多答案嗎?在這裡查看完整的討論主題。

圖片來源:Jeremy Keith(Flickr)

Link
Plus
Send
Send
Pin