You are not logged in.

#1 2017-04-11 16:06:35

regid
Member
Registered: 2016-06-06
Posts: 213

why /usr and /var failed to unmount at shutdown?

I suggest jumping straight ahead to msg#7. (How could I link to that message?)

Currently, I have an empty /run/initramfs.

% ls /run/initramfs
%

Am I right that I can somehow have a shutdown initramfs image there? How can I create it, probably with mkinitcpio-generate-shutdown-ramfs.service and sd-shutdown somehow mentioned in /etc/mkinitcpio.conf?
The goal is to eliminate

Failed unmounting /usr.
Failed unmounting /var.

at shutdown.
Am I right the /usr issue might be easier to handle because /var is probably busy with collecting journal messages?

Last edited by regid (2017-04-12 08:30:53)

Offline

#2 2017-04-11 18:10:27

ReiserFS
Member
Registered: 2014-02-01
Posts: 57

Re: why /usr and /var failed to unmount at shutdown?

mkinitcpio-generate-shutdown-ramfs.service will create it at shutdown!

Offline

#3 2017-04-11 19:13:13

regid
Member
Registered: 2016-06-06
Posts: 213

Re: why /usr and /var failed to unmount at shutdown?

  1. Am I right mkinitcpio-generate-shutdown-ramfs.service doesn't write something, perhaps to journal, to indicate its actions?

  2. Since /usr and /var failed to unmounted, should I add something to the mkinitcpio.conf that is evidentaly missing?

  3. Can I get a shell prompt to examine what is going on?

Offline

#4 2017-04-11 21:45:07

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: why /usr and /var failed to unmount at shutdown?

Take a look to the log. It should tell you why it cannot unmount the folders.

journalctl -r -b -1
journalctl -r -b -1 --system

-r --reverse             Show the newest entries first
-b --boot[=ID]          Show current boot or the specified boot (-1 = last boot)
--system                 Show the system journal (otherwise user journal)

Last edited by Maniaxx (2017-04-11 22:00:55)


sys2064

Offline

#5 2017-04-11 22:45:09

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Re: why /usr and /var failed to unmount at shutdown?

Maniaxx wrote:

--system                 Show the system journal (otherwise user journal)

man 1 journalctl wrote:

       All users are granted access to their private per-user journals. However, by default, only root and users who are members of a few special groups are granted access to the system journal and the
       journals of other users. Members of the groups "systemd-journal", "adm", and "wheel" can read all journal files. Note that the two latter groups traditionally have additional privileges specified by
       the distribution. Members of the "wheel" group can often perform administrative tasks.
....
       --system, --user
           Show messages from system services and the kernel (with --system). Show messages from service of current user (with --user). If neither is specified, show all messages that the user can see.

$ journalctl -b -1 --unit=mkinitcpio-generate-shutdown-ramfs.service
$ journalctl -b -1 --unit=var.mount

Assuming user meet the criteria mentioned above.

Offline

#6 2017-04-11 23:53:54

regid
Member
Registered: 2016-06-06
Posts: 213

Re: why /usr and /var failed to unmount at shutdown?

journalctl -r -b -1 -o cat

has:

Failed unmounting /var.
var.mount: Mount process exited, code=exited status=32 

  and

Failed unmounting /usr.
usr.mount: Mount process exited, code=exited status=32 

mount.8 states that 32 is the return code for mount failure.
I wonder why /home didn't fail too. I can't understand the log more in order to know what else to look for.

As an aside, actually there is a line

Starting Generate shutdown-ramfs...

I haven't noticed it before.

Offline

#7 2017-04-12 07:53:35

regid
Member
Registered: 2016-06-06
Posts: 213

Re: why /usr and /var failed to unmount at shutdown?

Reraeding the replies so far, here is what I got:

# journalctl -o cat -r -b -1 --unit=mkinitcpio-generate-shutdown-ramfs.service
Started Generate shutdown-ramfs.
==> Build complete.
Starting Generate shutdown-ramfs...
  -> Running build hook: [sd-shutdown]
==> Starting build: none
# journalctl -o cat -r -b -1 –unit=var.mount
Failed unmounting /var.
var.mount: Mount process exited, code=exited status=32
Unmounting /var...
Mounted /var.
Mounting /var...
# journalctl -o cat -r -b -1 –unit=usr.mount
Failed unmounting /usr.
usr.mount: Mount process exited, code=exited status=32
Unmounting /usr...

