Slow boot in 11.04

Asked by Jim Watson

20 sec to boot after sign-in.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Watson
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Benjamin Tan Chun Yung (benjamin-chiyawa) said :
#1

Have you encountered this before, or just recently?

Try clearing your tmp folder's content. Hope that helps at least.

Revision history for this message
Jim Watson (jwtsnheis) said :
#2

Just recently. How do I clear tmp folder? Where is it?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Is it slow up to the login screen, or is it only slow after login...

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Can you also give the output of:

lsb_release -a; df -h

Thanks

Revision history for this message
Jim Watson (jwtsnheis) said :
#5

Slow after login.

Revision history for this message
Jim Watson (jwtsnheis) said :
#6

jim@jim-laptop:~$ lsb_release -a; df -h
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 80G 19G 58G 25% /
none 490M 660K 489M 1% /dev
none 497M 1.3M 495M 1% /dev/shm
none 497M 104K 496M 1% /var/run
none 497M 0 497M 0% /var/lock
jim@jim-laptop:~$

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

If you login as a different user, is it ok?

Revision history for this message
Jim Watson (jwtsnheis) said :
#8

I will try and let you know.

Revision history for this message
Jim Watson (jwtsnheis) said :
#9

Slow before and after login with a different user,

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#10

While the /tmp folder is typically cleared on boot, that is occasionally not the case, so I agree with Benjamin Tan Chun Yung that it is worth clearing it manually to see if that produces any improvement. (The other interpretation of what he said was that you should clear your user-specific tmp folder, but since this problem occurs for a different user too, that will probably not address the problem. On the other hand, if the other user account you tested with is was created a while ago and is extensively used, you might try creating a new user account and testing with that.)

To clear your /tmp folder in such a way as to get rid of files that might your system boot slowly, save all your work, close any open documents and programs, open a Terminal window, and run this command:

sudo /etc/init.d/gdm stop

