Skip to content

Commit

Permalink
VERSION 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Sep 4, 2017
1 parent b495e3a commit 4f5a360
Show file tree
Hide file tree
Showing 40 changed files with 135 additions and 319 deletions.
Binary file modified Debug/x64/btrfs.pdb
Binary file not shown.
Binary file modified Debug/x64/btrfs.sys
Binary file not shown.
Binary file modified Debug/x64/mkbtrfs.exe
Binary file not shown.
Binary file modified Debug/x64/mkbtrfs.pdb
Binary file not shown.
Binary file modified Debug/x64/shellbtrfs.dll
Binary file not shown.
Binary file modified Debug/x64/shellbtrfs.pdb
Binary file not shown.
Binary file modified Debug/x64/ubtrfs.dll
Binary file not shown.
Binary file modified Debug/x64/ubtrfs.pdb
Binary file not shown.
Binary file modified Debug/x86/btrfs.pdb
Binary file not shown.
Binary file modified Debug/x86/btrfs.sys
Binary file not shown.
Binary file modified Debug/x86/mkbtrfs.exe
Binary file not shown.
Binary file modified Debug/x86/mkbtrfs.pdb
Binary file not shown.
Binary file modified Debug/x86/shellbtrfs.pdb
Binary file not shown.
Binary file modified Debug/x86/ubtrfs.dll
Binary file not shown.
Binary file modified Debug/x86/ubtrfs.pdb
Binary file not shown.
69 changes: 44 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
WinBtrfs v0.10
--------------
WinBtrfs v1.0
-------------

WinBtrfs is a Windows driver for the next-generation Linux filesystem Btrfs. The
aim is for it to be feature-complete, with only a few features still
outstanding. It is a reimplementation from scratch, and contains no code from the
Linux kernel. First, a disclaimer:
WinBtrfs is a Windows driver for the next-generation Linux filesystem Btrfs.
A reimplementation from scratch, it contains no code from the Linux kernel,
and should work on any version from Windows 7 onwards.
First, a disclaimer:

This software is in active development - YOU USE IT AT YOUR OWN RISK. I take NO
RESPONSIBILITY for any damage it may do to your filesystem. DO NOT USE THIS
Expand All @@ -15,8 +15,7 @@ THE POSSIBILITY OF SILENT CORRUPTION.
In other words, assume that the driver is going to corrupt your entire
filesystem, and you'll be pleasantly surprised when it doesn't.

However, having said that, it ought to be suitable for day-to-day use, especially
when mounted readonly.
However, having said that, it ought to be suitable for day-to-day use.

Everything here is released under the GNU Lesser General Public Licence (LGPL);
see the file LICENCE for more info. You are encouraged to play about with the
Expand Down Expand Up @@ -72,13 +71,15 @@ Features
* TRIM/DISCARD
* Reflink copy
* Subvol send and receive
* Degraded mounts
* Free space tree (compat_ro flag `free_space_cache`)
* Shrinking and expanding

Todo
----

* Degraded mounts
* New (Linux 4.5) free space cache (compat_ro flag `free_space_cache`)
* Passthrough of permissions etc. for LXSS
* Oplocks

Installation
------------
Expand All @@ -90,26 +91,28 @@ Prompt" and click "Run as administrator"), and run the following command:

bcdedit -set TESTSIGNING ON

Reboot, and you should see "Test Mode" on the bottom right of the Desktop.
Reboot, and you should see "Test Mode" on the bottom right of the Desktop. You may
need to disable "Secure Boot" in BIOS for this to work.

To install the driver, right-click btrfs.inf and choose Install.

Uninstalling
------------

If you just want to test the driver out, run loader.exe as an Administrator.
Despite what it says, you can close it - the driver will stay in memory until
you shutdown. Be warned that currently running programs, including the Desktop,
might not display your Btrfs partition until they're restarted - your drive
might not appear in My Computer, but if you run E:\ (for example), it'll show
up.
If you want to uninstall, go to Device Manager, find "Btrfs controller" under
"Storage volumes", right click and choose "Uninstall". Tick the checkbox to
uninstall the driver as well, and let Windows reboot itself.

If you're feeling adventurous and want to install the driver permanently,
right-click btrfs.inf, click Install, and reboot.
If you need to uninstall via the registry, open regedit and set the value of
HKLM\SYSTEM\CurrentControlSet\services\btrfs\Start to 4, to disable the service.
After you reboot, you can then delete the btrfs key and remove
C:\Windows\System32\drivers\btrfs.sys.

Compilation
-----------

You will need Microsoft Visual C++ if you want to compile the driver; I used the
2008 edition, but later versions should work too. I've not been able to get it
to work with GCC; it worked for a while, then suddenly stopped when the code
got to a certain size. If you've got any clues about what this is all about, I'd
appreciate it if you sent me an e-mail.
You will need Microsoft Visual C++ 2015 if you want to compile the driver; you might
be able to get earlier versions to work with a bit of work.

You'll also need a copy of the Windows DDK; I placed mine in C:\WinDDK. If yours
is somewhere else, you'll need to edit the project settings. You'll also need to
Expand All @@ -125,6 +128,8 @@ name of your Windows SID (e.g. S-1-5-21-1379886684-2432464051-424789967-1001),
and the value of your Linux uid (e.g. 1000). It will take effect next time the
driver is loaded.

You can find your current SID by running `wmic useraccount get name,sid`.

