0

I just installed Debian 10 from disk. Whenever I shutdown, I get a single message displayed on screen, "Failed to unmount /usr/". What can I do to correct this? Is this error likely causing damage to the drive or data in /usr?

I have separate partitions for /boot (ext2), /usr/ (ext4), /var/ (ext4), /usr/local/ (ext4), /tmp/ (ext2), and /home (ext4).

Village
  • 4,655
  • 14
  • 46
  • 80
  • 5
    Does this answer your question? [Why do I get the error "failed unmounting /var" during shutdown?](https://unix.stackexchange.com/questions/378678/why-do-i-get-the-error-failed-unmounting-var-during-shutdown) – TommyPeanuts Dec 26 '20 at 09:00
  • [Putting `/usr` on a separate disk was originally done in v6 unix in the 1970s.](http://lists.busybox.net/pipermail/busybox/2010-December/074114.html) On modern systems it is regarded as an unnecessary complication, and the tools used with `systemd` require libraries that are normally installed under `/usr`. Several commercial unixes have already removed the separation between `/[s]bin` and `/usr/[s]bin`; Solaris did that 15 years ago. [Linux distributions are considering to go that way also.](https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/) – telcoM Dec 26 '20 at 23:04

1 Answers1

0

From what I see in other posts, having the OS installed on two serperate drives or partitions may cause this. Kali and Ubuntu users have reported the same issue. The problem is journald and how it is still logging to /var while systemd is trying to unmount it. According to this thread, there are two ways to go about it:

  1. Make journald log to a volatile location in /run so it doesn't lock /var, but the tradeoff is that you lose logs at shutdown.

    Edit /etc/systemd/journald.conf to change the Storage= line to

    Storage=volatile

  2. Or set up a shutdown hook to unmount /var later. This won't remove the failed message as systemd will still try to unmount /var but will indeed unmount /var properly at the end of the shutdown sequence. You just won't see it.

    Add a shutdown hook to mkinitcpio's HOOKS= array, e.g. :

    HOOKS="base udev autodetect block keymap encrypt lvm2 filesystems usbinput fsck var shutdown"

Trevor Hummer
  • 187
  • 2
  • 12
  • Hi - thanks for the options. How do i add a hook for Ubuntu systems that use initramfs? – WillZ Jun 06 '20 at 10:11
  • Unlike Arch, Debian/Ubuntu don't seem to go back to initramfs on shutdown, so Arch's hook solution will not be applicable to them. The kernel will unmount and shut down any remaining filesystems within the kernel-level controlled shutdown procedure anyway, so this should be essentially just a nuisance error message. – telcoM Dec 26 '20 at 23:11