set autologin to gnome, now won't start up

Asked by Richard Wilmot on 2011-11-08

I used the 'How to Auto-login to Gnome Shell In Ubuntu Oneiric [Quick Tips]' method (typing sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell into a terminal. Now ubuntu won't start. I get the ubuntu screen for about 30 seconds, then some text, ending with:
No Apache MPM package installed
Checking battery ... [OK] (don't know what this is - I'm using a desktop computer)
and then nothing.
Tried using recovery mode but don't know what to do at the prompt. Using the dreaded windows to type this! Any help very gratefully received.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu lightdm Edit question
Assignee:
No assignee Edit question
Solved by:
Richard Wilmot
Solved:
2011-11-20
Last query:
2011-11-20
Last reply:
2011-11-09
Lalatendu Mohanty (then4way) said : #1

Steps to go in to the Recovery mode

https://wiki.ubuntu.com/RecoveryMode

Richard Wilmot (richardglobal) said : #2

Thanks. I can get the terminal but what do I do with it? What do I type to get the system started or find out what's wrong? As I have to use windows at the moment, I need as much info as possible before I try linux again.

Once in recovery mode, try:

/usr/lib/lightdm/lightdm-set-defaults -s ubuntu

Then reboot:

reboot

See if that fixes the problem. If not, please post here again.

The messages about Apache MPM and the battery don't actually provide information about this problem; they're just the last two messages before the GUI loads...which is not happening.

Richard Wilmot (richardglobal) said : #4

Thanks for your help. I tried the command and got:
can't update: Failed to create file '/etc/lightdm/lightdm.conf.9SVN4V': Read-only file system
The problem remains as before.

What is the output of this command?

ls /etc/lightdm

And what is the output of this command?

mount

Richard Wilmot (richardglobal) said : #6

1st command:
lightdm.conf unity-greeter.conf users.conf

2nd command:(hope I've typed them all right!)
/dev/sdab on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

mount: warning: /etc/mtab is not writeable (e.g. read-only file-system). It's possible that information reported by mount(8) is not up to date. For actual information about system mount points check the /proc/mounts file.

Thanks again for your help

What is the output of

grep ' / ' /proc/mounts

?

(There's a space before and after the first slash, and before the second slash, and no spaces around the third slash.)

Richard Wilmot (richardglobal) said : #8

grep ' / ' /proc/mounts gives:

rootfs / rootfs rw 0 0
/dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d / ext4 ro,relatime,user_xattr,acl,barrier=1,data=ordered 0 0

I'm really glad this means something to you! Thanks once more for all your help.

OK, that confirms your drive really is mounted read-only.

What do you get when you run?

e2fsck -ccf /dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d

(You might be able to use tab-completion rather than typing out that whole UUID. Once you've typed just a few of the numbers/letters in the UUID, press tab and see if the shell will write out the rest for you.)

That command may take a while to run, which is OK. It will attempt to scan your / partition for physical errors and filesystem errors, which may be causing problems. (Generally speaking, the disk is mounted readwrite in recovery mode, so it's likely that something has gone wrong with your disk. That you attempted to reconfigure LightDM before the problem occurred might be purely coincidental. Maybe.)

Thanks for the tip about tab - very useful! I ran the command and got:

e2fsck 1 41 14 (22-Dec-2010)
/dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d is mounted
WARNING!!! The filesystem is mounted. If you continue you ***WILL*** cause ***SEVERE*** filesystem damage.

Do you really want to continue?

I said no!!

On the recovery menu it says 'limited read-only menu' and the fsck option says 'will exit read-only mode' if this is at all relevant.

Should I do it again and say yes? As you can imagine, I'm rather nervous about it!!!

You were right to say 'no'.

Try booting from an Ubuntu live CD/DVD or USB flash drive, select Try Ubuntu (rather than Install Ubuntu), open a Terminal window (Ctrl+Alt+T) and run this similar (but different!) command:

sudo e2fsck -vccfp /dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d

When you're running from the live system, you should be able to connect to the Internet and post on Launchpad, if that is more convenient. (That way you can quickly copy and paste text between Launchpad and the Terminal.)

It is possible that this will actually fix your problem completely. More likely, it may make it possible for recovery mode to be used to fix your problem the rest of the way.

Just in case, if you any documents or other important files on your computer that are not backed up, you should take this opportunity to use the live CD/DVD/USB system to do so. In that case, you should back them up before running the e2fsck command. To do that, open a Nautilus (file browser) window, find and mount the volume for the installed Ubuntu system (it should be listed on the left side of the file browser window), then copy your files to an external drive, or a USB flash drive (not the one you're running from, unless it has a persistent area and you know what you're doing), another computer on the network, or email them to yourself or otherwise put them on an Internet server (for example with a service like Ubuntu One).

Make sure to unmount the drive after backing files up from it (in the file browser window, it should be listed with an eject icon next to it--click that icon).

Thanks. The try ubuntu option from the disc is so much better! When I ran the command the disc drive light came on but there was no sound of action from it. It stayed on permanently like that, although the cd drive occasionally ran for a few seconds. After 10 minutes there was still no sign of life or output on the terminal so I closed the terminal. The drive light stayed on but the computer seemed active. I ran the command again and got:
e2fsck: Device or resource busy while trying to open /dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d
Filesystem mounted or opened exclusively by another program?
Apart from the drive light being permanently on, the computer seems to be working OK

Eventually I shut it down and tried rebooting but no better. Tried running the command again but same result - even after more than an hour there was no action and no output on the terminal though it was still running. From the try ubuntu I can see all the disc, windows and linux partitions. It won't let me open most of my linux files but will let me for a few (why?) and they open as usual. I can boot to recovery mode or windows as before.

"After 10 minutes there was still no sign of life or output on the terminal so I closed the terminal."

That's bad. I'm sorry I was not clearer. This is a long process, and interrupting it can damage the data on your disk. (Fortunately, it would all have been backed up first. And fortunately, your disk was likely damaged already, and by running it again, you can often repair that damage.)

If the disk is being accessed at least 1-2 times per minute, then you should wait much, much longer than 10 minutes. Like, you shouldn't assume it's not working until **an entire day** has passed. (It will likely be much shorter than that, though.)

One of the things that command does is to read every individual byte of data off your disk separately, to determine if it is stored on a physically damaged storage location. That takes time. And that's just part of what that command does. It also examines every entry in the filesystem to look for and repair inconsistencies.

So long as you are not using the disk being scanned, you can use the computer via the live CD/DVD/USB while this process is happening.

Thanks for the info. I didn't realise the time scale. I've just started rerunning the command and it can run all night and into tomorrow. This partition is about 35GB. I'm going out soon - I'll see if there's anything when I get back in 3 hours or so (about 2100GMT). If not, I'll leave it running. Thanks again for your persistence and very valuable help!

Once it's finished, or if it asks you a question that you don't know how to answer, or if it never finishes after a considerable time, please post again.

If it finishes successfully then it is possible that your problem will be fixed, or, more likely, that you will be able to fix it using my instructions from earlier, after booting into recovery mode. (When a disk's filesystem is not broken, recovery mode should mount it readwrite so that a command like "/usr/lib/lightdm/lightdm-set-defaults -s ubuntu" can succeed.)

Success!

When I returned after 2 1/2 hours there was this on the terminal:

ubuntu@ubuntu:~$ sudo e2fsck -vccfp /dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d
/dev/disk/by-uuid/5ff2ab29-3487-48ca-a242-bd9d18a6f12d: Updating bad block inode.

  219730 inodes used (10.28%)
     380 non-contiguous files (0.2%)
     464 non-contiguous directories (0.2%)
         # of inodes with ind/dind/tind blocks: 0/0/0
         Extent depth histogram: 180393/170
 4420294 blocks used (51.76%)
       0 bad blocks
       2 large files

  143073 regular files
   21794 directories
      57 character device files
      25 block device files
       0 fifos
      48 links
   54769 symbolic links (39072 fast symbolic links)
       3 sockets
--------
  219769 files

Will now reboot, see what happens and post again.

Good--hopefully that will at least make it so that recovery mode successfully mounts the root filesystem readwrite. Please post again to provide more info, if you find you still need help.

Oh dear, in recovery mode I tried the command and got:

/usr/lib/lightdm/lightdm-set-defaults -s ubuntu
can't update: Failed to create file '/etc/lightdm/lightdm.conf.I7FI4V': Read-only file system

just like before.

Sorry to be such a pain!

That's not entirely unexpected.

Try booting normally and pressing Ctrl+Alt+F1. Do you get a nongraphical login screen which you can use to log in? If so, try logging in and running the similar (but not identical) command:

sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu

Interesting. I wasn't sure when to press ALT-CTRL-F1 so I did it while the ubuntu screen was on. After a few seconds I got a graphical login screen (as I had previously selected auto login I just selected my name and presses Enter) and then it continued to my normal (non-unity) display with everything apparently working! To see if this was permanent, I rebooted, waited until startup stalled at the usual point and did ALT-CTRL-F1 then. I got the non-graphical login screen, logged in and performed the command, which it accepted. Rebooted again but no matter what I do - press ALT-CTRL-F1 at various stages or not - I can't get it to work again!!

I am beginning to suspect a problem with your disk (we scanned the disk pretty thoroughly, but we didn't run a S.M.A.R.T. utility) or memory.

Pressing Ctrl+Alt+F1 before the system is booted will not give you a graphical login screen. That was probably by chance.

Pressing Ctrl+Alt+F1 after it is booted will not give you a graphical login screen either, but it does give you the nongraphical login screen that you used to run that command.

Go ahead and do that again and run these commands:

sudo apt-get update
sudo apt-get install pastebinit
pastebinit -b http://paste.ubuntu.com < /etc/lightdm/lightdm.conf

That should give you a URL like http://paste.ubuntu.com/733661/. Please provide the number (or the whole URL, if you like).

In addition, please scan your disk with smartmontools as described at https://help.ubuntu.com/community/Smartmontools. (If you want to use GSmartControl, you'll have to do that from the live CD/DVD/USB, as you don't currently have a GUI.)

And please also test your RAM with memtest86 as described near the top of https://help.ubuntu.com/community/FaultyHardware (that page also gives a summary of how to use smartmontools).

With pastebinit I got:
http://paste.ubuntu.com/734141/

Memtest86 produced no errors after 5 passes of 8 tests each

Smartctl produced:
ubuntu@ubuntu:~$ sudo smartctl -t long /dev/sda

smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)

Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===

Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".

Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.

Testing has begun.

Please wait 30 minutes for test to complete.

Test will complete after Thu Nov 10 09:47:20 2011

Use smartctl -X to abort test.

ubuntu@ubuntu:~$ sudo smartctl -l selftest /dev/sda

smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)

Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===

SMART Self-test log structure revision number 1

Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error

# 1 Extended offline Completed without error 00% 3019 -

ubuntu@ubuntu:~$ sudo smartctl -a -d ata /dev/sda

smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)

Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Model Family: Hitachi Deskstar 7K80 series

Device Model: HDS728080PLA380

Serial Number: PFDH32S0S71S5M

Firmware Version: PF2OA60A

User Capacity: 82,348,277,760 bytes

Device is: In smartctl database [for details use: -P show]

ATA Version is: 7

ATA Standard is: ATA/ATAPI-7 T13 1532D revision 1

Local Time is: Thu Nov 10 10:02:10 2011 UTC

SMART support is: Available - device has SMART capability.

SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:

Offline data collection status: (0x00) Offline data collection activity

     was never started.

     Auto Offline Data Collection: Disabled.

Self-test execution status: ( 0) The previous self-test routine completed

     without error or no self-test has ever

     been run.

Total time to complete Offline

data collection: (1779) seconds.

Offline data collection

capabilities: (0x5b) SMART execute Offline immediate.

     Auto Offline data collection on/off support.

     Suspend Offline collection upon new

     command.

     Offline surface scan supported.

     Self-test supported.

     No Conveyance Self-test supported.

     Selective Self-test supported.

SMART capabilities: (0x0003) Saves SMART data before entering

     power-saving mode.

     Supports SMART auto save timer.

Error logging capability: (0x01) Error logging supported.

     General Purpose Logging supported.

Short self-test routine

recommended polling time: ( 1) minutes.

Extended self-test routine

recommended polling time: ( 30) minutes.

SMART Attributes Data Structure revision number: 16

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0

  2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0

  3 Spin_Up_Time 0x0007 108 108 024 Pre-fail Always - 185 (Average 182)

  4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 2076

  5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0

  7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0

  8 Seek_Time_Performance 0x0005 100 100 020 Pre-fail Offline - 0

  9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 3019

 10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0

 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 2074

192 Power-Off_Retract_Count 0x0032 099 099 050 Old_age Always - 2078

193 Load_Cycle_Count 0x0012 099 099 050 Old_age Always - 2078

194 Temperature_Celsius 0x0002 152 152 000 Old_age Always - 36 (Lifetime Min/Max 0/48)

196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0

197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0

198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0

199 UDMA_CRC_Error_Count 0x000a 200 253 000 Old_age Always - 0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error

# 1 Extended offline Completed without error 00% 3019 -

Warning! SMART Selective Self-Test Log Structure error: invalid SMART checksum.

SMART Selective self-test log data structure revision number 1

 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS

    1 0 0 Not_testing

    2 0 0 Not_testing

    3 0 0 Not_testing

    4 0 0 Not_testing

    5 0 0 Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.

If I read this right (not at all certain!) it doesn't look good. My disc seems to be showing more signs of old age than I am!
If so, apart from getting another computer and starting all over again, is there anything I can do about it?

Thanks again

The situation seems to have solved itself somehow. I tried various things after the login. startx gave me screens but with no windows so rather inconvenient. Eventually lightdm did something useful and got the system back to normal but I've no idea how. So for the moment I'm OK. Thanks Eliah for all you help.