Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a file system with two HDDs and several partitions mounted separately locally.

/root, /home, /usr, /var, /local/share, /home/bernhard/fotos/bilder, /backup are on separate partitions and are all "ext3".

During unmounting the message "unmounting local file system" does not appear any further and when booting all partitions but the root partition have to reload the journal, which indicates improper unmounting. The root partition and /usr are on sda, the others on sdb or further usb-mounted devices. the only partition unmounted w/o problem seems to be the root partition on sda4.

I wonder whether the script to umount all devices has a "wait for success" loop or that the script itself got corrupted. However, yesterday I upgraded to 11.04 and the error persists.

pmount does not look to be appropriate since the device are not hot-plugged but simply mounted during system start. Obviously mounting /usr and afterwards /usr/local/share as well as /home and later /home/bernhard/fotos/bilder presents problems for umount; the devices may be busy and thus not properly unmounted.

Does anybody have an idea for a script to organize unmounting in an ordered way? How to wait for unmounting of the secondary mount? Do you know as well where to place such a script that it will be used instead of the original umount command?

Could be a general solution.

share|improve this question

1 Answer 1

I don't have a 11.04 here to experiment with, but it seems to me that the /etc/init.d/umountfs script should do the unmounting. There you will find that all regular mountpoints are passed to umount in a single invocation. It is left to umount to process those in a sensible order, which it in my opinion should be capable of. There appears to be no “Wait for success” loop in that script. And even if some device wasn't unmounted successfully, umount -r should mount those filesystems read-only, so there should be no need for a log replay.

In order to obtain more information on this problem, you might whish to edit that script in one or more of the following ways:

  • Set VERBOSE=yes so you will see more output
  • Place a sleep 20 at the beginning and end of do_stop, each preceeded by a suitable echo. That way, you will see what output originates from that script, and have time to actually read it during shutdown. Of course, you should disable your splash screen so you will actually see this output.
  • Perhaps also do a set -x so you can see the internal workings of the shell script, the arguments passed to umount in particular.
  • Even spawn a shell in there, so you can experiment during shutdown, e.g. to identify reasons why some file system is busy and cannot be unmounted.
  • Try to add your own ordering logic, using normal bash syntax to either order the arguments to umount or to perform multiple invocations of umount. I think this should not be necessary if the script works as intended, and if it does not work as intended there should be some kind of error message. So I'd only implement this if there is no other clue as to what goes wrong.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.