LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Suspend works only sometimes, Ubuntu 12.04 (https://www.linuxquestions.org/questions/linux-desktop-74/suspend-works-only-sometimes-ubuntu-12-04-a-4175451336/)

Kirsten 02-22-2013 07:24 PM

Suspend works only sometimes, Ubuntu 12.04
 
I'm using a home-assembled Shuttle SH67H3. Ubuntu's working great, except that about half the times I try to Suspend, I get a black screen with an error-type message, followed by a return to the screen I'd been working on. The message goes by very quickly. I've gathered what I could from repeated quick glimpses. There are eight or ten lines, several of which appear to be repeats of the preceding line. Here's what I've managed to copy out:

hub 4-0:1.0 hub port status failed (err = -19)
hub 3-0:1.0 0000:03.00.0 failed to suspend async: error -110
some items failed to suspend

That may not be exact, even of those lines, but it's quite close.

I've always been mystified by hubs and ports, and I certainly don't know what to make of this.

The failures to suspend seem to be independent of whether I have any programs open. I.e., I can sometimes suspend with mail, browser, word processor all open; sometimes I can't suspend even when everything appears to be closed.

The problem has existed since I installed the Ubuntu, a week or so ago; it's not a case of it having worked at first, and then didn't. The trouble is consistently intermittent, as it were.

I'm using Logitech wireless keyboard and touchpad. There's nothing else involved -- no mp3 players charging or anything, no external hard drives, no DVD in the player. There is a Belkin router to which the desktop is wired.

Searching these forums, I learned that graphics cards are often the cause of this sort of glitch. My video card came embedded in the Shuttle motherboard, and I haven't been able to learn any more from Shuttle's site about it. I thought maybe I should install another graphics card, but the fact that the trouble is intermittent makes me think the source of the trouble might be something less tangible.

I'm fairly fresh from life with Windows, quite new to running Linux. My instinct is to press Ctrl+Alt+Del to view the task manager. Is there a way, via GUI, to view processes on Ubuntu? Or is there a way to do it through a terminal that would be simple enough for a newbie? Or am I barking up a wrong tree?

I see that some others have had trouble resuming from Suspend; for what it's worth, I've not had any trouble on that end. When I Suspend successfully, it's never (so far) a problem for me to get back in business.

Help?

Thanks.

ukiuki 02-26-2013 03:16 PM

It may be related to the amount of swap available too, since suspend and hibernation uses swap, how much RAM and swap do you have?
About the error messages if you search the log files you will find tha, logs are under the folder /var/log/ , would be a good idea to post it here, more we know about the problem more tools we have to fix it.
Quote:

Originally Posted by Kirsten (Post 4897868)
...My instinct is to press Ctrl+Alt+Del to view the task manager. Is there a way, via GUI, to view processes on Ubuntu? Or is there a way to do it through a terminal that would be simple enough for a newbie? ...

There is a way to see the processes running in the terminal, or virtual console, if you can't access the GUI, type ctrl+alt+(F1-F6),
there are programs that can show the processes, like top or ps, a good one is htop, those are text type programs that you run in the terminal.
To install htop type in the terminal:
Code:

sudo apt-get install htop
With htop is possible to see a lot things, kill processes, etc.
With ps is possible to list specific processes, example:
Code:

ps aux | grep firefox
Regards

Kirsten 02-27-2013 11:00 AM

Thanks for responding, ukiuki.

I must expose my ignorance(s). Here goes:

I don't know how to find out how much RAM and swap I have.

I don't know how to search log files. Whistling in the dark, I opened a terminal and typed /var/log/, and got back "bash: /var/log/: Is a directory".

I typed "sudo apt-get install htop", and things happened, and I think htop was installed, but I don't know how to use it. It looks like the next command you showed was for use if I'd installed ps, but I think I haven't, and I don't know how.

Can you tell me how to check RAM and swap, how to search log files, and how to see processes using htop?

Thanks!

ukiuki 02-27-2013 09:23 PM

Quote:

Originally Posted by Kirsten (Post 4900938)
Thanks for responding, ukiuki.
I must expose my ignorance(s). Here goes:
I don't know how to find out how much RAM and swap I have.
...

You are welcome, nobody born knowing anything, and we all are ignorants about one thing or another, there is no exceptions, nobody know everything. The more we learn, more we realized that we don't know a bit of the universe.
To know about the RAM and swap in the terminal type:
Code:

free
swap is a partition which is part of your hard disk, to see the partitions:
Code:

cat /proc/partitions
or as root:
Code:

fdisk -l
Quote:

Originally Posted by Kirsten (Post 4900938)
...I don't know how to search log files. Whistling in the dark, I opened a terminal and typed /var/log/, and got back "bash: /var/log/: Is a directory"...

As the retuning message says it is a directory or folder if you like. In the terminal to navigate the directories there is the command cd which can be combined with other symbols to do so, example, to go to /var/log from where you are type:
Code:

cd /var/log
then the command ls can be used to list what is in there,
to go back to your home directory just typing cd alone will do.
You can also use the graphical file manager to navigate the directories or folders.
To understand better the commands in the terminal there is a built in manual in most GNU/Linux distributions.
Type in the terminal:
(press up and down arrow keys to or pageup/pagedown to navigate and q to close the man(manual))
Code:

man man
or
Code:

man ls
or any other that you want to learn about.

Quote:

Originally Posted by Kirsten (Post 4900938)
It looks like the next command you showed was for use if I'd installed ps, but I think I haven't, and I don't know how.

ps is installed by default in GNU/linux try just to type ps
Code:

man ps
Quote:

Originally Posted by Kirsten (Post 4900938)
...I typed "sudo apt-get install htop", and things happened, and I think htop was installed, but I don't know how to use it...

Looks like you successfully installed it, in the terminal type htop
Then open another terminal and type:
Code:

ps aux | grep htop
That will give you a little more understanding and view about GNU/Linux.

Regards

goumba 03-04-2013 08:11 AM

Quote:

Originally Posted by ukiuki (Post 4901310)
to go to /var/log from where you are type:
Code:

cd /var/log
then the command ls can be used to list what is in there,
to go back to your home directory just typing cd alone will do.

Just a note:

You may have to use sudo/su - to view this directory. Some distributions are moving to make this directory unreadable to normal users for security reasons.

ukiuki 03-04-2013 04:29 PM

Quote:

Originally Posted by goumba (Post 4904346)
Just a note:

You may have to use sudo/su - to view this directory. Some distributions are moving to make this directory unreadable to normal users for security reasons.

Not really, in Ubuntu a you can read and copy it but can't edit without root powers inside of /var/log.

Regards

Kirsten 03-24-2013 09:59 AM

Heya, Ukiuki, if you're still about. Sorry I've taken so long to acknowledge your help. You've given me a lot of help, and I really appreciate it.

I got kind of overwhelmed (by Linux and life both), and shrank away for a bit, but I'm back, and exploring the paths you offered. I haven't made obvious progress yet, but I'm working on it. I did manage to get this, from cat /proc/partitions:

major minor #blocks name

8 0 976762584 sda
8 1 960099328 sda1
8 2 1 sda2
8 5 16660480 sda5
11 0 1048575 sr0

Which of those is my swap partition? Is it big enough that it's not likely to be causing my Suspend problems?

I'll keep working on the rest, starting with learning to navigate and understand man.

Thank you very much!

Kirsten

Kirsten 03-24-2013 12:10 PM

Happy day! I just discovered the Gnome Terminal help. I'd rather given up on F1, since it never has done anything for me in a GUI setting. This new (to me) source will help a lot, since there are a lot of basics unfamiliar to me. For instance, it took me a long time to figure out that to use htop to view processes, all I had to do was type htop. Man gave me a lot of information, but before Gnome Terminal help, I didn't know how to use it.

So now I see loads and loads of processes listed in htop. I've been reading about the columns in man. One of the columns is for State, and every one of the processes is State S (=Sleep), except for htop (R (=Running)). My guess is that the next thing to do is, the next time I can't suspend, come back to htop and see whether I can find something different in that column -- perhaps something still running (besides htop).

Is that clear thinking? Is there anything else I should look for?

Thanks!

Kirsten

ukiuki 03-24-2013 03:21 PM

Hey there! Im glad to see you are making your way through GNU/Linux system, and yes htop is a great software.
Quote:

Originally Posted by Kirsten (Post 4917784)
...Is that clear thinking? Is there anything else I should look for?...

Yes htop will show all processes running and it is possible to figure out just looking there what is going on.
Lets say a program stop responding and is froze, htop will list the process there and you can terminate it using the hot keys.
Another quick way to get info about a program in the terminal is to type --help after the command, not all programs have it thou. Example:
Code:

htop --help
Htop as you already notice show many things, number of processor cores, amount of memory in use and total, swap, etc.
There are other system monitor programs like top, iotop. A very popular one is conky which will be always present in the background and is customizable. It is part of Ubuntu repositories and fun to play with.

Regards

ukiuki 03-24-2013 03:27 PM

Oh, to install conky type in the terminal:
Code:

sudo apt-get install conky-all
Check the screenshots and you'll see what I mean by customizable!!

Regards

Kirsten 03-24-2013 04:16 PM

Heya, ukiuki. Thanks for hanging in here with me!

I think I'll wait to explore conky and the rest until I've learned to make use of htop; else I'll just confuse myself. But thanks, I'll check them out when I've got my more pressing matters resolved.

I just tried unsuccessfully to Suspend, and looked in htop and found that all processes (except htop) are Status S. I'm guessing this means that my failure to Suspend isn't due to unterminated processes. Is that right?

Quote:

Originally Posted by Kirsten (Post 4917743)
major minor #blocks name

8 0 976762584 sda
8 1 960099328 sda1
8 2 1 sda2
8 5 16660480 sda5
11 0 1048575 sr0

Can you tell from that list which is my swap partition, and whether it's likely to be the cause of my frequent inability to Suspend? The trouble seems to be unrelated to whether I have any programs open, and also, for what it's worth, I have seen no pattern based on whether I have opened (and closed) any particular applications since the last restart.

Thanks!

ukiuki 03-24-2013 07:04 PM

It is probably sda5, try also this command in the terminal this one will give a more detailed info about partitions:
Code:

sudo fdisk -l
Also df command give info about the disk.

Regards

Kirsten 03-24-2013 07:11 PM

Yes, it does look like sda5 is the swap. sudo says that it's 16660480 blocks. I'm not sure what a block is. Is that big enough not to be causing Suspend problems?

Thanks.

ukiuki 03-24-2013 07:20 PM

Yeah it looks big enough, 16Gb with is probably double or same amount of RAM on your computer, now block is a part of the disk plate, which is divided in sectors, blocks and tracks.
https://en.wikipedia.org/wiki/Cylinder-head-sector
https://en.wikipedia.org/wiki/Disk_sector
Now to track down the source of the problem first place to look is always in the logs which are in /var/log.

Regards

eSelix 03-24-2013 07:29 PM

Look at the logs after unsuccessful suspend, there are often information which process or its pid block suspending. Check "cat /var/log/syslog" or "dmesg" commands.

Nbiser 03-25-2013 07:50 PM

A similar problem!! I had Ubuntu on a Dell Studio Laptop and it worked great except for one thing. When I would try to wake the computer up, the screen would start growing crazy, blinking from the login to a blank screen and then back again. I would have to force a power down to stop it. This isn't the first time that I've had problems with suspend and sleep. Its happend to me on Fedora systems; possibly on other systems that I can't remember.

Kirsten 03-27-2013 10:27 AM

Hi, eSelix. Thanks for chiming in.

This morning I had an unsuccessful Suspend. I opened a terminal and entered "cat /var/log/syslog". As you probably would expect, many lines came up, none of which were intelligible to me. However, I decided to Safely Remove my charging mp3 player, which I'd forgotten to do the first time around, and try Suspend again with the terminal already open, so that I'd know (?) that the last thing on the log would be the Suspend attempt. Scrutiny of the new syslog list made me think that the last items still weren't the most informative; for instance, it was a couple of screens from the bottom of the list that I saw a line ending "sleep requested (sleeping: no enabled: yes)". (I'm pretty certain that this reflected the second Suspend attempt, and not the first.) I took a screen shot of that part of the list. Ought I to post that screenshot here?

Kirsten


All times are GMT -5. The time now is 10:33 AM.