... read-only files can absolutely become fragmented. A defrag program has the rights to move those files, and so do other system utilities. What they can not do is change the file's content. 'Read-only' means 'do not change the content of this file.' It does not mean 'Do not move'. It is somewhat misleading. A read-only file might be moved if you change the directory structure, for example, if the file handler deems it would be more efficiently placed elsewhere on the disk.
Not that I want to get involved in this quagmire (stop smirking Jip, you know how I like to poke the Libs), but an easy/prime example of what Jip said is;
mysystem # mv /boot/vmlinuz /mnt/sda5/opt
As Jip says, when a file is read-only or a "system" file it is in relation to changing the data of the file, and has nothing to do with excercising commands on the file (moving it, renaming it (which is really no different than moving it), compressing it, decompressing it...the list goes on) and its location on the platter/drive. Just reading/accessing a file can change its characteristics which could affect its size/placement.
Jip should have brought some more of his Linux experience into this...
Next, as another "easy" example, I can demonstrate "true" idling of a partition where absolutely NO defragmentation will occur. Give me two seconds and I'll type;
mysystem # umount /dev/sda2
Now this little demonstration has two purposes. One, this partition is a part of a hard drive where the platter is still spinning, so it is active, but it is not changing in any fashion on a system-level. The drive is incapable of fragmenting because the OS is no longer interacting with it. Therefore, I have provided an example where a drive is idling and not fragmenting. Your criteria never mentioned that the OS had to be able to interact with the drive, simply that the system sit idle;
...allow that system to sit IDLE for a day or 2
I can remount the drive, and the drive will be in the same state as it was previously. I could run my system indefinitely with the partition unmounted and have the same result.
heh, I'm chuckling because there is more...
Second, I forgot to mention that the /dev/sda2 drive was an NTFS filesystem (redundant, I know), and being the dumb bunny that I am, I didn't build NTFS write abilities into my kernel (its flakey anyway). But anywho, this particular partition contains about 30GB of MP3s, OGGs, AVIs, MPEG-4s and God knows what else I've spirited away there...all I know is that after I remount it, all day and all night for 4 months solid I play a random rotation of a bunch of these files running in the background. Sometimes I pick up my headphones and listen, mostly I don't. Guess what? My filesystem (and that is really what we are talking about here) doesn't get fragmented. The reason is simple, the files are truely immutable in the present environment. This just gets back to the misunderstanding about what is an unchangable file (what is bandied about as "system files" and "read only files") and what's not changable by the user OR by the OS *at that time*.
Finally, one last tidbit. I can build my system and then take away its swap/paging filesystem. In an OS like Linux, which has decent memory utilization, I can play music or movies for years at a time and not see a performance hit. Hell, I'd get scared if I saw my swap get pinged now as it is. I don't think it uses the swap even when I'm folding...
Oh well, I think this was all a miscommunication. Somebody probably didn't understand the difference between an OS and hardware is my guess /sarcasm. An OS is like my wife at dinner, even though her plate is full of food, she'll still reach over and try to get a bite of my dinner...Winblows likes to "touch" (not in the *nix sense) files just to make sure they are still there...at least that's how I like to think of it, YMMV.
To answer your question (original), my supposition is that the OS "checks" (for lack of a better term) the existance and state of files. This might be for recovery purposes, maybe for sanity checks, maybe to see if another filesystem changed the data, or maybe just to (re)verify tables. If the OS is running, there are probably processes running in the background, and if there are processes running, then the state of the OS is dynamic (meaning its changing) and as such it probably does housekeeping chores to make sure that its memory, tables and I/O are all aware of where the data starts and stops (which is what's really important or you'll get your chocolate in my peanut-butter!)...
I had $0.02, so I thought I'd throw it in...
happy happy joy joy.