Getting messages during shutown

I am new to the forum and at best a novice user , at best I can install manjaro and do a few very basic commands .
What I am experiencing is every time I go to restart or power down I get a message for a brief second saying:
sd-umoun[1695]: Failed to unmount /oldroot: Device or resource busy
shutdown[1]: Failed to finalize file systems, ignoring

I have been living with this for some time , tried different kernels , different NVIDIA drivers .
As of 1-19-2021 I just got a major upgrade and installed it new drivers and kernal 5.10.7.3
the problem does not seem to efect anything , just annoying . Tried googling the issue seems to be a common issue with no fix I understand

1 Like

Welcome at the forum, @brothergc

Just add the “shutdown” hook to your /etc/mkinitcpio.conf at the end of this line

HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

and rebuild initramfs by

sudo mkinitcpio -P

Reference for background information:
mkinitcpio - ArchWiki

4 Likes

Hi @brothergc , and welcome!

I can confirm this. I am getting the same. What I’ve found so far, and anyone is welcome to correct me if I’m wrong, it is a bug in systemd, with no fix so far (as you said.)

Luckily it doesn’t seem to affect anything (at least not that I know of.) So it does seem safe as it is, but it is annoying as heck! And then some.

Hope this helps.

Edit:
Scratch this! What @Wollie said!!!

OH MY SNACK!!!

THANK YOU! THANK YOU!! THANK YOU FOR THIS!!!

1 Like

ok I opened a terminal and typed " sudo nano /etc/mkinitcpio.conf"
and at the bottom of the page added " HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)"
ran " sudo mkinitcpio -P"
no change :frowning:
Sorry I probably messed it up or misunderstand
I also added " #hooks=shutdown " to the file and tried that nothing :frowning:
oh well probably beyond my abilities

Hi @brothergc ,

No, it’s not beyond your abilities. I used to think that as well, but it’s not. At least not anymore. All you need is a willingness to learn. To not stagnate.

Anyway, you were correct in using the terminal. So open it again and edit the file again:

sudo nano /etc/mkinitcpio.conf

Look for a line starting with HOOKS=(. Add shutdown to the list in the line, so that it’s:

HOOKS="base shutdown udev autodetect modconf block keyboard keymap resume filesystems"

(Or something very similar.)


Edit:
Remember to remove the line you added in it.


Save the file by pressing Ctrl+O and exit nano byt pressing Ctrl+X.

When back at the command line, run

sudo mkinitcpio -P

to rebuild mkinitcpio.

Those were my steps, and it seems to have worked a charm!

Hope this helps.

2 Likes

Thank @Wollie . Been having the same errors for months but kept ignoring them as it wasn’t causing issues. :+1::+1:

1 Like

now I am in worse condition when I run

sudo mkinitcpio -P
I get "Invalid config: No hooks found"

I have 2 etc/mkinitcpio.conf files in my machine
one is that has a output that reads like this

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=""

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
# HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
#HOOKS="base udev autodetect modconf block keyboard keymap resume filesystems shutdown  "

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
#COMPRESSION="zstd"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Then their is another that is called " OSTREE mkinitcpio.conf
it reads:

HOOKS="base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "

I apreciate the help but I seem to be digging a hole here

ok maybe I screwed up , I just deleted the mkinitcpio.conf file and tried to recreate it , that helped BUT now I get ERROR: Hook ‘fsk’ cannot be found

what is " FSK" hook ?

looks like you deleted a C from FSCK

(should be lower case - fsck)

If I’m incorrect, someone please tell me. I don’t want to break @brothergc’s system.

That said, I think you can safely “merge” the two files. I don’t know how else to put it, so let me explain:

  1. Copy this line from the second file:
HOOKS="base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "
  1. Remove (deleete) the second file.
  2. Open the first file, as root (using sudo).
  3. Search for the line starting with HOOKS=". Nothing else. Just HOOKS=".
  4. Delete the whole line. (NOTE: Depending on you editor and/or preferences “line wrapping” might be on, causing it to look like 2 or more lines while it is, in fact, only one line.)
  5. Paste the line copied earlier, replacing the line starting with HOOKS=", so that it resembles:
HOOKS="base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "
  1. Edit the pasted line and add the shutdown hook between the words in quotes. For example:
HOOKS="shutdown base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "
  1. Save the file and exit your editor. Head back to the terminal if not already there.
  2. Run the following command as a normal user, to rebuild mkinitcpio:
sudo mkinitcpio -P
  1. Reboot.

Please note again:

This is how my logic think it’ll have to work. It’s what I would’ve done in the same situation. If someone can verify this, it’d be wonderful!


Hope it helps!

ok I believe it is fixed , the messages are gone ! Yahhoo !! I am not getting on startup some message like " cleaned blocks 0000 on nvme"
but I had to add to the 1st line on the config file " HOOKS=(base)"
then add "
HOOKS="shutdown base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "
On the second line
When I tried just adding only the
"HOOKS="shutdown base systemd ostree autodetect modconf block filesystems keyboard fsck shutdown "
the cleaning blocks on boot up would disappear so I added it back in

oops new problem , new message
" watchdog timer did not stop"
I Think I can fix that one …lets see

nope , LOL oh well … welcome to the world of bleeding edge open source . and now I got some other messages . :slight_smile: no big deal still beats windows 10

Is there a difference between the shutdown hook and the mkinitcpio-generate-shutdown-ramfs.service? If not which one is preferred?

Basically, what they were saying was, the line starting with HOOKS= that did not have a # in front of it, add the word shutdown at the end of the other words inside the parentheses.

Hi, I used the guide here to disable the watchdog on my system: Arch Watchdog:

  1. To add kernel parameter: sudo nano etc/default/grub
  2. on the line starting GRUB_CMDLINE_LINUX_DEFAULT=" I added nowatchdog, so my line read for example GRUB_CMDLINE_LINUX_DEFAULT="quiet nowatchdog udev.log_priority=3" and saved the file
  3. ran sudo update-grub to update my grub
  4. Just to make sure, I also blacklisted iTCO_wdt by creating the file /etc/modprobe.d/blacklist.conf and added blacklist iTCO_wdt in that file. You may already have a blacklist.conf here, or other other .conf files; I believe you can just add as many .conf files with modules to blacklist in as you wish (so you could add e.g. nowatchdog.conf if you don’t want to edit anything already present), but I prefer to keep everything in the same file :slight_smile:
  5. Watchdog should no longer be present after reboot!
1 Like

Yes, there is a difference.

mkinitcpio-generate-shutdown-ramfs.service is a systemd service, you can see the content of the script by entering

systemctl cat mkinitcpio-generate-shutdown-ramfs.service

You can see the script of the shutdown hook by

cat /usr/lib/initcpio/install/shutdown

shutdown hook is needed e.g. when you have /usr mounted on a separate partition.

There is no preference for one or the other, afaik.

1 Like

that did it and all I had to do was make the blacklist.conf file . all messages are now gone . Did not have to do all You suggested just make the file
thanks to all who helped it has been a learning experience

2 Likes