Score:0

`sudo rm -rf /var/lib/docker/aufs` leads to `rm: cannot remove: Device or resource busy`

Problem:

  1. I have here one Ubuntu 20.04.6 LTS that I need to upgrade to 22.04 LTS;
  2. The sudo do-release-upgrade is being blocked by this error message:
Sorry, this storage driver is not supported in kernels for newer
releases

There will not be any further Ubuntu releases that provide kernel
support for the aufs storage driver.

Please ensure that none of your containers are using the aufs storage
driver, remove the directory /var/lib/docker/aufs and try again.
  1. I already did sudo apt remove docker*;
  2. I already did sudo apt remove aufs*;
  3. I still cannot do sudo rm -rf /var/lib/docker/aufs, because I get rm: cannot remove /var/lib/docker/aufs: Device or resource busy;
  4. I don't know why it is that way. I followed the instructions of the error message, but it cannot be executed.

Question: how can I discover what is preventing me from deleting the /var/lib/docker/aufs directory?

nobody avatar
gh flag
Should be dolable with `lsof /var/lib/docker/aufs`
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@nobody `sudo lsof /var/lib/docker/aufs` did not solve, nor `sudo rm -rv $(lsof /var/lib/docker/aufs)` nor `sudo rm -rv lsof /var/lib/docker/aufs`. Which syntax is expected?
nobody avatar
gh flag
lsof is only showing which prozess is accessing some file or folder `lsof /home/alex/.xsession-errors COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mate-sess 1156 alex 1w REG 8,19 68387 50090233 /home/alex/.xsession-errors mate-sess 1156 alex 2w REG 8,19 68387 50090233 /home/alex/.xsession-errors mate-sett 1294 alex 1w REG 8,19 68387 50090233 /home/alex/.xsession-errors mate-sett 1294 alex 2w REG 8,19 68387 50090233 /home/alex/.xsession-errors marco 1298 alex 1w REG 8,19 68387`
Hi-Angel avatar
es flag
Just reboot. The directory is likely used by `docker`, but you mention you removed `docker` whatsoever, so… I presume you didn't stop `docker` so there's still a dangling docker process. I don't know if there's just one or more though. If you don't want to spend your time on it, simply reboot.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.