I was wondering if there was a way to tell how many more "writes" are left on a file system device in linux? An example: when you move a lot of data to a flash drive, it may not write all data immediately. In this case, I would like to see (preferably) how much more is left to write, or even if it's a flag (such as 0 = writes complete or 1 = writes remain). Is there a particular command or file that holds that information?

link|improve this question
feedback

2 Answers

Might be useful the following utilities: lsof dstat. Finally, you can force pending writes to be flush to the HDD subsystem with sync CLI command.

link|improve this answer
I knew about the sync sync command, which is helpful but I want to be able to see when something needs to be "synced". Both lsof and dstat are helpful, but seem to be a little too broad (not specific enough) for what I'm looking for... – nuclearpenguin Dec 1 '11 at 15:56
feedback

You can find out how many kilobytes globally are waiting to be written, contained in "dirty" pages, however I don't know how to do this for individual devices.

grep Dirty /proc/meminfo

There are tunables in /proc/sys/vm and /sys/block/${dev_name} which can affect how rapidly dirty pages are written out; usually, they are modified by software like laptop-mode-tools.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.