In linux sometimes we face the issue of enabling swap space
The most easy way to troubleshoot is to rewrite the contents of etc/hosts in single user mode
For example: The contents of etc/hosts file is somewhat like this.
vim /etc/hosts
#please do not remove the following thing or required line
#that required network functionality will fail
127.0.0.1 localhost.localdomain localhost
:wq
The simple way to trobleshoot is just rewrite the whole contents including the commented line as it is and the problem of enabling swap space would be solved.
Note: *There should not be any mistake while rewriting otherwise it would not work. If you forgot the contents see the etc/hosts file of other linux system. The default contents of file remains same in all linux with similar versions.
For Example: If you are performing in Redhat linux system then see /etc/hosts file of other system of redhat linux.
The most easy way to troubleshoot is to rewrite the contents of etc/hosts in single user mode
For example: The contents of etc/hosts file is somewhat like this.
vim /etc/hosts
#please do not remove the following thing or required line
#that required network functionality will fail
127.0.0.1 localhost.localdomain localhost
:wq
The simple way to trobleshoot is just rewrite the whole contents including the commented line as it is and the problem of enabling swap space would be solved.
Note: *There should not be any mistake while rewriting otherwise it would not work. If you forgot the contents see the etc/hosts file of other linux system. The default contents of file remains same in all linux with similar versions.
For Example: If you are performing in Redhat linux system then see /etc/hosts file of other system of redhat linux.