1

I have a system that has 1x SSD and 2x 4TB HDD working under software RAID1. (I'm currently upgrading from Linux Mint 20 to 22, another topic regarding that issue)

On my RAID1 I have LUKS encrypted filesystem, which is mounted under /storage

I'm trying to umount /storage by sudo umount /storage, but I receive an error umount: /storage: target is busy.

I tried also:

  • stopping the mdadm first by sudo mdadm --stop /dev/md0, but it returns Cannot get exclusive access to /dev/md0:Perhaps a running process, mounted filesystem or active volume group?
  • closing the encrypted volume by sudo cryptsetup luksClose raidcrypt, and it returns Device raidcrypt is still in use.
  • stopping my docker container, and removing it from starting automatically during boot (lsof | grep /storage noted that docker was running before I stopped it, but stopping it doesn't help with my initial problem)
  • stopped my pCloud device from mounting during boot
  • removed my swap from /etc/fstab which was mounted in as 8GB swapfile under /storage/swap/.swapfile

I'm bit worried to use umount -l here. I'm wondering if I should just remove /dev/mapper/raidcrypt /storage ext4 defaults 0 2 from my /etc/fstab.

0

1 Answer 1

1

You're trying to sudo umount /storage but you receive the error umount: /storage: target is busy. Your layered hierarchy is RAID1 / LUKS / Filesystem.

Start at the top of the hierarchy.

  1. /storage is in use, and you need to fix that before you can unmount it
  2. Once you've done that you can close the encrypted layer (LUKS)
  3. Then you can stop your RAID layer

Use lsof /storage to see which processes are in the way of your umount /storage. For example,

lsof /storage
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
bash    21164 root  cwd    DIR  254,0     4096    2 /storage

Here you can see that there's a bash process owned by root with PID 21164. If you can identify where that is from, you can clean it up. OTherwise you can shoot it down:

kill -1 21164

Repeat the lsof command to ensure there are no other processes using the filesystem, and then you will be able to unmount it:

umount /storage
2
  • Thank you! However, after night slept the target device /storage was no longer busy! Odd, but I'll take it. Commented Nov 1, 2024 at 7:15
  • In that case the process using it had exited. Nothing particularly unusual there, @RattletrapK Commented Nov 1, 2024 at 8:17

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.