1

I'm SSHed into my computer at home and I'm trying to format a drive.

lsof /dev/sdb2 shows:

COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    1366 mitch  cwd    DIR   8,18    24576    5 /media/mitch/1TBHDD

This is causing umount to not unmount that drive. I've tried killing the process with kill and kill -9 but each time, that /bin/bash process will come back under a new PID but still using /dev/sdb2

How do I kill this bash that just won't seem to die?

Some relevant outputs:

mitch@emerald /proc $ ps aux | grep bash
mitch     2339  0.0  0.0  23732  5048 pts/11   Ss   12:10   0:00 -bash
mitch     3711  0.2  0.0  23688  4780 pts/0    Ss+  14:01   0:00 /bin/bash
mitch     3781  0.0  0.0  11748   912 pts/11   S+   14:01   0:00 grep --colour=auto bash
mitch    14159  0.0  0.0  23628  4688 pts/9    Ss+  Jan04   0:00 /bin/bash

mitch@emerald /proc $ lsof /dev/sdb2
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    3711 mitch  cwd    DIR   8,18    24576    5 /media/mitch/1TBHDD
2
  • What does pstree -ps 3711 say? (Replace 3711 with whatever PID of bash you get from lsof) – muru Jan 5 '15 at 19:12
  • That did it. The output was init(1)───mdm(1405)───mdm(1431)───cinnamon-sessio(1935)───nemo(2488)───bash(3711).. I'll post an answer with the solution – Mitch Jan 5 '15 at 19:16
3

@muru had me look at the ps tree for that PID

pstree -ps 3711
init(1)───mdm(1405)───mdm(1431)───cinnamon-sessio(1935)───nemo(2488)───bash(3711)

So you see that nemo (Mint's file manager) is using it. This is because of an addon, nemo-terminal installed, which puts a bash shell in nemo. I guess that the behavior of when it dies is to immediately respawn the bash shell.

Killing PID 2488 did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.