Saturday, 18 July 2015

how to recover linux system after /etc file got curruped

writer - anuj borah


recently my Ubuntu system got crashed it was not booting . my this post will show you how to recover your Linux system after a file in /etc got damaged or mis configured.

how to recover linux installed system after /etc/fstab ,  /etc/nsswitch.conf  etc any file in /etc got damaged or mis configured .

you will be needing a boot able usb which can format your system  but here format is not a option . as a lots of stuff are there in download folder and a lots  of software are installed in your server . so format is not a option .

now i have faced the situation where i have my pc got /etc/nsswitch.conf got mis  configured as i was doing an experiment on ldap server . after shutdown it was not booting once again . i dont have a bootable ubuntu usb and i dont have any iso file through i can make bootable ubuntu usb .

i just turn on the power button of my pc , boot loader loaded , go for advance option , go for the recovery mode . you will get a shell . try to replace the /etc/nsswitch.conf  file but it show read only  file system cant change . here u can just mount the drives and make a boot able  usb copy of ubuntu .

now boot your pc with boot able usb . you will go for try ubuntu option . then

sudo su
fdisk -l

you will get the drive where the previous corrupted ubuntu was installed .
 mount it to any folder say it is /media/anuj


chroot /media/anuj

go for the /etc and repace nsswitch.conf file with old backed up file . dats it .

see my bellow pic how was it my pc ..


Popular Posts