Watching the file-system

Note: This note was originally in the Raspberry Pi, overlayfs read-write root, read-only NFS base post.

NFS logging appeared to be quite opaque to me, so it proved useful to be able to observe the relevant file-system activity.

We can watch the file-system activity (when the Pi boots) on the NFS Server to check whether writes occur (and it can be generally useful), eg:

sudo inotifywait -mr /nfs/client1

With output like:

/nfs/client1/usr/lib/bluetooth/ ACCESS bluetoothd
/nfs/client1/usr/lib/bluetooth/ CLOSE_NOWRITE,CLOSE bluetoothd
/nfs/client1/lib/systemd/ ACCESS systemd-hostnamed
/nfs/client1/lib/systemd/ CLOSE_NOWRITE,CLOSE systemd-hostnamed