lioryb
Posts: 11
Joined: Thu Jul 12, 2018 11:02 am

Files access on raspbian

Wed Nov 20, 2019 8:53 am

Hi.
I am trying to understand which processes are accessing files in my filysystem and which files are accessed.
I added a print each time the SD card is being accessed, but I can figure out who's accessing and what, as the final access is done by the 'kworker' process, so using stack-calls won't help.
I noticed that in the first 60~75 seconds after boot, at least 2 access are done both to EXT partitions (i.e rootfs) and to FAT(i.e boot) partitions (I know that at least one of them is to the superblock , as I can know the block id).
How can I find which files are accessed and by which process/app? I want to minimize the SD accesses, without making these partitions READ ONLY.

Thanks.

User avatar
topguy
Posts: 5942
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Files access on raspbian

Wed Nov 20, 2019 3:06 pm

I added a print each time the SD card is being accessed
How/Where did you do this ? And whe you say "accessed" do you mean both "read" and "write" ?
How can I find which files are accessed and by which process/app?
Have you checked out "lsof" command ?

https://unix.stackexchange.com/question ... ing-a-file

lioryb
Posts: 11
Joined: Thu Jul 12, 2018 11:02 am

Re: Files access on raspbian

Wed Nov 20, 2019 6:41 pm

Thanks for your reply.

Indeed, I tried to use lsof, but I get no indication of write commands.
Yes, I forgot to mention, that I am looking for write commands (I don't care about read access).
What else but lsof can help me?

lioryb
Posts: 11
Joined: Thu Jul 12, 2018 11:02 am

Re: Files access on raspbian

Thu Nov 21, 2019 12:32 pm

After removing FSCK from these partitions, I get a write access to the boot partition's superblock, without any other access to any file.
(same issue with rootfs partition... someone tries to write teh superblock)
How can I find which app/process tries to write the superblock?

Return to “Raspbian”