Bug 248539 - Unclean unmount during shutdown/reboot due to KDE 4.5
Summary: Unclean unmount during shutdown/reboot due to KDE 4.5
Status: RESOLVED LATER
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-20 20:34 UTC by Nikos Papas
Modified: 2011-11-09 23:52 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Output of "fuser -m /dev/sda1" along with "ps auxw" taken right before the unmounting (6.51 KB, application/octet-stream)
2010-08-20 20:34 UTC, Nikos Papas
Details
I have the same problem with both 32- and 64-bit installs. Output of lsof added to /etc/init.d/umountfs (21.48 KB, text/plain)
2010-08-21 12:08 UTC, wizard10000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Papas 2010-08-20 20:34:56 UTC
Created attachment 50789 [details]
Output of "fuser -m /dev/sda1" along with "ps auxw" taken right before the unmounting

Version:           unspecified (using KDE 4.5.0) 
OS:                Linux

For the last couple of weeks I have been having problems unmounting the hard disk during shutdown/reboot of my computers (3 in total). Even though it may seem impossible to be related to the KDE software, please read below to see why I believe so.

I am using Kubuntu 10.04.1 64-bit with KDE 4.5.0 -- system is fully up-to-date. I have disabled plymouth in order to see what is going on during reboot/shutdown.

Every time I reboot, I get the following messages during the shutdown process:
[...]
Unmounting weak filesystems...
mount :/ is busy
will now reboot
[...]

Upon startup, I get the following:
[...]
[    3.257417] EXT3-fs: INFO: recovery required on readonly filesystem.
[    3.257512] EXT3-fs: write access will be enabled during recovery.
[    4.299039] kjournald starting.  Commit interval 5 seconds
[    4.299140] EXT3-fs: recovery complete.
[    4.303323] EXT3-fs: mounted filesystem with ordered data mode.
[...]

which also implies that the hard disk was not unmounted properly.

After a vane long googling around, I decided to do a fresh install.

I installed from scratch Kubuntu 10.04.1 which comes by default with KDE 4.4.2. After the installation, I restarted the system plenty of times and unmounting was successful every single time.

I then updated to KDE 4.5.0 and the problem appeared again! The system is clean (nothing else installed on it except for what Kubuntu comes with) and it is why I believe it is related to KDE 4.5.0. Please also note that this problem occurs all 3 of my computers.

In my opinion, this should be considered a major bug since it can cause data corruption or loss.

I attach a text file containing the output of "fuser -m /dev/sda1" along with "ps auxw" taken right before the unmounting takes place. Please let me know if you need more information.



Reproducible: Always

Steps to Reproduce:
Reboot/shutdown system.

Actual Results:  
The devices are not unmounted properly.

Expected Results:  
Devices should be unmounted properly.
Comment 1 wizard10000 2010-08-21 12:08:44 UTC
Created attachment 50807 [details]
I have the same problem with both 32- and 64-bit installs.  Output of lsof added to /etc/init.d/umountfs

I added lsof to /etc/init.d/umountfs like this -

...#
   # Unmount local filesystems
lsof > /home/wizard/Documents/lsof.txt
   #
   if [ "$WEAK_MTPTS" ]; then...
Comment 2 Nikos Papas 2010-08-21 12:40:43 UTC
The only workaround I have found to ensure a clean shutdown is:
1) Log out of KDE
2) telinit 1
3) Drop to root terminal and shutdown/reboot from there.

It is a hassle but unmounting is done properly...
Comment 3 Nikos Papas 2010-08-21 20:22:36 UTC
Following suggestions from 

http://kubuntuforums.net/forums/index.php?topic=3113360.new;topicseen#new

I found out that another way to avoid the problem is 

1) Boot computer using recovery option
2) Drop to root console with network
3) start kdm
4) login to KDE

Shutting down/rebooting now works fine and all devices are unmounted properly.

This most likely means that a device is mounted during normal boot which is not mounted during recovery boot.

Perhaps a KDE developer can shed some light?
Comment 4 Bud Rogers 2010-08-29 04:46:53 UTC
I see this too.  Kubuntu lucid 32 bit running KDE 4.5.0 from kubuntu launchpad.


