Encryped partition creation fail

Hello (world)

Trying to create an encrypted partition and getting the error (udisks-error-quark, 0).

For context, the error is occurring when creating an encrypted partition on an existing drive. The partition appears to be fine and mounts as sda4 without issue. But, when the partition is reformatted Ext4 with password protection from LUKS, the partition fails to mount with the error "Error unlocking /dev/sda4: Failed to activate device: Invalid argument (udisks-error-quark, 0)". Also, the OS is installed to VirtualBox, the OS is Zorin OS core 17.2, I'm using Disks to encrypt the partition, the partition is small at about 4 GB and at the very end of the drive.

Yikes. I give up. I've tried deleting rebooting reformatting re-partitioning blah bla blah. Sigh. Installed cryptsetup at the command line which generated more head bashing dead ends. Maybe someone here has an idea.

Thank you. I'm trying to replace a deprecated Microsoft OS and hope to get Zorin OS pro(?) when that happens.

Sorry that I can't help, but welcome to the forum. I'm sure someone will know how to solve your problem.

Hey Picasso, thank you. Your thoughtfulness is much appreciated. I'm glad to be here as I step away from the Microsoft treadmill.

Rereading the post above the takeaway might be to not compose while in trouble shooting mode :grin:. A little more English, a little less machine.

At any rate, the problem is so obscure that it seemingly must be something to do with the virtual environment. The new OS is so unfamiliar though it's all a guess at this point.

1 Like

I'm all for people trying to learn and improve themselves, but I think it's worth asking the question: what is the use case here? If the goal is to protect individual files, you're probably much better of encrypting them individually or the directory they are contained in. For that, I'd recommend using something like Cryptomator:

If you need to protect the entire drive, then it'd be easier to encrypt the whole drive during the installation of Zorin OS.

1 Like

Replace Ubuntu with Zorin:

Create an Encrypted Ubuntu VM

To create an encrypted Ubuntu 22.04 VM in Windows, follow these steps:

Download Ubuntu 22.04 ISO: Obtain the Ubuntu 22.04 ISO file from the official Ubuntu website.

Create a Bootable USB Drive: Use a tool like Rufus to create a bootable USB drive from the ISO file. Insert the USB drive into your Windows machine and run Rufus, selecting the Ubuntu ISO and your USB drive to create the bootable media.

Install VirtualBox: If you don’t already have it, download and install Oracle VirtualBox from the official website.

Create a New Virtual Machine:
    Open VirtualBox and click “New” to create a new VM.
    Name the VM and select “Linux” as the type and “Ubuntu (64-bit)” as the version.
    Allocate at least 2048 MB of RAM to the VM.
    Create a new virtual hard disk by clicking “Create a virtual hard disk now” and select “VDI (VirtualBox Disk Image)”.
    Choose “Dynamically allocated” for the storage type and set the file size to at least 20 GB.

Configure VM Settings:
    Select the VM you just created and click “Settings”.
    Go to the “System” tab and set the amount of RAM to at least 2048 MB.
    Go to the “Storage” tab and click the “Empty” icon under “Controller: IDE”. Click “Choose a disk file” and select the virtual hard disk you created.
    Go to the “Network” tab and ensure that the network adapter is set to “NAT” or “Bridged Adapter” depending on your network requirements.
    Go to the “Shared Folders” tab and add a shared folder if you need to access files from your Windows host.

Boot the VM with the Ubuntu ISO:
    Attach the bootable USB drive to the VM by going to the “Storage” tab and selecting the ISO file under “Controller: IDE”.
    Start the VM. You should see the Ubuntu installer boot screen.

Install Ubuntu 22.04:
    Select your language and keyboard layout.
    Choose “Erase disk and install Ubuntu” to wipe the virtual hard disk and install Ubuntu.
    During the installation, select “Advanced features” and check both “Use LVM with the new Ubuntu installation” and “Encrypt the new Ubuntu installation for security”.
    Follow the installation prompts, including setting up a user account and password.

Complete Installation:
    Once the installation is complete, remove the ISO file from the VM’s settings and start the VM normally.
    You will be prompted to enter the encryption passphrase at boot time.

By following these steps, you will have an encrypted Ubuntu 22.04 VM running in Windows using VirtualBox.

Personally, you would be better creating space for a bare metal install! That said, I never use encryption as there is a chance of data loss.

1 Like

I Actually have an encrypted ext4 partition on a backup drive. For sensitive files. In ntfs it's a good path and has been effective for several years. That ext4 partition was an easy setup.

After trying to encrypt a partition on a second hard drive located physically in a real world machine, the idea of encrypting files seems like a much more interesting concept. Gparted is failing. The drive is sdb and there is a single partition there which will not apparently allow changes to be made to the partition table. Booting to a cd containing Gparted / parted, unmounting, and just a big fail...

hmm, looking Hirens boot cd at the moment.

I don't like encryption, even on Windows. I was tasked once with creating an encrypted partition for my Manager's Business Officer once on Windows XP. 2 Partitions, one for Windows, the second for Data (Encrypted). Withing 3 days, the OS borked. Reinstalling Windows changes the OS Keys in the registry resulting in Encrypted Data partition inaccessible. Luckily the Business Officer kept regular backups externally so only one day's data (one day too much in my opinion) was lost forever.

Thank you for the kind suggestions. Apparently I'm missing something but ext4 with luks is no joy. Encrypting an external drive in toto and then trying to unlock results in the same error of, 'unable to unlock the drive,' from Debian.

Ok. Appreciate it.