Rebuild accidentally deleted /dev

10,069

Solution 1

I believe the contents of /dev are automatically rebuilt when you reboot.

To quote someone else:

When you start the system, the "udev" facility examines the hardware configuration (according to established rules) and dynamically creates the entries in /dev.

Solution 2

When rebooting is NOT an option (you are working remotely on a machine in usa and you are on safari) this should do the trick:

udevadm control --reload-rules
udevadm trigger
Share:
10,069

Related videos on Youtube

Philippe Blayo
Author by

Philippe Blayo

One of the best experience in my life has been to enjoy pair programming with developers that value clean code and simple design. It's called eXtreme Programming and I hope one day I'll have the opportunity to do it again.

Updated on September 17, 2022

Comments

  • Philippe Blayo
    Philippe Blayo over 1 year

    How to rebuild /dev/ on an Ubuntu lucid where everything in /dev/ were accidentally deleted?

    MAKEDEV std and MAKEDEV pty aren't enough, which isn't surprising on a system using udev.

    I haven't rebooted yet because I fear I would lose access to my system.

  • AtomHeartFather
    AtomHeartFather over 2 years
    +1, because rebooting is for adding new hardware
  • Nuclear
    Nuclear about 2 years
    Does not work - creates only directories block char disk dri, but not all files that were there