Skip to content

Commit

Permalink
Version 20200330
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Mar 30, 2020
0 parents commit 17b9b7b
Show file tree
Hide file tree
Showing 13 changed files with 5,511 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.14.3)

project(ntfs2btrfs VERSION 20200330)

configure_file(src/config.h.in src/config.h)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(SRC_FILES src/ntfs2btrfs.cpp
src/ntfs.cpp
src/crc32c.c)

if(MSVC)
enable_language(ASM_MASM)
set(SRC_FILES ${SRC_FILES} src/crc32c-masm.asm)
else()
enable_language(ASM)
set(SRC_FILES ${SRC_FILES} src/crc32c-gas.S)
endif()

add_executable(ntfs2btrfs ${SRC_FILES})

if(MSVC)
target_compile_options(ntfs2btrfs PRIVATE /W4)
else()
target_compile_options(ntfs2btrfs PRIVATE -Wall -Wextra -Wno-address-of-packed-member)
endif()

install(TARGETS ntfs2btrfs DESTINATION bin)
339 changes: 339 additions & 0 deletions LICENCE

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Ntfs2btrfs
==========

Ntfs2btrfs is a tool which does in-place conversion of Microsoft's NTFS
filesystem to the open-source filesystem Btrfs, much as `btrfs-convert`
does for ext2. The original image is saved as a reflink copy at
`image/ntfs.img`, and if you want to keep the conversion you can delete
this to free up space.

Although I believe this tool to be stable, please note that I take no
responsibility if something goes awry!

You're probably also interested in [WinBtrfs](https://github.com/maharmstone/btrfs),
which is a Btrfs filesystem driver for Windows.

Usage
-----

On Windows, from an Administrator command prompt:

`ntfs2btrfs.exe D:\`

Bear in mind that it won't work with your boot drive or a drive with a
pagefile on it.

On Linux, as root:

`ntfs2btrfs.exe /dev/sda1`

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

On Windows, open the source directory in a recent version of MSVC, right-
click on CMakeLists.txt, and click Compile.

On Linux:

cmake .
make

What works
----------

* Files
* Directories
* Symlinks
* Other reparse points
* Security descriptors
* Alternate data streams
* DOS attributes (hidden, system, etc.)

What doesn't work
-----------------

* Rollback to original NTFS image
* Windows' old extended attributes (you're not using these)
* Large (i.e >16KB) ADSes (you're not using these either)
* Preservation of LXSS metadata
* Preservation of the case-sensitivity flag
* Compressed files (skipped for now)
* Encrypted files

Can I boot Windows from Btrfs with this?
----------------------------------------

Yes, if the stars are right. See [Quibble](https://github.com/maharmstone/quibble).
Loading

0 comments on commit 17b9b7b

Please sign in to comment.