diff --git a/Duplicati/UnitTest/DiskImage/IDiskImageHelper.cs b/Duplicati/UnitTest/DiskImage/IDiskImageHelper.cs
index d18c7a730..607d4de92 100644
--- a/Duplicati/UnitTest/DiskImage/IDiskImageHelper.cs
+++ b/Duplicati/UnitTest/DiskImage/IDiskImageHelper.cs
@@ -39,98 +39,55 @@ namespace Duplicati.UnitTest.DiskImage
/// The path where the disk image file will be created.
/// The size of the disk image in megabytes.
/// The physical drive path (e.g., \\.\PhysicalDriveN on Windows, /dev/loopN on Linux).
- string CreateAndAttachDisk(string imagePath, long sizeMB);
+ string CreateDisk(string imagePath, long sizeMB);
///
- /// Gets the disk number or identifier for an attached disk image.
+ /// Initializes, partitions, and formats a disk based on the provided parameters
///
- /// The path to the disk image file.
- /// The disk number/index, or -1 if not found.
- int GetDiskNumber(string imagePath);
+ /// The identifier of the disk to initialize.
+ /// The type of partition table to create (e.g., GPT, MBR).
+ /// An array of tuples specifying the file system type and size for each partition. If the size is 0, the partition will use the remaining available space.
+ /// An array of mount points for the created partitions.
+ string[] InitializeDisk(string diskIdentifier, PartitionTableType tableType, (FileSystemType, long)[] partitions);
///
- /// Initializes a disk with the specified partition table type (GPT or MBR).
+ /// Mounts all of the partitions on the specified disk and returns their mount points.
///
- /// The disk number.
- /// The partition table type (GPT or MBR).
- void InitializeDisk(int diskNumber, PartitionTableType tableType);
+ /// The identifier of the disk to mount.
+ /// An array of mount points for the mounted partitions.
+ string[] Mount(string diskIdentifier);
///
- /// Creates a partition on the specified disk, formats it with the specified filesystem,
- /// and assigns a drive letter or mount point.
+ /// Unmounts all of the partitions on the specified disk, ensuring they are safely detached from the system. The disk will still be attached, but will be pulled offline. After this call, the disk device can be written to.
///
- /// The disk number.
- /// The filesystem type (NTFS, FAT32, EXT4, etc.).
- /// The size of the partition in MB (0 for all available space).
- /// The assigned drive letter (Windows) or mount point identifier.
- char CreateAndFormatPartition(int diskNumber, FileSystemType fsType, long sizeMB = 0);
-
- ///
- /// Flushes the volume cache to ensure all data is written to disk.
- ///
- /// The drive letter or mount point identifier.
- void FlushVolume(char driveLetter);
-
- ///
- /// Populates a drive with test data including files of various sizes and directory structures.
- ///
- /// The drive letter to populate.
- /// The number of files to create.
- /// The size of each file in KB.
- void PopulateTestData(char driveLetter, int fileCount = 10, int fileSizeKB = 10);
-
- ///
- /// Detaches a disk image file from the system.
- ///
- /// The path to the disk image file.
- void DetachDisk(string imagePath);
-
- ///
- /// Unmounts a disk image for writing operations by removing drive letters/mount points
- /// and setting the disk offline.
- ///
- /// The path to the disk image file.
- /// Optional drive letter to unmount. If null, will attempt to detect.
- void UnmountForWriting(string imagePath, char? driveLetter = null);
-
- ///
- /// Brings a disk online for read operations.
- ///
- /// The path to the disk image file.
- void BringOnline(string imagePath);
-
- ///
- /// Mounts a disk image for reading and returns the assigned drive letter.
- ///
- /// The path to the disk image file.
- /// Optional preferred drive letter. If null, one will be assigned.
- /// The assigned drive letter.
- char MountForReading(string imagePath, char? driveLetter = null);
+ /// The identifier of the disk to unmount.
+ void Unmount(string diskIdentifier);
///
/// Cleans up and deletes a disk image file, ensuring it is detached first.
///
/// The path to the disk image file.
- void CleanupDisk(string imagePath);
-
- ///
- /// Gets detailed information about a disk.
- ///
- /// The disk number.
- /// Detailed information about the disk.
- string GetDiskDetails(int diskNumber);
-
- ///
- /// Gets the volume information for a drive letter.
- ///
- /// The drive letter.
- /// The volume information.
- string GetVolumeInfo(char driveLetter);
+ /// The identifier of the disk to clean up. If null, the method will attempt to determine the disk based on the image path.
+ void CleanupDisk(string imagePath, string? diskIdentifier = null);
///
/// Checks if the current process has the necessary privileges to perform disk operations.
///
/// true if running with sufficient privileges; otherwise, false.
bool HasRequiredPrivileges();
+
+ ///
+ /// Retrieves the partition table information for a given disk identifier.
+ ///
+ /// The identifier of the disk.
+ /// The partition table geometry of the disk.
+ PartitionTableGeometry GetPartitionTable(string diskIdentifier);
+
+ ///
+ /// Retrieves the partition information for a given disk identifier.
+ ///
+ /// The identifier of the disk.
+ /// An array of partition geometries for the disk.
+ PartitionGeometry[] GetPartitions(string diskIdentifier);
}
}