Как мне перечислить несинхронизированные файлы на съемном носителе?

262
Don Question
  1. Как мне перечислить все несинхронизированные / неписанные файлы на USB-карте / SD-карте или другом съемном носителе?

  2. Могу ли я быть уверен, что все файлы синхронизируются после запуска sync?

2

1 ответ на вопрос

1
Steven
  1. How do I list all unsynced/unwritten files on a usb-stick/sd-card or other removable-media?

Use lsof to list open files then use grep to filter the results to your mountpoint.

  1. Can I be certain all files are synced after I run sync?

If sync returns successfully then at that moment all files are synced. An unmount (or "eject" in the GUI) calls sync in the background before actually unmounting.