1

Just wondering how is /dev/null created on my archlinux box.

I investigated udev rules under /usr/lib/udev/rules.d, but there are no rules relating to to name null.

> ag null /usr/lib/udev/rules.d/*

and /etc/udev/rules.d is empty. So I run:

> udevadm test /class/mem/null
...rules ignored.
11859 strings (99853 bytes), 9914 de-duplicated (79634 bytes), 1946 trie nodes used
handling device node '/dev/null', devnum=c1:3, mode=0666, uid=0, gid=0
preserve permissions /dev/null, 020666, uid=0, gid=0
preserve already existing symlink '/dev/char/1:3' to '../null'
ACTION=add
DEVMODE=0666
DEVNAME=/dev/null
DEVPATH=/devices/virtual/mem/null
MAJOR=1
MINOR=3
SUBSYSTEM=mem
USEC_INITIALIZED=3266478398

There seems to be a rule matching null?

And with systemd, there is something called systemd-tmpfiles-setup-dev.service. But I still cannot figure out if it created /dev/null and how?

> systemctl list-units | grep tmpfiles-setup-dev
systemd-tmpfiles-setup-dev.service                                                          loaded active exited    Create Static Device Nodes in /dev
  • According to this, /dev/null needs to be prsent when udev is launched so it can't be created by udev itself. – terdon Jan 30 '16 at 12:46
1

/dev/null is created by the kernel at boot time, because the kernel requires it. It's not udev specific.

  • Is it created by the kernel? I would have assumed it was put there at install-time. – Jeff Schaller Jan 30 '16 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.