14

In an AWS EC2 instance, we have multiple EBS volumes. When I try to detach any of them, the umount command works, but the device can't be detached.

# grep -c xvdj /proc/mounts 
0

However, lsof reports that jbd2 is using the device.

# lsof | grep xvdj
jbd2/xvdj  2896             root  cwd       DIR              202,1     4096          2 /
jbd2/xvdj  2896             root  rtd       DIR              202,1     4096          2 /
jbd2/xvdj  2896             root  txt   unknown                                        /proc/2896/exe

# ps u -p 2896
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      2896  0.0  0.0      0     0 ?        S    Jul20   0:02 [jbd2/xvdj-8]

How can I stop this process, so the device is released?

Ayose
  • 141

1 Answers1

3

The only way I found was to comment out the device in /etc/fstab and reboot. Apparently, jbd2 is activated by the kernel, as soon as the device is mounted during boot.

On a second note though, the system obviously manages to unmount the filesystem during shutdown so there must be a better way.