You'll be logged out, and the graphical user interface will exit. You're now presented with a nongraphical login screen. (If you're not, press Alt+F1.) Enter your username and press enter. Then enter your password and press enter (you won't see any placeholder characters like *, but that's OK, your password is being taken in).

Then run the following command:

sudo rm -rf /tmp/* /tmp/.*

You should try VERY hard not to enter that command incorrectly. For example, if you were to accidentally put a space between / and tmp, it would delete all your files, possibly including files on attached external drives and drives mounted over the network!

Then, once that finishes and gives you a $ _ prompt again (like you got when you logged on), reboot the computer by pressing Ctrl+Alt+Delete or running the command "sudo reboot" (without the quotes).

If that doesn't help, you should see if there are programs running that are taking up a lot of memory or CPU resources. You can this in the System Monitor, or if you prefer the command-line, with the utility called top.

Revision history for this message
Jim Watson (jwtsnheis) said :
#11

sudo rm -rf /tmp/* /tmp/.* The system did not like one of the "/". Didn't say which one.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#12

"The system did not like one of the "/". Didn't say which one."

Are you saying that you ran the command and it reported an error? If so, what was the full and *exact* text of the error?

If you are saying something else, please clarify.

Revision history for this message
Jim Watson (jwtsnheis) said :
#13

"Cannot remove directory '/tmp/.' Cannot remove directory '/tmp/..'" Disregard what I said about the "/". These were the messages I received.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#14

If you entered the command correctly, and those were the only two messages, then there is nothing wrong.

The /tmp/.* part of the command indicates that files and folders in /tmp that start with a . are to be removed. Their names are not matched by /tmp/* which indicates that files and folders in /tmp, except those that start with a ., are to be removed (which is why it is necessary to include /tmp/.*).

If the directories . and .. inside /tmp are the only items that were not removable, that's fine. They aren't actually *in* tmp, in the usual sense. Instead, in any directory, . refers to the directory itself (so . is /tmp) and .. refers to the directory's parent (so .. is /). It is intended behavior of the rm command that . and .. not be removed. It would be slightly bad if . had been removed, because then /tmp wouldn't exist at all, and there has to be a /tmp (though it can be empty) for an Ubuntu system to boot. And it would have been spectacularly bad if /tmp/.. had been removed, because /tmp/.. is the same as /, so everything on your computer would have been removed. Since pretty much nobody ever wants this sort of behavior when recursively removing files in a directory starting with a ., the rm command doesn't behave that way.

Is your start-up performance any better?

Revision history for this message
Jim Watson (jwtsnheis) said :
#15

Thanks for the excellent explanation. Performance is no better. From restart to user selection about 55 seconds, from login to gui about 22 seconds.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#16

Is the computer running slowly even after you log in? If so, you should see if there are programs running that are taking up a lot of memory or CPU resources. You can this in the System Monitor, or if you prefer the command-line, with the utility called top.

I also recommend that you test your RAM (https://help.ubuntu.com/community/MemoryTest) and hard disk (http://www.howtoforge.com/checking-hard-disk-sanity-with-smartmontools-debian-ubuntu and https://help.ubuntu.com/community/SystemAdministration/Fsck).

If neither of those helps or reveals any problems, then (1) press Escape when you first see the Ubuntu logo on the screen (with dots below it), which should reveal the messages "behind" the splash screen, which may document what is taking so long, and (2) since this started recently, open /var/log/dpkg.log in the Text Editor, which logs the changes made to what software--and what versions--are installed on your computer, select all the text, copy it to the clipboard, paste it at http://paste.ubuntu.com, click "Paste!", post the link to it here, and specify as precisely as possible when (date and, if possible, time) the slowdown began.

Revision history for this message
Jim Watson (jwtsnheis) said :
#17

Thanks Eliah, I will follow your suggestions and report back to you.

Thanks,
Jim Watson

On Mon, Jul 25, 2011 at 6:06 PM, Eliah Kagan <
<email address hidden>> wrote:

> Your question #165796 on linux in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796
>
> Status: Open => Answered
>
> Eliah Kagan proposed the following answer:
> Is the computer running slowly even after you log in? If so, you should
> see if there are programs running that are taking up a lot of memory or
> CPU resources. You can this in the System Monitor, or if you prefer the
> command-line, with the utility called top.
>
> I also recommend that you test your RAM
> (https://help.ubuntu.com/community/MemoryTest) and hard disk
> (http://www.howtoforge.com/checking-hard-disk-sanity-with-smartmontools-
> debian-ubuntu and
> https://help.ubuntu.com/community/SystemAdministration/Fsck).
>
> If neither of those helps or reveals any problems, then (1) press Escape
> when you first see the Ubuntu logo on the screen (with dots below it),
> which should reveal the messages "behind" the splash screen, which may
> document what is taking so long, and (2) since this started recently,
> open /var/log/dpkg.log in the Text Editor, which logs the changes made
> to what software--and what versions--are installed on your computer,
> select all the text, copy it to the clipboard, paste it at
> http://paste.ubuntu.com, click "Paste!", post the link to it here, and
> specify as precisely as possible when (date and, if possible, time) the
> slowdown began.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796/+confirm?answer_id=15
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796
>
> You received this question notification because you asked the question.
>

Revision history for this message
Jim Watson (jwtsnheis) said :
#18

http://paste.ubuntu.com/652059/ Slowdown noticed on afternoon of 07/17/11.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#19

Please also report the results of memtest86+ (RAM), smartmontools and fsck (disk), and pressing Escape when the Ubuntu logo first appears at the center of the screen during boot.

Revision history for this message
Jim Watson (jwtsnheis) said :
#20

My system is a Dell Mini 10v, dual boot xp/11.04. When I press esc the screen just scrolls. What am I looking for with memtest86? I can see that I have 1015M of memory.

Revision history for this message
Jim Watson (jwtsnheis) said :
#21

These test are too technical for me. Need something simpler.

On Wed, Jul 27, 2011 at 10:35 AM, Jim Watson <
<email address hidden>> wrote:

> Your question #165796 on linux in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796
>
> Status: Needs information => Open
>
> You gave more information on the question:
> My system is a Dell Mini 10v, dual boot xp/11.04. When I press esc the
> screen just scrolls. What am I looking for with memtest86? I can see
> that I have 1015M of memory.
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#22

Hold shift at boot and select the memtest, nothing technical whatsoever.

Revision history for this message
Jim Watson (jwtsnheis) said :
#23

Ran memory test. Don't understand what it told me. Now what? How can I get
out of test without powering off?

On Wed, Jul 27, 2011 at 12:41 PM, actionparsnip <
<email address hidden>> wrote:

> Your question #165796 on linux in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> Hold shift at boot and select the memtest, nothing technical whatsoever.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796/+confirm?answer_id=21
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/linux/+question/165796
>
> You received this question notification because you asked the question.
>

Revision history for this message
Jim Watson (jwtsnheis) said :
#24

How do you run fsck?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#25

In a terminal run:

man fsck

You can see the options. You can run:

sudo fdisk -l

To see the partition names. You can then fsck the partition as you wish.

Revision history for this message
Jim Watson (jwtsnheis) said :
#26

I have no idea what options to use. I ran fsck and it said I would damage the mounted volume (/dev/sda5)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#27

You need to do the fsck in the live CD environment so the partition isn't mounted.

Revision history for this message
Jim Watson (jwtsnheis) said :
#28

Do you mean the usb flash drive? After I boot and open the terminal what command do I enter, Sorry for my ignorance.

Revision history for this message
Jim Watson (jwtsnheis) said :
#29

jim@jim-laptop:~$ sudo smartctl -a /dev/sda
[sudo] password for jim:
smartctl 5.40 2010-07-12 r3124 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Scorpio Blue Serial ATA family
Device Model: WDC WD1200BEVT-75ZCT2
Serial Number: WD-WXC808871271
Firmware Version: 11.01A11
User Capacity: 120,034,123,776 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Thu Aug 4 19:57:16 2011 CDT
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: (4560) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
     Auto Offline data collection on/off support.
     Suspend Offline collection upon new
     command.
     Offline surface scan supported.
     Self-test supported.
     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: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 57) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x303f) SCT Status supported.
     SCT Error Recovery Control supported.
     SCT Feature Control supported.
     SCT Data Table supported.

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 0x002f 200 200 051 Pre-fail Always - 1
  3 Spin_Up_Time 0x0027 159 155 021 Pre-fail Always - 1025
  4 Start_Stop_Count 0x0032 098 098 000 Old_age Always - 2212
  5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
  7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0
  9 Power_On_Hours 0x0032 088 088 000 Old_age Always - 9149
 10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
 11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
 12 Power_Cycle_Count 0x0032 098 098 000 Old_age Always - 2006
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 41
193 Load_Cycle_Count 0x0032 154 154 000 Old_age Always - 140911
194 Temperature_Celsius 0x0022 091 077 000 Old_age Always - 52
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
240 Head_Flying_Hours 0x0032 089 089 000 Old_age Always - 8079
241 Total_LBAs_Written 0x0032 200 200 000 Old_age Always - 4814605082
242 Total_LBAs_Read 0x0032 200 200 000 Old_age Always - 9688485674

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 Short offline Completed without error 00% 4223 -
# 2 Short offline Completed without error 00% 1126 -

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.

jim@jim-laptop:~$

Revision history for this message
Jim Watson (jwtsnheis) said :
#30

Should I run fsck -F ufs -y /dev/sda?

Revision history for this message
Jim Watson (jwtsnheis) said :
#31

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00039b2c

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 3680 29557357 7 HPFS/NTFS
/dev/sda2 3680 14594 87662593 5 Extended
/dev/sda5 3680 14223 84682752 83 Linux
/dev/sda6 14223 14594 2978816 82 Linux swap / Solaris

Disk /dev/sdb: 2000 MB, 2000682496 bytes
62 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002052a

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1016 1952721 c W95 FAT32 (LBA)
ubuntu@ubuntu:~$

Revision history for this message
Jim Watson (jwtsnheis) said :
#32

ubuntu@ubuntu:~$ fsck -F ufs -y /dev/sda
fsck from util-linux-ng 2.17.2
Usage: fsck.ext2 [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
  [-I inode_buffer_blocks] [-P process_inode_size]
  [-l|-L bad_blocks_file] [-C fd] [-j external_journal]
  [-E extended-options] device

Emergency help:
 -p Automatic repair (no questions)
 -n Make no changes to the filesystem
 -y Assume "yes" to all questions
 -c Check for bad blocks and add them to the badblock list
 -f Force checking even if filesystem is marked clean
 -v Be verbose
 -b superblock Use alternative superblock
 -B blocksize Force blocksize when looking for superblock
 -j external_journal Set location of the external journal
 -l bad_blocks_file Add to badblocks list
 -L bad_blocks_file Set badblocks list

How should I use this command?

Revision history for this message
Jim Watson (jwtsnheis) said :
#33

My problem still exist. I still need assistance.

Revision history for this message
Jim Watson (jwtsnheis) said :
#34

thanks

Revision history for this message
Jim Watson (jwtsnheis) said :
#35

How should I use the command "fsck"?

Revision history for this message
Jim Watson (jwtsnheis) said :
#36

Everything is fine.