Jump to content

Shutdown hangs when turning off swap


ffrr
 Share

Recommended Posts

I have Mandriva 2005LE installed and running more or less 24 hours a day, because I use it to run mythtv, as well as use it for general stuff. If it has been running for a few day, it often won't shutdown cleanly. It seems to hang when trying to turn off swap. It never gets an [OK] on this line.

 

When it does this I try ctrl-alt-sysreq - EISUB in sequence, rather than just resetting the machine, and it does respond to these requests and reboots. On reboot however, theres often a bunch of stuff gets repaired on a file system check, especially in the partition where /var is mounted. Am I not doing the EISUB thing correctly?

 

Anyway, I'd welcome some suggestions, especially about the hang on swap as it shuts down. Maybe it's all related, maybe not :help:

Link to comment
Share on other sites

What happens if you manually umount /swap? (make sure you've closed as many applications as you can before you try :) )

 

I'm using RSEIUB

 

I'll try umounting it later (lots of stuff going on at the minute) but, if I reboot after the system has been up for a short time (like I did about half an hour ago after it had only been running 30 minutes) it shuts down normally, so I expect swap is probably fine at the moment.

 

Can I rebuild/recreate the swap partition? Is it formatted in any way - sorry I don't know much about swap, except I thought it was just a raw space.

Link to comment
Share on other sites

Swap is not something you normally have to ever worry about. I think you have a deeper problem somewhere else. Normally if nothing is using swap, it just drops whatever is in it. It seems like something is telling swap to hold on to the data even when you tell everything else to shut down.

The only considerations normally given to swap is "how big does it need to be ???".

Normally twice your memory value but not necessary to be above 512mbs. Any larger is just a waste of space but does no harm. The size of your swap, or what HDD it is on is not likely to be the source of your problem.

Cheers. John.

Link to comment
Share on other sites

OK, so I wonder what type of things 'tell swap to hold on to the data' ? I notice on a normal shutdown, the very next thing it does, after turning off swap, is to umount all the partitions, so nothing in user space should be running at this point should it?

 

One thing I was running the mythtv backend daemon as root, and for other reasons I have just changed it to tun as a normal user (really a mistake to run it as root anyway). Maybe, just maybe, this might help ... no bets though :D

Link to comment
Share on other sites

Swap isn't mounted, it's just activated.

 

Try running:

# swapoff /dev/your_swap_partition

and then shut down, let us know the results.

 

I ran

# swapoff /dev/sda6

(my swap partition) and it produced no error. I then shutdown the system (restart actually) and that worked fine. I know this doesn't help much. I guess I need to try this fromtime to time until some error occurs that may help me find the source of the trouble.

Link to comment
Share on other sites

This could be completely off, but one thing that holds on to swap is suspend or hibernate which is typically only used in a laptop. The suspend function is supposed to write the existing configuration at the time of activation to the swap partition and reactivate it when you power up. This might have something to do with power management and acpi.

Link to comment
Share on other sites

This could be completely off, but one thing that holds on to swap is suspend or hibernate which is typically only used in a laptop. The suspend function is supposed to write the existing configuration at the time of activation to the swap partition and reactivate it when you power up. This might have something to do with power management and acpi.

 

Not a bad idea. It might be that it gets in this state when it sits untouched for hours. It normally goes into screensave, then later puts the monitor into standby, but maybe it's also trying to go into hibernate or something. Worth investigating, thanks.

Link to comment
Share on other sites

It did look promising, but the only power control I can find in my system, was KDE controlling the screen to put it in standby and powering it down. I have turned this off for now anyway.

 

So where would I look for Mandriva's control of the system with regard to suspend and hibernate? I guess it isn't installed, as this is not a laptpop, but I'd like to be sure.

Link to comment
Share on other sites

Swap is not something you normally have to ever worry about. I think you have a deeper problem somewhere else.

Mandriva has always had a prob letting go of a large swap. I've had this issue for years. I'm not sure about 'linux'/other distros because I've never had other distros eat all of my swap, for whatever reason/bug/whatever that Mandriva does.

 

I know nothing of using lappy commands but I know of xset. SEE: man xset

 

The following turns everything off;

xset s off s noblank dpms 0 0 0

..but this has been weird as well. X has to be running to be set and I've seen it hold after logging out of X, and not.

 

If you find that acpi is the prob, you 'could' turn it off and go the apm route....but :unsure:

 

Checkout the lsof command. Run it on your /tmp since it is a memory fs. I don't know if lsof will read a swap. lsof -p <pid> will show you all the files used by a process.

 

I can tell you it has to do with the media you are doing because I rarely touch my swap, but if I play a dvd and check the swap it is about 1/4 used. This used to be worse sometimes 3/4 used. Weird.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...