Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Deleted /dev partition linux  (Read 2466 times)

0 Members and 1 Guest are viewing this topic.

Haripriya H

  • Guest
Deleted /dev partition linux
« on: November 19, 2013, 10:46:36 pm »
Hello,

If you have accidentally deleted /dev partition then you will face issues in ssh for sure, so you may try the following fixes via console so that ssh may start.

Try restarting sshd

--> /etc/init.d/sshd restart

if you receive the following output :

/dev/null no such file or directory
then

--> cd /dev

--> ls -al null

O/P

ls: cannot access null: No such file or directory

Then you need to create one.

--> mknod /dev/null c 1 3
--> chmod 666 /dev/null
--> /etc/init.d/sshd restart


O/P

PRNG is not seeded

Means your urandom file not present now, you need to create it

--> ls -al /dev/urandom
--> ls: cannot access /dev/urandom: No such file or directory
--> mknod /dev/urandom c 1 9


Now restart sshd.

--> /etc/init.d/sshd restart

O/p

Stopping sshd:               [  OK  ]
Starting sshd:               [  OK  ]

Cool, your sshd is now restarted, however when you login via ssh you may receive the following error and cannot access the server’s commandline :

login as: root
root@xx.xx.xx.xx's password:
Server refused to allocate pty

So, now you need to create pty and tty by the following command.

--> /sbin/MAKEDEV pty
--> /sbin/MAKEDEV tty


Now you will be able to access server via ssh.