pythonusbusb-flash-drive

Why does writing to USB flash drive from memory indicate HDD usage?


I have a Python script that serializes a sizable data structure to JSON and then persists it to a USB flash drive.For some reason when I do the actual writing, I notice increasing activity on my internal HDD. The activity is clearly visible because the process takes some time.

Is this a coincidence or writing to USB actually saves the data on the HDD first and then copies?

This is probably unnecessary, but the code i use is:

import json
json.dump(huge_object, open(r'd:\struct.json', 'w'))

Solution

  • See Write Cache Buffer Flushing setting for your drive. https://social.technet.microsoft.com/Forums/windows/en-US/282ea0fc-fba7-4474-83d5-f9bbce0e52ea/major-disk-speed-improvement-disable-write-cache-buffer-flushing?forum=w7itproperf