[    2.979045] EXT4-fs (sda3): INFO: recovery required on readonly filesystem
[    2.979049] EXT4-fs (sda3): write access will be enabled during recovery
[    6.303769] EXT4-fs (sda3): orphan cleanup on readonly fs
[    6.303776] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606559
[    6.303867] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1594128
[    6.303897] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606536
[    6.303915] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1593843
[    6.303953] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1594187
[    6.303969] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606439
[    6.303978] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606438
[    6.303987] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606510
[    6.303996] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606512
[    6.304022] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1606516
[    6.319997] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1604596
[    6.320026] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 1604598
[    6.320040] EXT4-fs (sda3): 12 orphan inodes deleted
[    6.320043] EXT4-fs (sda3): recovery complete
[    6.558636] EXT4-fs (sda3): mounted filesystem with ordered data mode
Comment 5 Aaron Winborn 2010-09-13 18:09:27 UTC
I am no longer able to reboot the system from the launcher; only from the command line. Not sure if this issue is related.

aaron@aaron-desktop:~$ dmesg | grep -i recovery
[    1.400635] EXT3-fs: INFO: recovery required on readonly filesystem.
[    1.400640] EXT3-fs: write access will be enabled during recovery.
[   14.188858] EXT3-fs: recovery complete.
[   23.988830] EXT3-fs: recovery complete.
[   99.923085] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
aaron@aaron-desktop:~$
Comment 6 Nikos Papas 2010-09-13 20:21:13 UTC
Can you try the following? 

1) Turn your computer
2) When you get to kdm, switch to virtual terminal  ( Ctrl+Alt+F1 )
3) sudo restart kdm
4) login to kde
5) try rebooting from launcher

Is that working?
Comment 7 Oceanwatcher 2010-09-19 04:37:06 UTC
Have the same problem.

Clean install of Kubuntu 10.04 and then upgraded to KDE 4.5.1
Comment 8 Nikos Papas 2010-09-19 10:34:55 UTC
Oceanwatcher, can you try the workaround posted on comment #6 and post back?
Comment 9 Oceanwatcher 2010-09-27 04:26:27 UTC
Well, there are a lot of if's in this.

First of all, on my pc the workaround misses a few steps. When you say "get to kdm" you mean get to the login screen or do you mean before that? And when switching to a terminal, I also need to log in. There is no way of issuing the command without logging in first? If all my assumptions are correct, this should be the list for someone that is not too used to all of the things in KDE:

1) Turn your computer
2) When you get to the login screen, switch to virtual terminal  ( Ctrl+Alt+F1 )
3) Log in with a user that has sudo rights
3) sudo restart kdm
4) login to kde
5) try rebooting the normal way using the K-menu

It seems to work, but it is difficult to judge without being able to log exactly what messages are being output during the shut down process.

I have been desperately looking for some way to log everything during a boot and a shut down, but so far I have not found any way to do it. Seems like there was a way to log the boot messages before, but it is not working any more.

And yes, there are some ways to see some of the messages, but not every message that scrolls past in exactly the way they appeared during boot. Any good ideas for an application that can do the job would be highly appreciated.
Comment 10 Nikos Papas 2010-09-27 10:21:55 UTC
Yeah, the steps you mention is what I wrote too (only less detailed). If you want to avoid switching to virtual terminals and logging in as sudo, the easiest way to automate this process is to add to add "restart kdm" (without sudo, without quotes) to the file "/etc/rc.local".

Also, a log during startup can be dound by typing "dmesg" or by looking at the file "/var/log/dmesg". Sorry but I have not been able to find a log for the shutdown process either...
Comment 11 Oceanwatcher 2010-09-28 19:18:12 UTC
Nikos,

Thank you for confirming.

There was a big update yesterday, and it seems that the problem is gone. I will have to do a few more re-boots to be sure, but I do not see the text at the end now. Really wish there was a way to log the shutdown text.
Comment 12 Nikos Papas 2010-09-28 21:56:09 UTC
Yes, after yesterday's updates (including a new kernel release) I have not experienced this bug again. Good news
Comment 13 Oceanwatcher 2010-09-29 01:30:55 UTC
Well, my laptop is slowly getting close to perfect :-) Thank you for the help.
Comment 14 Nikos Papas 2010-12-05 00:57:13 UTC
I guess this bug was not related to KDE after all. Perhaps it can be closed?
Comment 15 Jekyll Wu 2011-11-09 23:52:41 UTC
close this report as per comment #14.