Similarly, the group mappings are stored in under GroupMappings. The default
entry maps Windows' Users group to gid 100, which is usually "users" on Linux.
You can also specify user SIDs here to force files created by a user to belong
Expand Down Expand Up @@ -213,6 +218,17 @@ flag, e.g. `format /fs:ntfs D:`.
Changelog
---------

v1.0 (2017-09-04):
* First non-beta release!
* Degraded mounts
* New free space cache (compat_ro flag `free_space_cache`)
* Shrinking and expanding of volumes
* Registry options now re-read when changed, rather than just on startup
* Improved balancing on very full filesystems
* Fixed problem preventing user profile directory being stored on btrfs on Windows 8 and above
* Better Plug and Play support
* Miscellaneous bug fixes

v0.10 (2017-05-02):
* Reflink copy
* Sending and receiving subvolumes
Expand Down Expand Up @@ -366,7 +382,7 @@ of the `compress-force` flag on Linux.
* `CompressType` (DWORD): set this to 1 to prefer zlib compression, and 2 to prefer lzo compression. The
default is 0, which uses lzo compression if the incompat flag is set, and zlib otherwise.

* `FlushInterval` (DWORD): the interval in seconds between metadata flushes. The default is 30, as on Linux -
* `FlushInterval` (DWORD): the interval in seconds between metadata flushes. The default is 30, as on Linux -
the parameter is called `commit` there.

* `ZlibLevel` (DWORD): a number between -1 and 9, which determines how much CPU time is spent trying to
Expand All @@ -387,6 +403,9 @@ called `subvolid`.
* `SkipBalance` (DWORD): set to 1 to tell the driver not to attempt resuming a balance which was running
when the system last powered down. The default is 0. The equivalent parameter on Linux is `skip_balance`.

* `NoPNP` (DWORD): useful for debugging only, this forces any volumes to appear rather than exposing them
via the usual Plug and Play method.

Contact
-------

Expand Down
15 changes: 10 additions & 5 deletions btrfs.inf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Signature = "$Windows NT$"
Class = Volume
ClassGuid = {71a27cdd-812a-11d0-bec7-08002be2092f}
Provider = %Me%
DriverVer = 02/14/2016,0.1.0.0
DriverVer = 09/04/2017,1.0.0.0
CatalogFile = btrfs.cat

[DestinationDirs]
Expand All @@ -26,16 +26,21 @@ Btrfs.DllFiles = 11 ;%windir%\system32
OptionDesc = %ServiceDescription%
CopyFiles = Btrfs.DriverFiles,Btrfs.DllFiles
RegisterDlls = shellbtrfs
CopyINF = btrfs.inf

[DefaultInstall.Services]
AddService = %ServiceName%,2,Btrfs.Service
AddService = %ServiceName%,0x802,Btrfs.Service

[Manufacturer]
%Me%=Standard,NT
%Me%=Standard,NTamd64,NTx86

[Standard.NTamd64]
%VolumeName% = Btrfs_Install, BtrfsVolume
%ControllerName% = Btrfs_Install, ROOT\btrfs

[Standard.NT]
[Standard.NTx86]
%VolumeName% = Btrfs_Install, BtrfsVolume
%ControllerName% = Btrfs_Install, DETECTED\btrfs
%ControllerName% = Btrfs_Install, ROOT\btrfs

[Btrfs_Install]
OptionDesc = %ServiceDescription%
Expand Down
13 changes: 13 additions & 0 deletions btrfs.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
<IncludePath>$(DDK_INC_PATH);$(IncludePath)</IncludePath>
<LibraryPath>$(DDK_LIB_PATH);$(LibraryPath)</LibraryPath>
<EnableInf2cat>false</EnableInf2cat>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\x86\</OutDir>
Expand All @@ -94,6 +95,7 @@
<TargetExt>.sys</TargetExt>
<IncludePath>$(DDK_INC_PATH);$(IncludePath)</IncludePath>
<LibraryPath>$(DDK_LIB_PATH);$(LibraryPath)</LibraryPath>
<EnableInf2cat>false</EnableInf2cat>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\x64\</OutDir>
Expand All @@ -103,6 +105,7 @@
<TargetExt>.sys</TargetExt>
<IncludePath>$(DDK_INC_PATH);$(IncludePath)</IncludePath>
<LibraryPath>$(DDK_LIB_PATH);$(LibraryPath)</LibraryPath>
<EnableInf2cat>false</EnableInf2cat>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -304,6 +307,16 @@
<ItemGroup>
<Inf Include="btrfs.inf" />
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PackageRelativeDirectory>
</PackageRelativeDirectory>
</FilesToPackage>
<FilesToPackage Include="$(TargetPath)" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PackageRelativeDirectory>
</PackageRelativeDirectory>
</FilesToPackage>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
Binary file removed loader.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions src/btrfs.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
// TEXTINCLUDE
//

1 TEXTINCLUDE
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
Expand Down Expand Up @@ -70,12 +70,12 @@ BEGIN
BLOCK "080904b0"
BEGIN
VALUE "FileDescription", "WinBtrfs"
VALUE "FileVersion", "0.10"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "btrfs"
VALUE "LegalCopyright", "Copyright (c) Mark Harmstone 2016-17"
VALUE "OriginalFilename", "btrfs.sys"
VALUE "ProductName", "WinBtrfs"
VALUE "ProductVersion", "0.10"
VALUE "ProductVersion", "1.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit 4f5a360

Please sign in to comment.