8

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.

3 Answers 3

9

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.

4

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
2
  • 1
    +1, because rebooting is for adding new hardware Jan 8, 2022 at 17:53
  • 2
    Does not work - creates only directories block char disk dri, but not all files that were there
    – Nuclear
    Feb 16, 2022 at 10:39
0

/dev is on a RAM disk so it gets destroyed and recreated on any reboot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .