When I read articles on running Linux from a flash drive, many recommend that directories that see many or constant writes be mounted in ram (e.g. as tmpfs). My question is - Which directories will these typically be, and is there any way to monitor disk activity that would show which directories see many writes?

  • hmm... /var and /proc? Can't give you a list complete enough to qualify as an answer, but that's what seems logical at first glance. – rumtscho Mar 30 '10 at 21:05
  • Also, /tmp earns a few frequent flyer miles. – Paused until further notice. Mar 30 '10 at 21:36
  • 1
    The swap partitions – Nifle Mar 30 '10 at 21:38

/proc is generally a procfs system which doesn't live in disk. So I wouldn't worry about that.

The obvious one would be /tmp -- this is where any temporary files that get generated are going to be stored.

/var/run and /var/lock can be mounted as tmpfs since they do not need to persist over a reboot.

/var/log could be a possibility as well as long as you are OK not keeping logs over a system reboot.

| improve this answer | |

/var and /tmp are obvious candidates.

Ksfmd may be of help (I don't have direct experience with it, but it seems to have the potential to help you monitor your system to decide what gets mounted where).

You might be able to build a more exact match to what you want to do with the inotify toolkit.

| improve this answer | |

The new utility fatrace can show you exactly. See: https://launchpad.net/fatrace/

sudo fatrace

For example:

# sudo fatrace
chrome(6514): W /home/xxxx/.config/google-chrome/Default/Current Session
chrome(6514): R /home/xxxx/.pki/nssdb/cert9.db
chrome(6514): R /home/xxxx/.pki/nssdb/cert9.db
chrome(6514): W /home/xxxx/.cache/google-chrome/Default/Cache/data_1
chrome(6514): RW /home/xxxx/.cache/google-chrome/Default/Cache/data_0
chrome(6514): W /home/xxxx/.cache/google-chrome/Default/Cache/data_1
wicd(29613): RO /lib/x86_64-linux-gnu/ld-2.19.so
ifconfig(29613): R /lib/x86_64-linux-gnu/ld-2.19.so
ifconfig(29613): CO /etc/ld.so.cache
| improve this answer | |

Your Answer

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

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