Public bug reported:

I have an ext4 partition (/dev/sda6) mounted to /tmp at boot time via
/etc/fstab. If I try to perform fsck and therefore umount it after
stopping all processes which have open files on /tmp, I always get the
error

/dev/sda6 is in use.
e2fsck: Cannot continue, aborting.

The error occurs even though the umount umount command succeeded and the 
partition is definitely not mounted anymore. After some trying I found out that 
systemctl uses systemd-fstab-generator to manage "mount units" generated from 
fstab at boot time. So I tried "systemctl stop tmp.mount" and I did not get the 
error. My conclusion is, that systemd MUST do something in addition to a normal 
umount call, although "ExecUnmount" is set to "/bin/umount /tmp -c" (I even 
tried the -c option manually without success). What can be the difference? The 
fstab entry is:
"/dev/disk/by-label/TEMP  /tmp  ext4  auto,rw,data=journal"

I also tried not to use the partition label but /dev/sda6 directly
instead, but that did not help.

The problem also does not occur, when removing the entry from fstab,
rebooting and then mounting / unmounting it manually.

I wonder if calling the umount command directly is not recommended
anymore since systemd has taken over the control about the fstab-mounts?
What is systemd exactly doing when unmounting the partition in
difference to the bare umount command?

Steps to reproduce the error:
- Booting the system
- Stopping all relevant processes to make sure that there are not open 
filepointers under /tmp
- umount /tmp
- fsck.ext4 /dev/sda6

Steps to reproduce the expected behaviour (no error):
- Booting the system
- Stopping all relevant processes
- systemctl stop tmp.mount
- fsck.ext4 /dev/sda6

I am using 
- Ubuntu 18.04.1 LTS
- Kernel 4.15.0-30-generic
- e2fsck 1.44.1

** Affects: ubuntu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1786004

Title:
  /tmp Partition still in use after umount

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1786004/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to