Offline

#8 2017-04-13 16:17:31

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: why /usr and /var failed to unmount at shutdown?

Remove the unit filter and look manually.


sys2064

Offline

#9 2017-04-13 23:02:01

regid
Member
Registered: 2016-06-06
Posts: 213

Re: why /usr and /var failed to unmount at shutdown?

  • I removed the unit filters. I can't see anything related, though there are some problematic lines. I don't know if they are realted.

  • Google found https://github.com/systemd/systemd/issues/5099. It might be related. There is a post by 74teTItm commented on Apr 13 2017.

Offline

#10 2017-04-14 17:59:04

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: why /usr and /var failed to unmount at shutdown?

Maybe you can tell some more about your hardware and OS situation. How long are you using this Arch installation? Was the error always there? What have you installed/changed yet (compared to clean/vanilla installation)? Looks like there is still something running in the background (that can't be terminated) that prevents proper unmount.

Can you post a log (journalctl -b -1) on pastebin (strip out any personal data if applicable)?


sys2064

Offline

#11 2017-04-15 11:59:45

regid
Member
Registered: 2016-06-06
Posts: 213

Re: why /usr and /var failed to unmount at shutdown?

It is an old laptop, running arch from Aug-2016. I think the umount failures at shutdown are right from that time. Just basic desktop software, I would say. Pretty much vanila, unless you consider LVM and /usr ro not so.

  • Log has a bunch of mandb lines. I wonder how come it doesn't pay attention to /usr being ro.

  • Some of the fsck seem to be terminated after their fs was unmounted. This happens both to fs which were unmounted successfuly, and to fs that were not.

journalctl -b -1 -r -o short-monotonic --no-hostname

olegabrielz wrote:

Please edit your post and use pastebin

journal is at http://pb.net9.cf

Last edited by regid (2017-04-17 21:00:24)

Offline

#12 2017-04-15 12:50:45

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: why /usr and /var failed to unmount at shutdown?

Hi there regid

Please edit your post and use pastebin on large amounts of output:
https://wiki.archlinux.org/index.php/Co … s_and_code


Be aware of my Newbie Powers

Offline

#13 2017-04-15 13:03:02

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Re: why /usr and /var failed to unmount at shutdown?

If it fits into a single post then using code tags is fine.

Offline

#14 2017-04-15 13:17:58

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: why /usr and /var failed to unmount at shutdown?

loqs wrote:

If it fits into a single post then using code tags is fine.

For those who uses GUI browsers, sure. But for those with text based ones, it could be a pain:
https://bbs.archlinux.org/viewtopic.php … 7#p1702197


Be aware of my Newbie Powers

Offline

#15 2017-04-15 13:33:08

loqs
Member
Registered: 2014-03-06
Posts: 19,184

Re: why /usr and /var failed to unmount at shutdown?

@olegabrielz can you provide a link to a post by a moderator asking for a code block that fits a single post be moved to a pastebin as it is too long.
Edit:
@regid

[    5.423575] systemd-fsck[182]: usr-lv: clean, 100848/960992 files, 828243/3840000 blocks
....
[   18.494563] systemd-fsck[293]: var-lv: clean, 2184/640848 files, 388972/2560000 blocks

As the filesystems are clean it indicates to me in the very final stage stage of shutdown systemd attemps to unmount all mounted filesystems again and succeeds otherwise the filesystems would not be marked as clean.

Last edited by loqs (2017-04-15 14:04:26)

Offline

#16 2017-04-15 14:01:19

olegabrielz
Member
From: Norway
Registered: 2015-12-23
Posts: 255

Re: why /usr and /var failed to unmount at shutdown?

@loqs: Nope. That would almost never happen. And that wasn't in my intention to assert. But in fairness Maniaxx did ask to provide output from journalctl -b -1 on pastebin:
https://bbs.archlinux.org/viewtopic.php … 0#p1704330

I don't think we should use posts in this thread to discuss this subject. We can continue discussing it in my thread. If I do provide bad advices or wrong information, I want people to point it out to me. I'm just trying to help out the way I can.


Be aware of my Newbie Powers

Offline

#17 2017-04-15 22:06:44

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: why /usr and /var failed to unmount at shutdown?

Sorry, i can't see anything helpful. Maybe its possible to get a more verbose log somehow of that umount command.


sys2064

Offline

Board footer

Powered by FluxBB