View Full Version : Can't run X11 from HD install after power outage - Help!

04-12-2005, 05:15 AM
I am new to linux. I installed Knoppix 3.6 to my HD. It worked great. I was experiementing with the power, (this is a Laptop) and lost power while Knoppix was running on HD. The next time it booted, it went to the terminal login. I could login, but no x win. I played around with it, booted from the CD, went in under root and ran fsck on the /dev/hda1 among some other things. I don't know what I did that fixed it, I tried booting it again on the HD and it worked and went into X11. So I keep playing around with it and loose power again, and now I can't get it to go into X11 anymore. I tried the startx command, I can't remember exactly what it said, but it wouldn't run.
It was my understanding that fsck is like scandisk, so that is why I ran it thinking that something was messed up in the journaling or something on my ext3 partition.
Any suggestions or help is appreciated!!

04-14-2005, 12:02 AM
My suggestions:- don't let it lose power;
- tell people what error messages say;
- don't let it lose power;
- su to root and run # kdm - this is how Knoppix starts X;
- don't let it lose power;
- look at those error messages too.Oh, and don't let it lose power. But I could be off on the wrong track here. :wink:

-- Ed

04-14-2005, 01:58 PM
I've had this problem, too, but I just learned to login as root, and type in kdm. If it is setup for multiuser, then it'll let you login normally.

Also, putting XDM ahead of KDM using Sys-V can help, as well as multiple KDMs. MAKE SURE IT IS IN THE RUNLEVEL THAT KDM IS ALREADY IN!!!

And, like Mr Ed said, don't let it lose power.

04-14-2005, 06:45 PM
OK, I won't play around with the power anymore.

Does Linux have a sort of autoexec.bat file that the kdm command is in?
Why would it boot into the terminal and not start kdm?
Will I need to run the kdm command from now on, or can I edit a file to get kdm to run each time like it did before?

Did the power going out edit such a "autoexec" file to remove the kdm command?

04-15-2005, 03:55 AM
The short answer about startup files is that yes, there are a handful of scripts that might run when X kicks in. But right now I only have time to address one topic, and I think orderly shutdown is the most important.

There are at least three or four kinds of problems that can happen with sudden loss of power. One is affectionately (not!) known as head crash, and it doesn't mean that your hippie friend just went to sleep! :D

The thingies that read from, and write to, magnetic media (hard drives, floppy drives, 8-track casettes) are called heads, right? The ones that work on fast-moving media like hard drives are gliders that float on an air cushion, and when power is shut off, they land.

Like airplanes, if they land on a populated area, somebody could get hurt pretty badly. In fact, it's a bit of a miracle if somebody - or some data on the drive - doesn't get hurt.

So an orderly shutdown is needed to move the heads to where they can safely land. Otherwise you stand an excellent chance of putting a permanent scratch in the thin, thin coating on the platters that hold the puny little magnetic fields that, in turn, hold your programs and data.

Sometimes other hardware needs to go through some kind of shutdown procedure.

Knoppix is unusual in wanting to eject your CD so that you can put it away before it reboots or halts your computer. But the kernel won't let Knoppix do that until the information on the CD is removed from the overall file system. So Knoppix has to take care of that, then slide out the tray and keep running until you tell it everything's okay by hitting the <ENTER> key.

Other examples that I can think of at the moment deal with networks and may not be very relevant to your situation. But consider - Linux is capable of true multi-user operation, so it's not only rude to shut down the system that other people are using without warning them, it will probably cause them software problems.

It's good discipline to take care of your hardware. And then there are the software problems!

Some software shutdown is done behind the scenes on processes you don't have to think about. Knoppix sends them one signal telling them to take care of stopping themselves, and then another to kill them off in case they weren't listening. :wink:

To help keep the 2.4 kernel from getting bollixed up, Knoppix unloads modules before shutting down. With the unionfs file system in version 3.8, Knoppix needs to move some links around before it halts.

And that's just the stuff you don't know about!

Lots of things that you do on a computer make changes, and you want those changes saved. That pretty much means that they have to be written down - to hard disk, floppy, USB drive, or whatever.

A sudden power loss means your changes might not have been saved! :shock: The obvious example is a file you've been editing. But you may have changed the wallpaper on your desktop or switched to a different desktop manager. The system also keeps track of what commands and programs you use to make it faster for you to use them again next time.

These changes to files, configurations, and histories don't necessarily get written to disk as soon as they happen. To be more efficient, operating systems can save up these writing tasks to do in batches because accessing media is slow relative to other things the processor can be doing for you.

At shutdown, you want to give all those changes one last chance to get written to media because whatever's in RAM is lost when power goes off. And it's not just your bits of data that need to be saved, there are stores of information about your data that have to be updated. So you want to "flush buffers" and "sync filesystems."

To bring this rant to a close, there's lots of housekeeping to do before you turn off your computer. And there are those hard-drive platters to protect. And that's why some people, when you tell them that you just pull the plug, fall over in a dead faint! :shock:

Others, like my son who is now the computer tech in the family, just smile. Job security! :D

-- Ed

04-23-2005, 12:34 PM
Situation: Have installed KNOPPIX to the HDD, using Knoppix-installer

Problem: Computer boots up, but does not enter X (windowing mode), but
stays with the text console.

Explanation: In the directory /tmp , is a hidden X lock file that prevents
two copies of X from trying to run at the same time. This keeps two programs
from trying to seize control of the display at once. The name of this
file is


When you shut down, X deletes this file before it quits.

If the user turns off the computer without shutting down, or if for some
other reason the lock file remains present, then X loads with priority 11
instead of priority 10, cannot accomplish its tasks, and fails.

Fix: You have to remove the file by hand, from the text console.

(1) Hold down the alt key, and hit "2", or "3", or "4", in order to
bring up a new login window.

(2) Choose as your login name "root", and as your login password, the root
(administrator) password. Login as root.

(3) Remove the file. Type:

rm /tmp/.X0-lock

(4) Reboot. Type:

shutdown -r now

When you reboot, your X windows system will again be working.

Note: If you are at all unsure about this, do steps 1 and 2, and then instead of removing this lock file, type "startx". You will then see an error note that the lock file is causing X11 to start up at priority 11 instead of 10, and failing; and that if you are not running X11 otherwise, you should remove the lock file by hand.

Note also, that you should not remove this lock file by hand, if you are running X at the time. However, you *can* view it, by opening a text console window, and typing " ls -A /tmp/ ".