3

I have a laptop that refuses to suspend. On the latest Ubuntu, the only way I can turn it off is to hold down the power button.

The reason is because I have an nfs share that has gone offline, and something is still trying to commit data to it. I killed everything that was listed in sudo fuser, but it's still busy. Even the poweroff command gets stuck because it can't close the filesystem.

How can I find out what is still holding it, and either kill or unmount it, and force a suspend, instead of having to manually, forcibly, shut down?

1
  • 2
    Did you run fuser as root (sudo)?
    – yarl
    Commented Nov 17, 2021 at 17:07

2 Answers 2

1

Sometimes you might not see the file in any of the processes file descriptors, if the access to the file does not require opening it. For instance, the stat(2) system call will get the status of the file without actually opening it, so you will not see it in the process's file descriptors.

You can try searching for any processes that are in D state (Uninterruptible sleep), and use common sense to try to understand if that's the process that keeps the disk busy.

ps -eo pid,ppid,start,user,state,comm |grep -w D

If you're lucky, you will find the process that hold the NFS share and be able to kill it, and then unmount the disk.

1

If you aren’t too bothered about what’s holding you up and just want to shutdown/suspend etc, you should be able to use this to force the volume to unmount, with caveats about possible data loss (but can’t see it being any worse than a hard shutdown). Even so, you’d only really want to do it when the NFS is legitimately inaccessible.

umount -f -l /foo/nfs

For reference: https://linux.die.net/man/8/umount

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .