You are not logged in.

#1 2011-08-06 06:45:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Unmounting Filesystem Failing

After the recent initscripts upgrade, whenever I poweroff or reboot my EeePC 901, the root filesystem is not unmounted, and at reboot the disk is fscked.

Unmounting Filesystem                   [Fail]
Remounting Root Filesystem Read-only    [Fail]

All of the daemons are successfully reported stopped (including Laptop-mode which I stop with a script in rc.local.shutdown when on battery: https://bbs.archlinux.org/viewtopic.php … 14#p930314).

The laptop is completely up-to-date. How would I go about diagnosing what is preventing the clean shutdown?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#2 2011-08-06 08:23:40

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Unmounting Filesystem Failing

Try adding --verbose to the umount command in rc.shutdown maybe. Inserting `lsof <device>' after the umount might help too.

Also try booting into single-user mode and see if the problem persists. If not, try disabling daemons in steps in multi-user mode.

Last if the previous version of initscripts works, doing a diff against the current scripts should help identify the faulty code.


This silver ladybug at line 28...

Offline

#3 2011-08-07 08:20:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

Thanks for the suggestions lolilolicon. Oddly, --verbose and -v both have no effect.

Adding lsof /dev/blahblah does work, but outputs quite a bit of text that is quickly cleared as the machine shuts down. I have tried to redirect it to a file but, unsurprisingly, as nothing is mounted by that time, it errors with "can't locate unmount.txt..."

I'll keep fiddling around with it.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2011-08-07 14:24:06

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Unmounting Filesystem Failing

Could you post your fstab?

Offline

#5 2011-08-07 18:30:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

Sure.

# <file system>        <dir>       <type>    <options>          <dump> <pass>
devpts                /dev/pts      devpts    defaults            0      0
shm                   /dev/shm      tmpfs     defaults            0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

UUID=78b9738e-dd5b-4616-a6dc-1ca8c96e0209 / ext2 defaults,noatime 0 1
UUID=f1e7eedd-66e0-4e86-821d-f57b1fa2c0ca /home ext2 defaults,noatime 0 1

tmpfs /var/log tmpfs size=1M 0 0

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2011-08-08 00:26:59

Vieira
Member
From: Lisbon, Portugal
Registered: 2007-08-16
Posts: 45

Re: Unmounting Filesystem Failing

I have the same problem. My fstab:

# <file system>        <dir>         <type>   <options>             <dump> <pass>
devpts                 /dev/pts      devpts   defaults              0      0
shm                    /dev/shm      tmpfs    nodev,nosuid          0      0

#/dev/cdrom             /media/cd   auto      ro,user,noauto,unhide 0      0
#/dev/dvd               /media/dvd  auto      ro,user,noauto,unhide 0      0
#/dev/fd0               /media/fl   auto      user,noauto           0      0

/dev/disk/by-label/boot        /boot       ext2      defaults                    0      1
/dev/disk/by-label/linux            /             ext4      defaults,noatime        0      1
/dev/disk/by-label/home        /home     ext4      defaults,noatime        0      1
/dev/disk/by-label/swap        swap      swap     defaults                     0      0

Offline

#7 2011-08-08 00:46:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

Vieira: are you using laptop-mode-tools?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2011-08-08 00:51:13

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Unmounting Filesystem Failing

jasonwryan wrote:

Sure.

# <file system>        <dir>       <type>    <options>          <dump> <pass>
devpts                /dev/pts      devpts    defaults            0      0
shm                   /dev/shm      tmpfs     defaults            0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

UUID=78b9738e-dd5b-4616-a6dc-1ca8c96e0209 / ext2 defaults,noatime 0 1
UUID=f1e7eedd-66e0-4e86-821d-f57b1fa2c0ca /home ext2 defaults,noatime 0 1

tmpfs /var/log tmpfs size=1M 0 0

Hmm, nothing at all stands out here, and we we explicitly don't unmount API filesystems or anything else mounted on a RAM based FS. I'd be curious what's running right before the call to umount. Just before line 55 of /etc/rc.shutdown where everything is unmounted, can you stick in a call to ps and lsof?

/bin/ps aux > /ps.out; /usr/sbin/lsof > /lsof.out

Unrelated -- you don't need those /dev/{pts,shm} entries anymore. They're mounted by /etc/rc.sysinit. Also, your home should have a passno of 2, not 1, meaning fsck it after root. (reference fstab(5)).

Offline

#9 2011-08-08 01:00:51

Vieira
Member
From: Lisbon, Portugal
Registered: 2007-08-16
Posts: 45

Re: Unmounting Filesystem Failing

jasonwryan wrote:

Vieira: are you using laptop-mode-tools?

Yes, I am. I will try disabling it and report what happens.

EDIT: With !laptop-mode in rc.conf it works fine.
EDIT2: If you don't disable it but instead run sudo /etc/rc.d/laptop-mode stop before shutting down it also works fine.
EDIT3: As a temporary workaround I'm using this in /etc/rc.local.shutdown (without sleep it still fails)

/etc/rc.d/laptop-mode stop
sleep 1

Last edited by Vieira (2011-08-08 01:36:56)

Offline

#10 2011-08-08 09:17:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

falconindy wrote:

I'd be curious what's running right before the call to umount. Just before line 55 of /etc/rc.shutdown where everything is unmounted, can you stick in a call to ps and lsof?

Thanks Dave.

lsof.out: http://paste.pocoo.org/show/454616/
ps.out: http://paste.pocoo.org/show/454618/

I have since updated to 3.0 (and this included a laptop-mode-tools update): from the 6 or so reboots I have done, I can now only reproduce the failure if I only boot into (and remain in TTY), if I start X, then the filesystems are unmounted cleanly.

Unrelated -- you don't need those /dev/{pts,shm} entries anymore. They're mounted by /etc/rc.sysinit. Also, your home should have a passno of 2, not 1, meaning fsck it after root. (reference fstab(5)).

Thanks for the tip!


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2011-08-08 09:45:06

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Unmounting Filesystem Failing

root      1672  0.0  0.0   3480   676 ?        S    21:15   0:00 /bin/sh /usr/sbin/laptop_mode stop
root      1673  2.0  0.0   3596  1288 ?        S    21:15   0:00 /bin/sh /usr/sbin/laptop_mode stop
root      2063  0.0  0.0   3596   728 ?        S    21:15   0:00 /bin/sh /usr/sbin/laptop_mode stop

So you stop laptop_mode in rc.local.shutdown, right? It looks the command runs in the background and takes a little long to finish.
The reason why shutting down from X hides the problem is there are more programs to kill, thus more time for laptop_mode to stop.
Correct me if I'm wrong.

Edit:
* If this is the case, would it be correct to file a bug for laptop-mode?
* Would adding -l flag to the umount command be a good idea? (I think not...)

Last edited by lolilolicon (2011-08-08 09:55:46)


This silver ladybug at line 28...

Offline

#12 2011-08-08 09:52:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

lolilolicon wrote:

So you stop laptop_mode in rc.local.shutdown, right? It looks the command runs in the background and takes a little long to finish.
The reason why shutting down from X hides the problem is there are more programs to kill, thus more time for laptop_mode to stop.
Correct me if I'm wrong.

No: I think you are right on the money smile

So I just need to kill it manually when in TTY.

Vieira, if you can confirm, I'll report this to the LMT ML.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2011-08-08 10:01:25

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Unmounting Filesystem Failing

This is bad behavior in initscripts as far as I can tell. We're supposed to wait for everything to exit before proceeding to unmount/remount. That's clearly not happening here.

Offline

#14 2011-08-08 14:30:08

Vieira
Member
From: Lisbon, Portugal
Registered: 2007-08-16
Posts: 45

Re: Unmounting Filesystem Failing

jasonwryan wrote:
lolilolicon wrote:

So you stop laptop_mode in rc.local.shutdown, right? It looks the command runs in the background and takes a little long to finish.
The reason why shutting down from X hides the problem is there are more programs to kill, thus more time for laptop_mode to stop.
Correct me if I'm wrong.

No: I think you are right on the money :)

So I just need to kill it manually when in TTY.

Vieira, if you can confirm, I'll report this to the LMT ML.

I always need to stop it otherwise it fails. Even with /etc/rc.d/laptop-mode stop in rc.local.shutdown it fails if I don't put a sleep 1 after that. I think lolilolicon is right.

Last edited by Vieira (2011-08-08 15:19:02)

Offline

#15 2011-08-08 16:46:46

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Unmounting Filesystem Failing

falconindy wrote:

This is bad behavior in initscripts as far as I can tell. We're supposed to wait for everything to exit before proceeding to unmount/remount. That's clearly not happening here.

Could this be the cause of my unmounting failure as well?

I'm going to assume it is, and post the output of the ps and lsof commands you suggested over there.  Please take a look!


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#16 2011-08-08 21:25:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

falconindy wrote:

This is bad behavior in initscripts as far as I can tell. We're supposed to wait for everything to exit before proceeding to unmount/remount. That's clearly not happening here.

Is that an invitation to file a bug report?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#17 2011-08-09 04:06:58

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Unmounting Filesystem Failing

You don't need my blessing to open a bug report about broken behavior. If all else fails, we'll close it as won't fix, insult your mother, and make scathing remarks about your forum moderator skills.

Offline

#18 2011-08-09 04:17:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

That's what I love about this distro: you get exactly what it says on the box...

# edit: https://bugs.archlinux.org/task/25472


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#19 2011-08-12 10:25:58

ValdikSS
Member
Registered: 2011-03-30
Posts: 31

Re: Unmounting Filesystem Failing

To fix error you can disable mount options (CONTROL_MOUNT_OPTIONS=0) in /etc/laptop-mode/laptop-mode.conf

Offline

#20 2011-08-13 07:04:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Unmounting Filesystem Failing

ValdikSS wrote:

To fix error you can disable mount options (CONTROL_MOUNT_OPTIONS=0) in /etc/laptop-mode/laptop-mode.conf

This doesn't work for me.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#21 2011-08-13 12:50:14

schlumpfimsumpf
Member
Registered: 2011-08-13
Posts: 29

Re: Unmounting Filesystem Failing

It worked for me. I disable CONTROL_MOUNT_OPTIONS and added noatime to root partition options in /etc/fstab (its basicly the same thing laptop-mode does).

Offline

#22 2011-09-04 20:33:12

libsandwich
Member
Registered: 2010-12-29
Posts: 6

Re: Unmounting Filesystem Failing

I've just encountered this problem on my netbook. I'm currently using Vieira's trick of telling laptop mode to stop in /etc/rc.local.shutdown. It seems to be an adequate fix for the moment. Hope this gets worked out soon.

Offline

#23 2011-09-12 03:01:39

neoanima
Member
Registered: 2008-05-08
Posts: 40

Re: Unmounting Filesystem Failing

Vieira wrote:
jasonwryan wrote:

Vieira: are you using laptop-mode-tools?

Yes, I am. I will try disabling it and report what happens.

EDIT: With !laptop-mode in rc.conf it works fine.
EDIT2: If you don't disable it but instead run sudo /etc/rc.d/laptop-mode stop before shutting down it also works fine.
EDIT3: As a temporary workaround I'm using this in /etc/rc.local.shutdown (without sleep it still fails)

/etc/rc.d/laptop-mode stop
sleep 1

Yep, with those two lines left in the file /etc/rc.local.shutdown.   the umounting-fail problem is gone. thanks.

but as Vieira said, it is a workaround, hope the bug behind it can be fixed.

Offline

#24 2011-09-12 10:59:59

dobedo
Member
From: Belgium
Registered: 2008-10-04
Posts: 113

Re: Unmounting Filesystem Failing

Another workaround is to set a hook at shutdown https://wiki.archlinux.org/index.php/Ar … stom_hooks.
In the 'shutdown_postkillall' hook, I've put a 'sleep 5'.

Offline

Board footer

Powered by FluxBB