Skip to content

Commit a09ff35

Browse files
committed
NTFS: LogFile: Do not throw NotSupportedException for dirty volume if mounted as readonly
1 parent d34a769 commit a09ff35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

DiskAccessLibrary/FileSystems/NTFS/Log/LogFile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public partial class LogFile : NTFSFile
2424

2525
public LogFile(NTFSVolume volume) : base(volume, MasterFileTable.LogSegmentReference)
2626
{
27-
if (!IsLogClean())
27+
// We only throw exception if the volume is not readonly
28+
if (!IsLogClean() && !volume.IsReadOnly)
2829
{
2930
throw new NotSupportedException("The volume was not dismounted cleanly, the Windows NTFS driver must be used to bring the volume back to a consistent state");
3031
}

0 commit comments

Comments
 (0)