Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wonder if there is a program (e.g. in the shell) for collecting statistics regarding how often files are written to? Basically I would like to compile a list of the files most often modified on my computer during some period of time. I know one could in some way "manually" use the mtime of the files, but I'd prefer an already existing solution if such exists.
I'm intending to set up a Linux system run entirely from a USB flash memory and I would like to know which part of the file system to put on a jffs2 partition, i.e. the most frequently modified files, hence my question above.
If you would like a fine-grained view of that you would (AFAIK) have to intercept syscalls like write. Else maybe use some form of SAR or lsof (select by fd, write access). Guesstimating and depending on usage I'd say ordered top four: /var (logs), /tempdirs (obvious), /home and /etc (sporadically).
Thank you for your reply unSpawn. Unfortunately I cannot see exactly how to use these tool in order to accomplish what I intended in a straight forward way (tried atsar and lsof).
Thanks for your "guesstimations" regarding disk usage.
Atsar would be kind of coarse since it only measures writes per partition so you would have to have a per root dir partition setup. Not impossible but also not the easiest thing to wedge in later on ;-p Lsof only produces one time results so you would have to run a periodical script that parses lsof output, checks which files are open for writing and check process age wrt longevity. The script itself isn't that hard to produce, but I wonder if Real Life fine-grained results would matter wrt the guesstimate. If due to usage you can for instance predict a lot of short-lived temp-writing processes, putting tempdirs on a small tmpfs could be beneficial wrt speed and wear n tear.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.