VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumeCreationWizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/VolumeCreationWizard.cpp')
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index 4df20301..5d814e89 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -258,7 +258,10 @@ namespace VeraCrypt
case Step::FormatOptions:
{
- VolumeFormatOptionsWizardPage *page = new VolumeFormatOptionsWizardPage (GetPageParent(), VolumeSize, SectorSize,
+ shared_ptr <VolumeLayout> layout ((OuterVolume || SelectedVolumeType != VolumeType::Hidden)? (VolumeLayout*) new VolumeLayoutV2Normal() : (VolumeLayout*) new VolumeLayoutV2Hidden());
+ uint64 filesystemSize = layout->GetMaxDataSize (VolumeSize);
+
+ VolumeFormatOptionsWizardPage *page = new VolumeFormatOptionsWizardPage (GetPageParent(), filesystemSize, SectorSize,
SelectedVolumePath.IsDevice() && (OuterVolume || SelectedVolumeType != VolumeType::Hidden), OuterVolume, LargeFilesSupport);
page->SetPageTitle (_("Format Options"));
@@ -484,6 +487,9 @@ namespace VeraCrypt
shared_ptr <VolumeInfo> volume = Core->MountVolume (mountOptions);
finally_do_arg (shared_ptr <VolumeInfo>, volume, { Core->DismountVolume (finally_arg, true); });
+
+ shared_ptr <VolumeLayout> layout((volume->Type == VolumeType::Normal)? (VolumeLayout*) new VolumeLayoutV2Normal() : (VolumeLayout*) new VolumeLayoutV2Hidden());
+ uint64 filesystemSize = layout->GetMaxDataSize (VolumeSize);
Thread::Sleep (2000); // Try to prevent race conditions caused by OS
@@ -527,7 +533,14 @@ namespace VeraCrypt
args.push_back ("-f");
if (SelectedFilesystemType == VolumeCreationOptions::FilesystemType::Btrfs)
+ {
args.push_back ("-f");
+ if (filesystemSize < VC_MIN_LARGE_BTRFS_VOLUME_SIZE)
+ {
+ // use mixed mode for small BTRFS volumes
+ args.push_back ("-M");
+ }
+ }
args.push_back (string (virtualDevice));