LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I can only log in as guest. (https://www.linuxquestions.org/questions/linux-newbie-8/i-can-only-log-in-as-guest-919035/)

Kallaste 12-16-2011 06:37 AM

I can only log in as guest.
 
Hello,

I am having some trouble. When I turned on the computer yesterday, it found some sort of disk error that it prompted me to press "F" to fix. It did not say what the error was; just "Press 'F' to attempt to fix errors, 'S" to skip mounting . . ." etc. I pressed F, and then when the password prompt came up, only the guest account was there. I have never used a Linux guest account before in my life and have no idea how to do anything from there. It would not even let me log in as root.

I am guessing something happened with where my home folder is located (maybe it moved the pointer to it or something?), but I do not know how to go about fixing it. I ran fsck and found no errors.

This problem was preceeded by strange Firefox and VLC behavior I described in this thread here: http://www.linuxquestions.org/questi...96#post4551296

Help would be appreciated. Thanks!

selfprogrammed 12-16-2011 10:18 AM

got duplicated in edit

selfprogrammed 12-16-2011 10:23 AM

I cannot be familiar with all the possible boot programs, BIOS intercepts, or startup code.
That could be any of them, or it could be a boot sector virus.
The only legit program that I think it could be would be the boot automounter for ext2 that
complains if the disk was not unmounted cleanly at shutdown. It will attempt to fix
some errors in the disk info blocks, which are used to allocate disk space and hold directory information.

If the drive is going bad, then you need to backup everything in /home and /etc immediately.
And backup any other downloaded stuff in any added directories.
You can always reinstall the Linux from your distribution CDROM so you do not need to
backup that, but you need to backup the configure stuff in /etc, or you will end up redoing it.
Any mounting of it will allow automatic writes that can corrupt existing files.
You probably will have to rewrite the filesystem, which wipes all data from the partition.
If the problem occurs again, then the disk is going bad.
Check the S.M.A.R.T reports from the disk, and enable them if they are not enabled.

Stop using that machine and have it checked using a bootable CDROM copy of Linux.
Check it using fsck.ext2 (or whatever program for your filesystem), and try some other tests too. If the drive partitions read Ok, and the partition table seems Ok, then have LILO or GRUB, or whatever you use reinstall themselves which will reinstall the boot sectors.
There are data recovery programs that are useful too, search web for Linux disk data recovery, see Testdisk, Photorec.
You should run them from a CDROM or other good drive.

You could also run a low level disk checking progam on the drive. It can take hours (or days) for this to run. They can erase the drive, or restore each block as it is checked, so pay attention to which option you choose. Backup the drive first.

Check to see if your /etc/passwd, /etc/shadow files are accessible and not corrupt.
You can always make another copy of them and isolate the original, which would bypass
any disk formatting problem (at the risk of wiping out some other data somewhere).

There is a chance it may be a virus.
Do not run any programs off this disk yet, as that would reinstall any virus that it has.
It has been so long since I have gotten a virus, that I don't know the best tools now for
checking for them, and it would be nice to know if it was a virus so that you can avoid it again.

If you cannot figure it out, then reinstall Linux onto that drive, Erase the /bin, /sbin, /usr/bin, /usr/local/bin, /usr/games, and any
other directories that an infected executable could hide.
Then reinstall Linux, which should make the system usable again.
Check any new executables that you may have downloaded from anywhere.
At least isolate them from being run until you can be sure, or they could reinstall a virus again.
If it shows up again, then you did not get it the first time. Of course with a failing drive it will show up again too, so you need to pay attention to if it shows up after running any downloaded program.
They are finding more sneaky places to hide copies of a virus. Then you need to go to a virus forum.

Kallaste 12-17-2011 11:34 AM

Thanks for all the information. I'm sorry for my lag in response, but I have the flu. There is some more information I would like to provide about this issue in a day or so when I am better. Please do not mark this thread as solved yet.

Thanks again!

Kallaste 12-22-2011 11:39 AM

Okay, sorry it took so long. I also apologize in advance for the length of this post, but this has been a long issue which I have not succeeded in solving with incomplete renditions of events. I hope this does not belong in a new thread, since the situation has changed a bit, and I actually did another reinstall. I'm not sure. Oh well, if it does, please let me know.

I definitely have a problem, but I do not think it is a virus. I should have explained the situation better. Let me start from the beginning. When I posted last I was running Xubuntu 11.10, 34 bit. It was actually a very fresh installation, which is why I do not think it is a virus. The only things I downloaded were VLC, the nvidia drivers, and the updates. I did keep my home folder from the previous installation a week before, but my problems started before I started keeping my home folder, from very fresh installations.

This is what happened. I installed Xubuntu 11.10 almost a month ago after running Ubuntu 10.04 since it came out, almost without a single problem. The moment I installed Xubuntu, I started having problems with weird things. First I was unable to log in as root or paste text from my clipboard without weird gibberish code showing up in the pasted text. This problem was not spontaneous, but was preceded by me adding a .gtkrc-2.0 file to my home folder with a few lines of code in order to change the font size in Thunar. This was the only time I tried messing with the code. When things got weird, however, I removed the file, but it made no difference. Also, when I rebooted, I saw for the first time that error message I should have described better in my first post. It was on the Xubuntu splash screen right before the password prompt. It said:

Code:

keys:press F to fix errors, I to ignore, S to skip mounting and M for manual recovery
I found it odd that it had no space after the colon, but that's how it was. I searched online for a "keys:" error, but found no explanation. However, my system was brand new at this point (and I did verify the MD5 sum on the live CD), so it really should have been legitimate and not from a virus.

I did press F, but my system was still screwed up, so I backed up my home folder and reinstalled. I did not keep any hidden files--only my data.

This time, though, I wanted to be able to keep my home folder for any new installations, so I partitioned my drive to contain separate partitions for root, home, and swap. I mounted them as such during installation and put the boot loader in the MBR. I had never created my own partition scheme before, but I thought I had it right.

This installation worked for a few days, and then I had a Grub "out of disk" error, which I described here:

http://ubuntuforums.org/showthread.p...0#post11509530

To make a long story short (or at least shorter), I had to reinstall again, but this time I kept my home folder. I also added a boot partition, leaving the boot loader in the Master Boot Record. This is what my partitions look like now:

http://img851.imageshack.us/img851/9...ions122211.png

Again, things worked fine for a few days, but then I had the problem with VLC and Firefox not working, followed by my only being able to log in as guest. The day I created this thread (before I got the first reply) I became desperate to get in my home folder and reinstalled again. By this time, thought, I thought it might be possible Xubuntu 11.10 was just really, really "buggy," and so I used 11.04.

That worked for a couple of days, but I was pretty sure things would get awkward again and planned to follow up on this thread. Sure enough, upon booting up yesterday morning, I got the exact same error I got before:

Code:

keys:press F to fix errors, I to ignore, S to skip mounting and M for manual recovery
I did press F again because I wasn't going to be able to boot otherwise, and it booted up. I don't know how bad the damage was at that point because I only used the computer yesterday for watching movies (I was still sick and did not feel like dealing with it) but those played fine. When I tried to shut it down at night, though, it said something like:

Failed to shut down. System manager must be idle for shut down to occur.

I tried to hibernate, but it said the same thing. In a few seconds, though, it hibernated anyway. Then in the morning when I turned it on again, it gave a similar error, but slightly different. It said, exactly:

Code:

Xubuntu 11.04
Errors were found while checking the disk drive for /boot
Press F to attempt to fix those errors, I to ignore, S to skip mounting or M for manual recovery

I pressed I, but it said an error occurred while mounting /boot. So I pressed S, and it booted, giving me a desktop where all the window buttons are missing from the windows and I can't do much of anything.

I know I will have to reinstall yet AGAIN, but I am really hoping someone can help me figure out what is going on. Is it my partition structure? Have I done something wrong by having a boot partition and putting the boot loader in the MBR? I know the possibility was mentioned of my disk going bad, but that just seems unlikely since this all started when I installed Xubuntu. The disk is barely a year old (not that it really matters, I guess, but I just would not expect it to go bad already). Is there some program out there that will let me test the disk function?

I am just at the end of my rope here. I on the verge of my SIXTH install now, and I do not know what to do. I really want to get this fixed! Help would be very much appreciated.

chrism01 12-22-2011 06:15 PM

Quote:

keys: press F to fix errors, I to ignore, S to skip mounting and M for manual recovery
means you have disk corruption errors; they are from the fsck tool that gets called at boot (& can be manually run if reqd).
http://linux.die.net/man/8/fsck

Has the machine ever been shutdown by just switching off or had a power interrupt of some kind?

See post #3 for more detail/background.

Kallaste 12-22-2011 07:56 PM

No, there has never been any loss of power, and I always shut down properly. I do not know how my disk could have gotten corrupted at all, much less several times in the last few weeks. That is why I was worried I had done something wrong with the partitioning.

At the moment I am looking for a good disk checking program as mentioned in post #3. I am planning to back up everything again, check the disk, reformat the drive, and reinstall again. Should I redo the partitions the way they are now, or could that be causing the problem?

Thanks for the help.

selfprogrammed 12-23-2011 07:58 PM

So assume it is not a virus, or installed program.
The first half of my first answer applies.

Your partitions are good, no problem there. That is the same way I do it.
What can happen is that some OS like DOS will try to use a partition and write
beyond its boundaries corrupting other partitions, because it did not understand
the partition.
If you have created the partitions using Linux and only run Linux, then there
should not be a problem like that.

Put your LILO or GRUB info in the boot partition, along with a copy of the /boot directory.
I have my boot loader in the MBR, that is not the problem. This is very standard practice now. The only problem is with BIOS that think that rewriting the MBR is a virus and
bug you with warning messages, or block the write.

Check the S.M.A.R.T reports from the disk, and enable them if they are not enabled.
This is the kind of problem that this was designed for, it should be logging errors.

Get the diagnostic program for your brand of disk drive, and run it.
Most of them run from DOS, or some dosbox, so it would help if you have a DOS boot disk. DO NOT tell the disk drive help people that you run Linux because they will disown you with the excuse that they do not support Linux, and you are on your own.

You probably will have to rewrite the filesystem, which wipes all data from the partition.
If the problem occurs again, then the disk is going bad.
It sounds like corrupt sectors.

Boot your system from CDROM and run it that way.
Backup your data, assume the disk get reformated.
Run the program /sbin/badblocks.
Read up on them first
> man e2fsck
> man badblocks
The easy way
> e2fsck -v -c -c -f /dev/sda1
The hard way, but with more control.
> /sbin/badblocks -n -c 128 -o badlist1 /dev/sda1
If you have backed up everything to another drive then you can overwrite everything,
using -w.

These will take hours to run.
Afterwards you will likely need to re-create the filesystem and re-install Linux
because (as far as I know) badblocks does not move files off of the badblocks, just marks them
so they do not get used again.

I have had disks be bad right out of the box.
It is normal for disk drives to fail early, or last a long long time.
Try a different disk drive, even a small old one, just for a few weeks to verify
that your new OS distribution is not the problem.

Kallaste 12-23-2011 10:06 PM

Wow, you have been amazingly helpful. I have learned a great deal from your first post and keep referring back to it. It will take me a few days to do everything in the second post, but I am sure I will be able to figure it out now, so I sincerely thank you.

I hope you will clarify this one thing for me though. You said

Quote:

Originally Posted by selfprogrammed (Post 4557325)
Put your LILO or GRUB info in the boot partition, along with a copy of the /boot directory.

Sorry to be dense, but how do I put the GRUB info in the boot partition? I thought where the GRUB (which is what I am using) info ended up was dictated by where I told the installer to put the boot loader during installation, which was in the MBR. Do I need to do additional configuring?

Thank you.

selfprogrammed 12-26-2011 01:11 PM

I think you mentioned that you had made a boot partition. I have one too. It holds everything needed to boot, so even if my Linux partition gets corrupted I can always boot Linux. Mostly this is because I have 3 or 4 versions of custom compiled Linux for each version, which all run off the same partition (thus each compile would destroy the previous, which I wanted to save). I can boot Linux 2.4-HUGE, 2.4-SATA, 2.4-custom1, 2.4-fix2, 2.6-SATA, 2.6-custom2.

After making the boot partition (which can be very small, 12 Meg maybe).
>mount /bootpart
>mkdir /bootpart/boot
> mkdir /bootpart/etc/
> cp /etc/lilo.conf /bootpart/etc/
> mv /etc/lilo.conf /etc/lilo.conf.backup
> ln -s /bootpart/etc/lilo.conf /etc/lilo.conf
From now on you have to have bootpart mounted in order to modify lilo.
But with bootpart not mounted, everything in /bootpart is safer.

> cd /bootpart/boot
Make directories for each alternative boot, Linux update, boot option, etc
> mkdir boot2 boot3 boot4
> cp -a /boot/ boot2/

/bootpart/boot has
boot.0800
boot.1884
map
diag1.img # do not remember what this is

Each individual boot directory gets
System.map.gz
vmlinuz
config

Config is a copy of the config you used to compile this custom version of Linux. It records
all the compile options you used.

Edit lilo.conf to use the images in your new directories.
/bootpart/boot2/...
/bootpart/boot3/...

I keep multiple backups of lilo.conf in /bootpart/etc/

There may be some more things. My boot directories have more descriptive names.
Put a sequence number somewhere in there because you will loose track.

Kallaste 12-26-2011 01:54 PM

Okay, this will be helpful. Thank you again!


All times are GMT -5. The time now is 05:40 AM.