You are not logged in.

#1 2013-07-29 10:47:02

abiotic
Member
Registered: 2012-04-10
Posts: 35

[SOLVED] Can't unmount /var and /usr when shutting down

Everytime I reboot/power off the machine, I get something like this:

Systemd[1]: Failed to unmount /usr
Systemd[1]: Failed to unmount /var

I can't find the errors anywhere in the logs and I barely have enough time to  catch a glimpse before the reboot.

I've already included the usr, fsck and shutdown hooks in mkinitcpio.conf.

HOOKS="base udev autodetect modconf block filesystems keyboard usr fsck shutdown"

And here are the fstab entries:

/dev/sda6           	/usr      	ext4      	rw,relatime,data=ordered	0 2
/dev/sda7           	/var      	ext4      	rw,relatime,data=ordered	0 2

What am I doing wrong?

Last edited by abiotic (2013-08-03 10:11:29)

Offline

#2 2013-07-29 11:00:14

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

Re: [SOLVED] Can't unmount /var and /usr when shutting down

abiotic wrote:

What am I doing wrong?

Nothing. The shutdown hook doesn't affect systemd's inability to umount filesystems which are in use. What it does provide is a copy of the initramfs to pivot back to on shutdown where these filesystems can be umounted via a separate script.

Offline

#3 2013-07-29 13:25:14

abiotic
Member
Registered: 2012-04-10
Posts: 35

Re: [SOLVED] Can't unmount /var and /usr when shutting down

So they are unmounted correctly after those error messages?

Last edited by abiotic (2013-07-29 13:25:42)

Offline

#4 2013-07-29 15:06:11

drasticraft
Member
From: mars
Registered: 2013-07-05
Posts: 55
Website

Re: [SOLVED] Can't unmount /var and /usr when shutting down

Well, technically everything gets unmounted at shutdown, whether the system registers it a successful unmount is usually not important unless you were actively reading or writing to that partition.

Anyway,
There isn't really a good reason to have a separate /usr partition anymore.
I would suggest re-purposing that partition for /usr/local, you'll see that boot-up time might be a little faster.

Offline

#5 2013-07-29 16:09:23

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

Re: [SOLVED] Can't unmount /var and /usr when shutting down

abiotic wrote:

So they are unmounted correctly after those error messages?

If you don't see any messages from the shutdown pivot root, then yeah, they're unmounted correctly. You'll see in the log "Returning to initrd..." -- everything post that should be generated by the script I linked.

drasticraft wrote:

Well, technically everything gets unmounted at shutdown

Technically, no, not at all. Before the days of shutdown pivot roots, the best you could do was remount your root as read only. At the time of the actual ACPI poweroff or reboot, the kernel still has that filesystem in its mount table. I believe the kernel does call 'sync' just before this, so any potential damage to still-mounted filesystems is avoided or limited.

drasticraft wrote:

Anyway,
There isn't really a good reason to have a separate /usr partition anymore.
I would suggest re-purposing that partition for /usr/local, you'll see that boot-up time might be a little faster.

A call to mount is fast -- whether it happens in serial in the initramfs (to mount /usr) or in parallel in later userspace (to mount /usr/local) should be a negligible difference. I'm not sure why you suggest separating /usr/local as a better thing to do when the directory largely goes unused in the days of package manager based distros.

Offline

Board footer

Powered by FluxBB