All of lore.kernel.org
 help / color / mirror / Atom feed
* Cannot umount ext4 fs, no user-space procs using the fs, lsof points to jbd2
@ 2016-07-07 23:38 Kamran Khan
  2016-07-08  2:39 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Kamran Khan @ 2016-07-07 23:38 UTC (permalink / raw)
  To: linux-ext4

Hi,

I am unmounting an ext4 filesystem (Ubuntu 16.04), fuser shows that no
user-space processes are holding a handle to it:

> root@kakhan-ubuntu:/# fuser -vm /oldroot
>                      USER        PID ACCESS COMMAND
> /oldroot:            root     kernel mount /oldroot

lsof gives this:

> root@kakhan-ubuntu:/# lsof | grep sda
> jbd2/sda1  368                  root  cwd       DIR               0,20      340          2 /
> jbd2/sda1  368                  root  rtd       DIR               0,20      340          2 /
> jbd2/sda1  368                  root  txt   unknown                                        /proc/368/exe

If I look into /proc/../mounts I see lots of kernel specific processes
which have /dev/sda1 listed in their mounts:

> root@kakhan-ubuntu:/# find /proc -name mounts | xargs grep /dev/sda1
> /proc/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/1/task/1/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/1/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/2/task/2/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/2/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/3/task/3/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/3/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/5/task/5/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/5/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> /proc/7/task/7/mounts:/dev/sda1 /oldroot ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
> # and whole bunch of others ...)

I am unable to unmount the filesystem:

> root@kakhan-ubuntu:/# umount /oldroot
> umount: /oldroot: target is busy
>         (In some cases useful info about processes that
>          use the device is found by lsof(8) or fuser(1).)

Can anyone please provide some pointers on how should I proceed with
unmounting the filesystem?

(Context: I copied binaries into a tmpfs and did a pivot_root to it,
i.e., the opposite of what happens from initramfs during boot. I
killed all the userspace processes holding a handle to the oldroot.
This issue is different than the one I faced a couple of months ago
during the same exercise on CentOS [1], where systemd-udevd needed a
restart to release the handle to the old filesystem. In this case
there's no userspace procs accessing the mountpoint.)

[1] http://permalink.gmane.org/gmane.comp.file-systems.ext4/53314

-- 
Kamran.

http://inspirated.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-08  2:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 23:38 Cannot umount ext4 fs, no user-space procs using the fs, lsof points to jbd2 Kamran Khan
2016-07-08  2:39 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.