Permissions of /dev/null reset to crw-rw-r-- after every shutdown, impedes boot

The /dev tree is a virtual tree created by the kernel at boot time. It holds a virtual filesystem (devfs) providing access to various devices.

$ stat /dev
  File: /dev
  Size: 4360            Blocks: 0          IO Block: 4096   directory
Device: 0,5     Inode: 1           Links: 21
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-05-07 07:14:27.464101087 +0200
Modify: 2022-05-07 09:09:34.556484932 +0200
Change: 2022-05-07 09:09:34.556484932 +0200
 Birth: -
$ stat /dev/null
  File: /dev/null
  Size: 0               Blocks: 0          IO Block: 4096   character special file
Device: 0,5     Inode: 4           Links: 1     Device type: 1,3
Access: (0666/crw-rw-rw-)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-05-07 07:14:27.784101090 +0200
Modify: 2022-05-07 07:14:27.784101090 +0200
Change: 2022-05-07 07:14:27.784101090 +0200
 Birth: -

My guess is is you may have compiled your own kernel - fiddling with flags - perhaps you have a kernel argument modifying the behavior - perpahs a sysctl.d configuration - the possibilities are next to endless.

Suffice to say - the behavior is not default - it is a result of fiddling with system properties.

To find what is causing your issue you will have to backtrace your manual changes - validate the scripts you have run …

1 Like