2

When forcefully removing a USB device on linux while there are outstanding writes to the device the kernel log fills up with

blk_update_request: I/O error, dev sdg, sector 50618368
Buffer I/O error on dev sdg, logical block 6327555, lost async page write
[...]

messages and USB device resets:

usb 4-2: reset SuperSpeed USB device number 2 using xhci_hcd

I assume async page write refers to dirty pages in the buffer cache (write-back caching). It appears as if the kernel tries again for each dirty page, which takes a long time. All processes using the device hang.

Is there any way to tell the kernel, the block device /dev/sdg is gone and is not going to come back - please drop all dirty pages for this block device?

Note: This would probably apply to any type of block device as well.

  • 2
    How is the media being initially mounted. What file system type? – Raman Sailopal Sep 28 '17 at 12:16
  • It's not mounted at all. Just writing random data to the device via dd directly. – georg Sep 29 '17 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.