Error when opening a LUKS encrypted container file /dev/loop0 Device or resource is busy on Ubuntu 18.10 Gnome Desktop

When you enter the command below in a terminal window:

$ sudo /sbin/losetup /dev/loop0 /home/user1/folder1/containerdatafile <enter>

Device error or resource busy error message appears and the device is not setup.

The reason is that /dev/loop0 is taken by snap.

To overcome the error, change /dev/loop0 to something else like /dev/loop35

Or, if you do not use snap, remove snap by:
$ sudo apt-get purge snap snapd <enter>

Now you can check if the /dev/loop0 is taken by snapd by typing:
$ df <enter>

There should be no more loop0 device used by snap and the original command should work with /dev/loop0.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s