LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   delete files in /dev/pts (https://www.linuxquestions.org/questions/aix-43/delete-files-in-dev-pts-4175587520/)

A_FanaT_A 08-20-2016 02:12 PM

delete files in /dev/pts
 
Hi

I delete all files in directory /dev/pts

and now i not connected to server from SSH.

How can I fix this problem?

jpollard 08-20-2016 07:47 PM

They have to be recreated.

It has been a very long time since I worked with AIX, their MAY be a "MAKEDEV" script in the /dev directory. You will have to look up whether there is, and how to use it (if it exists).

It may be in lowercase - "makedev"

Otherwise you will have to look up the major/minor numbers and use mknod...

BTW, the "pts" devices are used for any networked terminal, and anywhere a terminal interface is simulated.

NevemTeve 08-22-2016 03:20 AM

Use command seq to generate these devices:

Code:

$ ls -l /dev/pts | sort -n -k10
crw-rw-rw- 1 root    system 25,  1 Oct  1  2012 1
crw-rw-rw- 1 root    system 25,  2 Oct  1  2012 2
...
crw-rw-rw- 1 root    system 25, 254 Oct  1  2012 254
crw-rw-rw- 1 root    system 25, 255 Oct  1  2012 255

Sg like this:
Code:

for i in $(seq 1 255); do mknod -m 0666 /dev/pts/$i c 25 $i; done

pan64 08-22-2016 03:31 AM

if you deleted something else too (under /dev), probably a reboot would be better

Yordan 08-25-2016 05:57 AM

By the way, why did you remove the /dev/pts devices?


All times are GMT -5. The time now is 03:57 PM.