Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2115  / 2 Years ago, mon, april 11, 2022, 7:34:29

Well, I seem to be a hard drive killer. Several months ago, I had a laptop with harddrive problems, which required me to replace the disk.



Now, I have a separate laptop, which I has a bunch of bad sectors (I don't know how long they've been bad, but I accidentally dropped the computer a few day ago), resulting in a bunch of bad blocks. I've managed to remap these bad blocks using e2fsck -y -c -f /dev/sda5, but for some reason I can't get TTY working again.



Whenever I enter any of the TTY screens, I am greeted with a blinking cursor, which resembles a white underscrore. From there, the computer completely ignores anything I try to type. TTY doesn't even so much as ask me to enter my username/password (If I try to enter my password anyway, I will again be ignored). All I can do is switch back to my desktop using CTRL+ALT+F7.



Since TTY is part of the GNU Core Utilities, I decided to try running repair coreutils ("repair" is a bash alias, which in turn runs sudo apt-get -y --force-yes --reinstall install), but that didn't help at all. I've also tried sudo dpkg-reconfigure coreutils, and again... no dice. The only thing I haven't tried yet is removing coreutils altogether, running 'apt-get autoremove --purge', and reinstalling coreutils from scratch (I'm too scared to even so much as try something like this, unless necessary!).



I'm currently running the Cinnamon desktop (lightdm login), on Ubuntu 13.10 i386 Desktop editon. Also, if I run sudo -i login from gnome-terminal, it pretty much works as expected.



PS: I don't want to buy yet another hard drive, as I'm only working part time, and could use the money for other things.



Update:I think the problem might lie with getty (or agetty), as everytime I run 'getty 0', I get a segmentation fault error. Does anyone know how to reinstall getty? sudo apt-get install getty doesn't seem to work (E: Unable to locate package getty), likewise for agetty.


More From » tty

 Answers
3

One way to check if getty has been corrupted (of which we are already pretty sure) is to check it's md5sum against the md5sum of an uncorrupted getty. For this we need live media.



Boot a liveCD (or DVD, USB, SD, or whatever). Click "Try Ubuntu". Once the desktop loads you will need to mount the hard drive partition that has Ubuntu on it (you should be able to do this from Nautilus, just click on the drive name/size and it'll automount).



Once you have your Ubuntu partition mounted you'll need to find out where it was mounted. Mine was mounted under /media/ubuntu/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. Once that's accomplished, open a terminal and navigate to /sbin:



cd /sbin  


This is where the getty executable resides. Now run:



md5sum getty  


You should get a 32 character string of alpha-numeric characters followed by the word "getty". This is the md5sum of the LiveCD's getty. Now move to your ubuntu installation's /sbin folder:



cd /media/ubuntu/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/sbin  


Replacing /media/ubuntu/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX with the location that your Ubuntu partition is mounted at (it should be similar). Now run



md5sum getty 


Again. The output this time is for the getty on your system. If the md5sums don't match then one of the gettys is corrupted.



enter image description here



If the md5sums don't match, let's replace the getty on your system with the getty on the liveCD:



cp /sbin/getty /media/ubuntu/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/sbin


Restart your system and try the ttys again. Of course, there could be more corrupted than just the getty executable so this might not completely solve the problem.



For reference the md5sum of my getty is



ef47463b761005305c9cb42a38183095


And remember, it's always best to sleep the laptop before moving it around.


[#27431] Tuesday, April 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jectedrin

Total Points: 491
Total Questions: 105
Total Answers: 111

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;