shutdown freezes

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

shutdown freezes

Postby emel_punk » May 18th, '20, 05:38

Hi mageians

I have a weird problem with Mageia 7.1. When I shutdown the system, it does take a minute or two most of the time but normally it just take seconds, and it has nothing to do with the hard drive or my computer since I have it into two different brand of laptops and same thing happens. The last message in console it is "shutting down" as appears in the next image.

Image

Any hint on this?
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50

Re: shutdown freezes

Postby JoesCat » May 18th, '20, 22:04

Hi emel_punk,
in the list where it shows /dev/mmc..... that is an "SD card".
To save energy, SD cards are fairly slow devices, and may even power down ... to save energy.
or to put it in opposite wording.... it's slow.

What you are probably observing is the last stages of lazy writes on a slow device.
Although you may say close, or exit, or shutdown, there actually is a gap of time between you saying umount, and the amount of time needed to truly finish writing and flushing everything to a drive before all is done completely.
At this point, all references should be nice and tidy.
On a fast harddrive, the effect is very small and unnoticeable.
On a slow device, it is noticeable, especially if there is plenty to write and flush.

You can confirm the shutdown speed by umounting the SD card first before doing a shutdown.
You may see it takes some time for it to finish writing whatever needs to be done, before it truly shuts down.
Unfortunately, I'm not sure how you can perform umount on /swap before you shutdown the PC, so you may be in an awkward position in having to resetup or reinitialize your drives differently.

You really should find a different use for the SD card (not as /swap), maybe choose a buffer drive or something different, like maybe /opt or /mnt/backups or something you can umount earlier. A good place to keep /swap is on a fast drive, like your main harddrive, or a secondary harddrive.

FYI: Also a word of warning, due to the amount of waiting you may be doing here, you may have strong temptation to force a powerdown/shutdown....this would be bad since whatever is getting written/flushed isn't finished yet, so you are more than likely going to have some drive corruption forcing a shutdown.
If this is the case, you would need to run fsck to make the drive usable and may have lost some files due to corruption.

See if that resolves your problem.

Second note: If you are forced to use SD cards due to lack of space, you may get some extra speed improvement by using ext2 or FAT32 instead of ext4, NTFS, or any other journalized file system (which requires extra writing to maintain a journal).
User avatar
JoesCat
 
Posts: 122
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: shutdown freezes

Postby emel_punk » May 19th, '20, 17:12

Well it is not a SD card in per se but a chromebook that has eMMC Flash Storage, but in any case I have another computer with a standard HDD disk and still the same problem
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50

Re: shutdown freezes

Postby JoesCat » May 19th, '20, 21:53

Thanks for the added info.
Here seems to be some good information concerning eMMC.
https://www.howtogeek.com/196541/emmc-v ... -is-equal/
The memory is economical, which brings the chromebook cost lower, and it saves lots on power, but the trade-off is write-speed.
I see similar behaviour with an acer minibook, which also has this sort of eMMC memory. It's a bit of an expected tradeoff.

You may note the shutdown may be proportional to the number of programs, applications, and browser windows you have open when you decide to shutdown. If you prefer to restore on login, it means lots of info needs to be written down on shutdown so that it is available on login later.
The chromebook designers optimized this process for this type of hardware.
Mageia is structured for a more traditional computer setup expecting a faster harddrive.

FYI: Due to the eMMC, you may benefit in having your temp redirected to a RAMdisk. I assume the chromebook already has lots of RAM, however, more traditional distros like Mageia and others will default to the harddrive, or SSD unless you cutomize this.

I don't know the details for your HDD machine, so, cannot comment beyond HDDs are mechanical, and you're probably already familiar with expected speeds vs SSDs. You will likely benefit from choosing ext2 to avoid having the HDD head sweeping back-n-forth between data files and the journal.
User avatar
JoesCat
 
Posts: 122
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: shutdown freezes

Postby emel_punk » May 21st, '20, 23:55

Well, to be honest I don't think it has anything to do with the eMMC chipset, sometimes the shutdown process is normal and takes like 3 seconds . My other laptop is a Lenovo ideapad 330 which had a HDD and then I changed it to a SSD and both had the same problem . I have installed latest kernel available at repositories but no luck still :x
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50

