How to show chattr changes on diff?

Hello, I am using OpenSUSE Leap 15.6, I have just changed the initrd file to be immutable. When I check my snapper snapshots to see if these changes are reflected, I only get this:


# diff /.snapshots/1329/snapshot/boot/initrd-6.4.0-150600.21-default /.snapshots/1330/snapshot/boot/initrd-6.4.0-150600.21-default
Binary files /.snapshots/1329/snapshot/boot/initrd-6.4.0-150600.21-default and /.snapshots/1330/snapshot/boot/initrd-6.4.0-150600.21-default differ

I have tried -y, -a, –normal, -n but still not getting to see the changes I made on the diff command.

What is a way that I can show all changes in detail?

Thanks in advance.

ChatGPT 5o says:

initrd is a compressed cpio archive, so diff only tells you the blobs differ. To see what actually changed, extract both images and diff the unpacked trees. For example:

mkdir /tmp/init-1329 /tmp/init-1330
cd /tmp/init-1329 && zcat /.snapshots/1329/snapshot/boot/initrd-* | cpio -idmv
cd /tmp/init-1330 && zcat /.snapshots/1330/snapshot/boot/initrd-* | cpio -idmv
diff -ruN /tmp/init-1329 /tmp/init-1330

(or use lsinitrd on each and diff the output). That will show the exact file-level differences inside the initramfs.

And diff will only show a difference of file contents, not a difference of file attributes.

Thank you!

Noted! Thank you, this is a very important concept.