Bug 31021 - DriveInfo.GetDrives()/Directory.GetLogicalDrives() doesn't return all drives when run under Docker
Summary: DriveInfo.GetDrives()/Directory.GetLogicalDrives() doesn't return all drives ...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-11 10:27 UTC by eb1
Modified: 2016-03-15 11:44 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description eb1 2015-06-11 10:27:08 UTC
Running the code below should list all mounted drives. When run in a docker container however it gives only a partial list. The result seems to vary - when I discovered this bug a few days ago the only drive returned was "/". Today I get 4 drives, not including "/" and missing a lot of others.


	Console.WriteLine("Directory.GetLogicalDrives():");
	foreach (var drive in Directory.GetLogicalDrives())
		Console.WriteLine("\tDrive {0}", drive);
	Console.WriteLine("DriveInfo.GetDrives():");
	foreach (var drive in DriveInfo.GetDrives())
		Console.WriteLine("\tDrive {0}", drive);
Comment 1 eb1 2016-01-29 21:37:01 UTC
Suggested fix in https://github.com/mono/mono/pull/2543
Comment 2 Alex Rønne Petersen 2016-03-15 11:44:01 UTC
Merged the PR.