From bcd23681ce21dbb0bfd646522abd97fa84f7eca6 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sat, 22 Aug 2020 16:21:37 +0200 Subject: [PATCH] List open files when unmount fails --- .config/zsh/plugins/functionsPost.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/zsh/plugins/functionsPost.zsh b/.config/zsh/plugins/functionsPost.zsh index f8e3865..fa57845 100644 --- a/.config/zsh/plugins/functionsPost.zsh +++ b/.config/zsh/plugins/functionsPost.zsh @@ -327,6 +327,9 @@ safe-remove() { [ -e "$1" ] || return 1 sync - udisksctl unmount -b "$1" || return 1 + if ! udisksctl unmount -b "$1"; then + lsof "$1" + return 1 + fi udisksctl power-off -b "/dev/$(lsblk -no pkname "$1")" }