Veracrypt 1.26.14 crashes Ubuntu 24.04.1 at the end of creating/encrypting a 4TB partition/drive
Veracrypt 1.26.14 crashes Ubuntu 24.04.1 at the end of creating/encrypting a (enitre) 4TB partition/drive.
Expected behavior
Veracrypt finishes creating an entire 4TB partition/drive without crashing/failures.
Observed behavior
Veracrypt 1.26.14 crashes Ubuntu 24.04.1 at the end of creating a (enitre) 4TB partition/drive.
Steps to reproduce
- Start veracrypt as sudo (sudo veracrypt)
- Menu -> Volumes -> Create new volume...
- Select "Encrypt a non-system partition/drive". Next.
- Select "Standard Veracrypt volume". Next.
- Select device (with option "Never save history"). Next.
- "Are you sure you want to encrypt the entire device/partition?". Yes.
- Encryption option: AES. Hash algorithm: SHA-512
- Set "Volume password": **************** Unselect "use PIM". Unselect "Display password". Unselect "use keyfiles". Next.
- Volume format: Ext3 Select "Quick format". "Are you sure you want to use Quick Format?" Yes. Next.
- Cross platform support. "I will mount the volume on other platforms.". Next.
- Collecting randomness from mouse movements... move your cursor like crazy until enough randomness is collected.
- Hit "Format".
- Encrypting process is started, and takes about 2-3 days.
- After the end of encryption, (full screen and white) X11 error message is appearing and automatically logs out from the X11 session and closes all running processes.
Screenshots
No screenshots.
Your Environment
Model: Hewlett-Packard HP ZBook 17 G2 Memory: 32.0 GiB Processor: Intel® Core™ i7-4810MQ × 8 Graphics: Intel® HD Graphics 4600 (HSW GT2) Graphics 1: Quadro K4100M (NVIDIA-SMI 470.256.02) Disc Capacity: 1.0 TB Firmware version: M70 Ver. 01.26 OS name: Ubuntu 24.04.1 LTS OS type: 64-bit GNOME version: 46 Windowing system: X11 Kernel version: Linux 6.8.0-45-generic
USB external drive: Toshiba portable storage. Model sticker: DTP340 4TB +5V DC 1.0A. Model: TOSHIBA MQ04UBB400 (JS0B0U) Size: 4.0 TB (4,000,787,027,968 bytes) Formatted and full with zeroes. Powered over USB 3.0 (SS USB) port.
VeraCrypt version: 1.26.14
Operating system and version: Ubuntu 24.04.1 (kernel 6.8.0-45-generic)
System type: 64 bit
Same issue is present with Veracrypt version 1.26.7.
I have a similar problem (possibly even the same one) with Mint 22 and VeraCrypt 1.26.14. I can't be sure because the original report doesn't say whether the drive was successfully encrypted even after the auto logout and closure of running processes. In my case, the drive doesn't get encrypted properly and won't mount. The difference is that when I try to quick format a drive, it either finishes in seconds or hangs indefinitely (I didn't have the patience to wait 2-3 hours, let alone 2-3 days). Through testing, I found that the problem is specific to certain drives. I had an external drive using its own not easily removable enclosure that came with the drive, and it consistently had the problem. I tested with a different external drive that was an internal drive before I popped it into an external enclosure, and the second drive had no problems. A USB flash drive consistently has the problem. Size is not the cause of the problem. On 2 different 2TB drives, I have the problem on one but not the other. On a mere 128GB drive, I have the problem. The problem is also not solved by trying a different USB port.
I also noticed that there is a potential workaround, but the workaround doesn't go far enough. If you tell VeraCrypt you won't store files larger than 4 GB on the drive, you get the option of quick formatting in FAT partition. FAT is pretty terrible because you can't store files larger than 4 GB on it, but the quick format DOES finish. In previous versions of VeraCrypt (years ago) I was able to fix a quick format of the wrong partition type by opening the Disks app and then reformatting the mounted VeraCrypt volume (not the drive itself). This would allow me to switch to any format I wanted. However, I noticed that Disks is hanging when I try to reformat the FAT partition to NTFS partition. If I wait long enough, Disks spits out the following error:
Error formatting volume Error creating filesystem 'ntfs': Process reported exit code 1: Failed to sync device /dev/dm-3: Input/output error Syncing device. FAILEDFailed to fsync device /dev/dm-3: Input/output error Warning: Could not close /dev/dm-3: Input/output error (udisks-error-quark, 0)
I also get an input/output error if I wait long enough with VeraCrypt, but sometimes VeraCrypt never gives me this error and just hangs until I kill VeraCrypt forcefully. The fact that I'm getting the error only on some drives suggests a possible kernel problem (in the same way that the kernel can influence whether smartmontools can get info from some drives). The fact that I get the same error on Disks and VeraCrypt suggests that whatever VeraCrypt is calling to format the drive is causing the hang. If I have time, I will do further testing on an older version of VeraCrypt using a different kernel. If I have interesting results I will report back.
If greg-horvath confirms that the drive was never properly encrypted, I think it's safe to classify this as the same problem. If the encryption was successful, I may have to start another bug report.
Update: On Mint 21.3, VeraCrypt version 1.25.9 successfully quick formats in NTFS (a format that failed on Mint 22 VeraCrypt 1.26.14). I was never able to get NTFS working on Mint 22!
Update 2: Extending my earlier test, I was able to use Mint 22 to create the VeraCrypt volume (non system partition/drive, not a file container) using quick format in FAT. I then mounted the volume on Mint 21.3 where I used Disks to format the FAT partition to NTFS. Workaround successful! However, this is not a good long-term solution and I still hope for a true fix. Based on greg-horvath's experience with 1.26.7, which also produced the problem, I surmise that it's not the version of VeraCrypt that causes the bug but the kernel version or package used to format the drive.
Please see the journal from the mentioned issue. last_boot_2024.11.18.txt
Also, some screenshots attached. Strange thing is that there is a third (empty) window appearing. Abnormal thing is that at the end of the process/crash, the external drive has multiple partitions and free space, but the expectation is to have one fully encrypted external drive.
Why don't you encrypt a drive-spanning raw partition instead of the raw drive? I've long (probably since Mint 18) resorted to that minor waste because it gave me less troubles overall. Would that change your case?