public sealed record DesktopVolume : IEquatable<DesktopVolume> One storage volume: a filesystem the desktop can mount, or a locked encrypted volume.
Parameters
IdThe platform's identifier, stable while the volume is present: a UDisks2 object path on Linux, a
\\?\Volume{GUID}\path on Windows, a BSD name on macOS. Treat it as opaque.DisplayNameA name to show, such as the volume's label or its drive's model and size.
Constructors
DesktopVolume
public DesktopVolume(string Id, string DisplayName) One storage volume: a filesystem the desktop can mount, or a locked encrypted volume.
Parameters
IdThe platform's identifier, stable while the volume is present: a UDisks2 object path on Linux, a
\\?\Volume{GUID}\path on Windows, a BSD name on macOS. Treat it as opaque.DisplayNameA name to show, such as the volume's label or its drive's model and size.
Properties
CanEject
public bool CanEject { get; init; } Whether IDesktopVolumes.EjectAsync can eject its media or drive.
CanUnmount
public bool CanUnmount { get; init; } Whether IDesktopVolumes.UnmountAsync can unmount it now.
DisplayName
public string DisplayName { get; init; } A name to show, such as the volume's label or its drive's model and size.
DriveId
public string? DriveId { get; init; } The identifier of the drive the volume belongs to, shared by its other volumes, when known.
DriveName
public string? DriveName { get; init; } A name for the drive, such as its vendor and model, when known.
FileSystem
public string? FileSystem { get; init; } The filesystem type, such as ext4, vfat, NTFS or apfs, when known.
Id
public string Id { get; init; } The platform's identifier, stable while the volume is present: a UDisks2 object path on Linux, a \\?\Volume{GUID}\ path on Windows, a BSD name on macOS. Treat it as opaque.
IsEncrypted
public bool IsEncrypted { get; init; } Whether the volume is encrypted, locked or not, when the platform reports it: BitLocker on Windows, encrypted APFS on macOS and LUKS on Linux.
IsLocked
public bool IsLocked { get; init; } Whether the volume is encrypted and locked; it cannot be mounted until it is unlocked.
Remarks
Windows lists a locked BitLocker volume and macOS a locked APFS volume with DesktopVolume.CanMount false; Linux lists a LUKS container without a cleartext device.
IsReadOnly
public bool IsReadOnly { get; init; } Whether the volume is read-only.
IsRemovable
public bool IsRemovable { get; init; } Whether the volume or its media can be removed, such as a USB stick, an SD card or an optical disc.
IsSystem
public bool IsSystem { get; init; } Whether the operating system considers the volume part of the system; file managers usually list such volumes separately.
MountPaths
public ImmutableArray<string> MountPaths { get; init; } Where the volume is mounted; empty while it is not mounted. Linux can mount one volume at several paths.
Size
public long? Size { get; init; } The volume's size in bytes, when known.
UnlockMethod
public DesktopVolumeUnlockMethod UnlockMethod { get; init; } How IDesktopVolumes.UnlockAsync or its passphrase overload can unlock the volume while it is DesktopVolume.IsLocked; DesktopVolumeUnlockMethod.None when it cannot or is not locked.