首页  :: 新随笔  :: 管理

rm -fr /dev/*处理

Posted on 2021-12-24 00:27  高&玉  阅读(557)  评论(1编辑  收藏  举报

问题背景

        开发人员在CentOS操作系统上误操作执行了rm -fr /dev/*,导致新窗口无法连接此系统,当前窗口连接不受影响,通过reboot重启操作系统问题得到解决。

        /dev/的文件系统格式是devtmpfs,devtmpfs文件系统的功用是在Linux核心启动初期建立一个初步的/dev目录,大小一般是系统内存的一半,使一般启动程序不用等待udev,缩短GNU/Linux的开机时间。可以这么说系统下次重启后还会在/dev/目录下创建相应的文件。

处理过程

查看操作系统

[root]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 

 

查看/dev信息

[root]# df -h
Filesystem     1K-blocks  Used Available Use% Mounted on
devtmpfs         3978064     0   3978064   0% /dev

/dev目录的文件系统格式devtmpfs,devtmpfs文件系统的功用是在Linux核心启动初期建立一个初步的/dev目录,大小一般是系统内存的一半,使一般启动程序不用等待udev,缩短GNU/Linux的开机时间。可以这么说系统下次重启后还会在/dev/目录下创建相应的文件。

 

重启操作系统

[root]# reboot
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such file or directory (polkit-error-quark, 0)

Connection closed by foreign host.

Disconnected from remote host(host-81) at 09:38:04.

Type `help' to learn how to use Xshell prompt

 

等操作系统重启成功后,系统恢复正常,测试新窗口可以正常连接。