Skip to main content
Topic: umount: /home: target is busy. (Read 2048 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

umount: /home: target is busy.

Very often my computer freezes with this error after doing sudo runit-init 0. If I do sudo poweroff it just does nothing. I have to unplug the computer.
Using linux-zen, runit, dwm.



Re: umount: /home: target is busy.

Reply #3
Code: [Select]
[ 3965.980368] F2FS-fs (sda2): inconsistent node block, nid:226942, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
[ 3965.980383] F2FS-fs (sda2): inconsistent node block, nid:226943, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
[ 3965.980390] F2FS-fs (sda2): inconsistent node block, nid:226944, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
...
This is the suspicious part. What is in your /etc/fstab? Meanwhile, I noticed your /dev/sdb1 uses ext4:
Code: [Select]
[    4.614194] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
A web search gives this kernel bug report, among other articles:
https://bugzilla.kernel.org/show_bug.cgi?id=208325

Re: umount: /home: target is busy.

Reply #4
UUID=3b59cd84-f7bf-4206-966a-5d8d302a8f17 / f2fs noatime 0 1
UUID=ABF7-DBE6 /boot vfat noatime 0 2
UUID=311356a0-40e4-440e-81ae-de791d5480f6 /home ext4 noatime 0 2
/swapfile none swap defaults 0 0

Re: umount: /home: target is busy.

Reply #5
I would check the f2fs partition /dev/disk/by-uuid/3b59cd84-f7bf-4206-966a-5d8d302a8f17 with fsck.f2fs, booting from the LiveUSB, as it likely has some errors.

Anyway, you might be experiencing the mentioned bug, which as of now still has "assigned" status.

Re: umount: /home: target is busy.

Reply #6
I would check the f2fs partition /dev/disk/by-uuid/3b59cd84-f7bf-4206-966a-5d8d302a8f17 with fsck.f2fs, booting from the LiveUSB, as it likely has some errors.

Anyway, you might be experiencing the mentioned bug, which as of now still has "assigned" status.
I have troubles with /home which is ext4, not f2fs.

Re: umount: /home: target is busy.

Reply #7
https://unix.stackexchange.com/questions/3109/how-do-i-find-out-which-processes-are-preventing-unmounting-of-a-device
You could try inserting some command to see what's using /home just before the umount and after all the processes have been killed in the runit shutdown script, it should be a normal shell script you can temporarily modify I think. That might give some clue. It's possible to get rogue unkillable processes sometimes, something else to try anyway.

Re: umount: /home: target is busy.

Reply #8
https://unix.stackexchange.com/questions/3109/how-do-i-find-out-which-processes-are-preventing-unmounting-of-a-device
You could try inserting some command to see what's using /home just before the umount and after all the processes have been killed in the runit shutdown script, it should be a normal shell script you can temporarily modify I think. That might give some clue. It's possible to get rogue unkillable processes sometimes, something else to try anyway.
Thank you. I will do this before every poweroff until I find the reason.

Re: umount: /home: target is busy.

Reply #9
I have troubles with /home which is ext4, not f2fs.
Your dmesg shows you have problems with your root partition, which is f2fs. Again:
Code: [Select]
[ 3965.980368] F2FS-fs (sda2): inconsistent node block, nid:226942, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
[ 3965.980383] F2FS-fs (sda2): inconsistent node block, nid:226943, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
[ 3965.980390] F2FS-fs (sda2): inconsistent node block, nid:226944, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0]
...

Re: umount: /home: target is busy.

Reply #10
Yet again it happened to me.
Luckily, I did lsof -f  -- /home before poweroff.
Here's its output:
Code: [Select]
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
startx      985 user  cwd    DIR   8,17     4096 27525121 /home/user
xinit      1005 user  cwd    DIR   8,17     4096 27525121 /home/user
Xorg       1006 user  cwd    DIR   8,17     4096 27525121 /home/user
Xorg       1006 user    4w   REG   8,17    49454 27525123 /home/user/.local/share/xorg/Xorg.0.log
Xorg       1006 user   27uw  REG   8,17       32 27918344 /home/user/.cache/nvidia/GLCache/efd719447d97d6c8ded677112723c96d/81dc952245174e67/0000000000000000.toc
Xorg       1006 user   28uw  REG   8,17       32 27918345 /home/user/.cache/nvidia/GLCache/efd719447d97d6c8ded677112723c96d/81dc952245174e67/0000000000000000.bin
dwm        1013 user  cwd    DIR   8,17     4096 27525121 /home/user
redshift   1014 user  cwd    DIR   8,17     4096 27525121 /home/user
pipewire   1016 user  cwd    DIR   8,17     4096 27525121 /home/user
pipewire-  1017 user  cwd    DIR   8,17     4096 27525121 /home/user
pipewire-  1018 user  cwd    DIR   8,17     4096 27525121 /home/user
bash      10191 user  cwd    DIR   8,17     4096 27525121 /home/user
lsof      10196 user  cwd    DIR   8,17     4096 27525121 /home/user
lsof      10196 user    1w   REG   8,17        0 27525355 /home/user/text.txt
lsof      10197 user  cwd    DIR   8,17     4096 27525121 /home/user
at-spi-bu 10820 user  mem    REG   8,17      907 29360150 /home/user/.config/dconf/user
[\code]

Re: umount: /home: target is busy.

Reply #11
What I meant was modify the script before the final umount - but don't do this unless you know how to unmodify it from a bootable usb or something if it caused problems, which is not impossible, note I'm using OpenRC and haven't tested this although I have done this kind of thing before. Although it might narrow it down when you did that, at this point in the shutdown all the processes should have been terminated I think.
Looking at the runit-rc package I think you could probably add it here:
Code: [Select]
/usr/lib/rc/sv.d/root

            mounts=("$target" "${mounts[@]}")
        done

        lsof -f  -- /home                      #<<< add this line and hope it works and prints something
        if (( ${#mounts[*]} )); then
            umount -r "${mounts[@]}" || return 1

Re: umount: /home: target is busy.

Reply #12
Using lazy umount would help immensely:

Code: [Select]
       -l, --lazy
           Lazy unmount. Detach the filesystem from the file hierarchy now, and clean
           up all references to this filesystem as soon as it is not busy anymore.

           A system reboot would be expected in near future if you’re going to use this
           option for network filesystem or local filesystem with submounts. The
           recommended use-case for umount -l is to prevent hangs on shutdown due to an
           unreachable network share where a normal umount will hang due to a downed
           server or a network partition. Remounts of the share will not be possible.