Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/core/compatibility/10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
| [C# 14 overload resolution with span parameters](core-libraries/10.0/csharp-overload-resolution.md) | Behavioral change | Preview 1 |
| [Consistent shift behavior in generic math](core-libraries/10.0/generic-math.md) | Behavioral change | Preview 1 |
| [Default trace context propagator updated to W3C standard](core-libraries/10.0/default-trace-context-propagator.md) | Behavioral change | Preview 4 |
| [DriveInfo.DriveFormat returns Linux filesystem types](core-libraries/10.0/driveinfo-driveformat-linux.md) | Behavioral change | Preview 6 |
| [LDAP DirectoryControl parsing is now more stringent](core-libraries/10.0/ldap-directorycontrol-parsing.md) | Behavioral change | Preview 1 |
| [MacCatalyst version normalization](core-libraries/10.0/maccatalyst-version-normalization.md) | Behavioral change | Preview 1 |
| [.NET runtime no longer provides default SIGTERM signal handler](core-libraries/10.0/sigterm-signal-handler.md) | Behavioral change | Preview 5 |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Breaking change: DriveInfo.DriveFormat returns Linux filesystem types"
description: Learn about the .NET 10 breaking change in core .NET libraries where DriveInfo.DriveFormat on Linux systems returns Linux kernel filesystem type strings instead of mapped magic constants.
ms.date: 06/24/2025
---
# DriveInfo.DriveFormat returns Linux filesystem types

On Linux systems, <xref:System.IO.DriveInfo.DriveFormat?displayProperty=nameWithType> now returns Linux kernel filesystem type strings. These strings represent a more granular representation of the filesystem type than the previous implementation. For example, it's now possible to distinguish between `ext3` and `ext4`.

## Previous behavior

Previously, .NET returned a string representation by mapping magic constants to strings. Because several different filesystem types use the same magic constants, it wasn't possible to distinguish between them.

For cgroup file systems, `DriveFormat` returned `cgroupfs`/`cgroup2fs`. For the SELinux filesystem, the value was `selinux`.

## New behavior

Starting in .NET 10, .NET returns the string representation used by the Linux kernel for the filesystem type.

For cgroup file systems, `DriveFormat` returns `cgroup`/`cgroups`. For the SELinux filesystem, the value is `selinuxfs`.

## Version introduced

.NET 10 Preview 6

## Type of breaking change

This change is a [behavioral change](../../categories.md#behavioral-change).

## Reason for change

Provide more granular filesystem type information.

## Recommended action

Check and update usages of <xref:System.IO.DriveInfo.DriveFormat?displayProperty=nameWithType> to include the Linux filesystem type strings. On a Linux system, you can read the type strings of the drives from the `/proc/self/mountinfo` file. On each line, the filesystem type string is the first field after the `-` separator.

## Affected APIs

- <xref:System.IO.DriveInfo.DriveFormat?displayProperty=fullName>
2 changes: 2 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ items:
href: core-libraries/10.0/generic-math.md
- name: Default trace context propagator updated to W3C Standard
href: core-libraries/10.0/default-trace-context-propagator.md
- name: DriveInfo.DriveFormat returns Linux filesystem types
href: core-libraries/10.0/driveinfo-driveformat-linux.md
- name: LDAP DirectoryControl parsing is now more stringent
href: core-libraries/10.0/ldap-directorycontrol-parsing.md
- name: MacCatalyst version normalization
Expand Down