Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5613  / 3 Years ago, tue, august 10, 2021, 3:59:44

I am getting really worried -- as i really need to recover my Ubuntu --, and have wasted so much time on trying to fix this.



Basically, I was just following a lab for my security class and encountered this problem.



OK so I followed these commands:



cd /bin
rm sh
ln -s /bin/zsh /bin/sh


Then when i opened a new terminal then it gave some sort of error. So, i thought this would go away after restarting my system.



But, to my misfortune my system could never load again.



First it opens the grub2 boot manager then when i hit enter on Ubuntu it loads into a black screen with blinking cursor at the top-left.



I have a lot of my work and all my programming environment for work and school in this system.


More From » grub2

 Answers
1

I don't think that that would cause you to be unable to boot but you could revert to your old sh by doing this since /bin/sh is just a symbolic link to /bin/dash anyway...



Boot until you get the blinking cursor then press Ctrl+Alt+F2 to get a terminal then do



cd /bin
sudo rm sh # if this fails then just go to next
sudo ln -s dash sh


Then you can reboot (sudo reboot)



Edit: For anyone in the future, if you can't access the shell prompt at boot by pressing Ctrl+Alt+F2, you can do one of the following:



Option 1: Boot a live cd and press try then open the terminal and do



sudo mount /dev/sda1 /mnt   #replace sda1 with whatever drive/partition your install is on
cd /mnt/bin
sudo rm sh #if this fails then just go to next
sudo ln -s dash sh


Option 2: Boot a live cd and press try then open the terminal there and do



sudo mount /dev/sda1 /mnt   #replace sda1 with whatever drive/partition your install is on
sudo chroot /mnt
cd /bin
rm sh # if this fails then just go to next
ln -s dash sh


Then you can reboot (sudo reboot)



That should revert to the default sh folder.



source: https://askubuntu.com/a/135219/333886


[#22958] Wednesday, August 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eeperant

Total Points: 39
Total Questions: 106
Total Answers: 117

Location: Finland
Member since Sat, Dec 5, 2020
3 Years ago
;