Re: shutdown freezes

Postby emel_punk » May 22nd, '20, 00:26

Here is an image of my Lenovo ideapad 330 with the same error.

Image
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50

Re: shutdown freezes

Postby JoesCat » May 22nd, '20, 18:44

Well, thanks for the feedback, the rest of these suggestions is based on reading other peoples problems, and the common theme I find, seems to be some program or service is "not listening to SIGTERM"

If you don't want to dig any further - I think this kludge won't fix the root problem, but it should speed up shutdown: https://www.reddit.com/r/linuxquestions ... _shutdown/
I'll assume your screenshot pictures are hung waiting at the very last message "Shutting down".
Caveat - if there is some unfinished business with writing to the drives, it can cause some data loss.
...having said that....I haven't done this mod, but due to the slow writes, I have had to run fsck on the eMMC based laptop every blue moon now and then.

Read through this and try some of the suggestions (journal): https://www.reddit.com/r/linuxmint/comm ... _shutdown/
Also, as a few users mention, if you have other devices plugged-in (USB, bluetooth, etc), try with the devices unplugged.
Based on the "other device" theme, another possible vector is the network connection:
https://www.naut.ca/blog/2018/06/27/fix ... tdown-bug/

Read through this since Mageia7 launched in 2019, more or less about this time...
https://www.reddit.com/r/archlinux/comm ... oot_fixed/

I thought the SDcard was the problem - Someone more familiar with the kernel, systemd stuff, and shutdowns, will have a better method of tracking this problem.
User avatar
JoesCat
 
Posts: 122
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: shutdown freezes

Postby JoesCat » May 22nd, '20, 18:54

It just occurred to me, you mention the problem on your Lenova started some time after you traded your HDD to SSD.
Maybe searching for common terms "linux shutdown slow SSD" may find a solution.
eg...https://forum.manjaro.org/t/manjaro-kde ... down/92514
User avatar
JoesCat
 
Posts: 122
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: shutdown freezes

Postby emel_punk » May 23rd, '20, 01:12

JoesCat wrote:It just occurred to me, you mention the problem on your Lenova started some time after you traded your HDD to SSD.
Maybe searching for common terms "linux shutdown slow SSD" may find a solution.
eg...https://forum.manjaro.org/t/manjaro-kde ... down/92514


No it didn't start after, it happened with my HDD, then SSD, and lastly the eMMC. I thought it was some issue with the Lenovo but the same with a second one.
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50

Re: shutdown freezes

Postby emel_punk » May 23rd, '20, 01:24

JoesCat wrote:Well, thanks for the feedback, the rest of these suggestions is based on reading other peoples problems, and the common theme I find, seems to be some program or service is "not listening to SIGTERM"

If you don't want to dig any further - I think this kludge won't fix the root problem, but it should speed up shutdown: https://www.reddit.com/r/linuxquestions ... _shutdown/
I'll assume your screenshot pictures are hung waiting at the very last message "Shutting down".
Caveat - if there is some unfinished business with writing to the drives, it can cause some data loss.
...having said that....I haven't done this mod, but due to the slow writes, I have had to run fsck on the eMMC based laptop every blue moon now and then.

Read through this and try some of the suggestions (journal): https://www.reddit.com/r/linuxmint/comm ... _shutdown/
Also, as a few users mention, if you have other devices plugged-in (USB, bluetooth, etc), try with the devices unplugged.
Based on the "other device" theme, another possible vector is the network connection:
https://www.naut.ca/blog/2018/06/27/fix ... tdown-bug/

Read through this since Mageia7 launched in 2019, more or less about this time...
https://www.reddit.com/r/archlinux/comm ... oot_fixed/

I thought the SDcard was the problem - Someone more familiar with the kernel, systemd stuff, and shutdowns, will have a better method of tracking this problem.


Thanks mate. I am going to check that and see if it helps
emel_punk
 
Posts: 33
Joined: May 28th, '13, 22:50


Return to Advanced support

Who is online

Users browsing this forum: Google [Bot] and 1 guest