why does df spin up disks?
When I have a mounted filesystem why doesn't the kernel store the amount of free space? Why does it need to spin up a disk that had been spun down?
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 2 lines · Russell Coker
When I have a mounted filesystem why doesn't the kernel store the amount of free space? Why does it need to spin up a disk that had been spun down?
Most likely because the inode has been evicted due to memory pressure. I can df my mostly-idle backup disk "most" of the time without it spinning up once it has been mounted & gone to sleep (just did!), but if there's been significant memory movement (or issuing drop_caches) on the box it will spin up again sometimes. This is not unique to btrfs; other filesystems - at least ext4 - do this too, even though they might manage their expiry behaviour differently.
Now, whether the root inode and whatever is required for a df *should* ever expire after mounting or stay pinned, well..you'd have to ask the vfs folks.
-h