- Разреженные файлы в Windows, Linux и MacOS, файловых систем NTFS, REFS, Ext3, Ext4, BTRFS и APFS.
- Разница между сжатием и разреженными файлами
- Преимущества и недостатки
- Создаем разреженный файл в Windows
- Как создать разреженный файл в Linux
- Как увеличить
- Разреженные файлы в ApFS
- Восстановление таких типов данных
- Заключение
- Btrfs for Windows от Paragon Software
- Все сразу
- Функции
- Ресурсы
- Связаться с отделом продаж
- Файловая система btrfs для windows
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio
- Latest commit
- Git stats
- Files
- README.md
Разреженные файлы в Windows, Linux и MacOS, файловых систем NTFS, REFS, Ext3, Ext4, BTRFS и APFS.
В этой статье пойдет речь о разреженных файлах. Расскажем об их недостатках и достоинствах, какие файловые системы поддерживают такие файлы. А также, как создавать или преобразовать их из обычных.
Разряженные – это специальные файлы, которые с большей эффективностью используют файловую систему, они не позволяют ФС занимать свободное дисковое пространство носителя, когда разделы не заполнены. То есть, «пустое место» будет задействовано только при необходимости. Пустая информация в виде нулей, будет хранится в блоке метаданных ФС. Поэтому, разряженные файлы изначально занимают меньший объем носителя, чем их реальный объем.
Этот тип поддерживает большинство файловый систем: BTRFS, NILFS, ZFS, NTFS, ext2, ext3, ext4, XFS, JFS, ReiserFS, Reiser4, UFS, Rock Ridge, UDF, ReFS, APFS, F2FS.
Этот тип поддерживает большинство файловый систем: BTRFS, NILFS, ZFS, NTFS, ext2, ext3, ext4, XFS, JFS, ReiserFS, Reiser4, UFS, Rock Ridge, UDF, ReFS, APFS, F2FS.
Все эти ФС полностью поддерживают такой тип, но в тоже время не предоставляют прямой доступ к их функциям по средством своего стандартного интерфейса. Управлять их свойствами можно только через команды командной строки.
Разница между сжатием и разреженными файлами
Все файловые системы, которые я назвал выше, также поддерживают стандартную функцию сжатия. Оба этих инструмента дают преимущество в виде экономии места на диске, но достигают этой цели по-разному. Основным недостатком использования сжатия является то, что это может снизить производительность системы при выполнении операции чтения\ записи. Так как будут использоваться дополнительные ресурсы для распаковки или сжатия данных. Но некоторые программные продукты не поддерживают сжатие.
Преимущества и недостатки
Самым большим преимуществом разреженных файлов является то, что пользователь может создавать файлы большого размера, которые занимают очень мало места для хранения. Пространство для хранения выделяется автоматически по мере записи на него данных. Разреженные файлы большого объема создаются за относительно короткое время, поскольку файловой системе не требуется предварительно выделять дисковое пространство для записи нулей.
Преимущества ограничены лишь приложениями, которые их поддерживают. Если у программы нет возможности распознавать или использовать их, то она сохранит их в исходном – несжатом состоянии, что не даст никаких преимуществ. Также с ними нужно быть осторожными, поскольку разреженный файл размером всего несколько мегабайт может внезапно увеличиться до нескольких гигабайт, когда неподдерживаемые приложения скопируют его в место назначения.
Еще один из недостатков — это то, что нельзя скопировать или создать такой файл, если его номинальный размер превышает доступный объем свободного пространства (или ограничения размера квоты, налагаемые на учетные записи пользователей). Например, если исходный размер (со всеми нулевыми байтами) составляет 500 МБ, а для учетной записи пользователя, используемой для его создания, существует предел квоты в 400 МБ. Это приведет к ошибке даже если фактическое дисковое пространство, занимаемое им, составляет всего 50 МБ на диске.
Что касается накопителей, на которых хранятся такие данные, то они также подвержены фрагментации, поскольку файловая система будет записывать данные в разреженные файлы по мере необходимости. Со временем это может привести к снижению производительности. Кроме того, некоторые утилиты для управления дисками могут неточно отображать объем доступного свободного места. Когда файловая система почти заполнена, это может привести к неожиданным результатам. Например, могут возникать ошибки «переполнения диска», когда данные копируются поверх существующей части, которая была помечена как разреженная.
Создаем разреженный файл в Windows
Для этого в ОС Windows будем использовать командную строку. В поиске пишем cmd и запускаем ее от имени администратора.
В Windows для управления такими данными используют программу fsutil (утилита файловой системы). При выполнении create, по умолчанию файл создается самый обычный. Переходим в папку где нужно его создать и вводим:
fsutil file createnew sparse-file 1000000000 Копировать
Где sparse-file – имя, а в конце указан его размер в байтах.
Чтобы присвоить файлу значение «разреженный» вводим:
fsutil sparse setflag sparse-file Копировать
Для удаления этого флага выполняется следующая команда:
fsutil sparse setflag sparse-file 0 Копировать
И чтобы снова присвоить атрибут:
fsutil sparse setflag sparse-file Копировать
fsutil sparse queryflag sparse-file Копировать
Сам по себе атрибут ещё не приводит к экономии дискового пространства. Для этого нужно разметить пустую область, которая будет освобождена внутри.
Для пометки пустой области введите:
fsutil sparse setrange sparse-file 0 1000000000 Копировать
В конце указывается смещение и длина, они задаются в байтах. В моем случае от нуля до 1Гб.
Для установки полностью разреженного файла указываем полный объем. Если нужно можно расширить файл указав здесь большее значение.
Для того чтобы убедиться, что файлу присвоен данный атрибут выполним layout
fsutil file layout sparse-file Копировать
Такой Атрибут можно задать любому файлу. Просто выполнив эту команду с его именем и задать нужный вам размер.
В свойствах созданного ранее файла можно увидеть, что при размере в 1Гб. файл занимает на диске 0 байт.
Данный набор команд подходит для всех файловых систем Windows, которые поддерживают данный тип данных (NTFS, ReFS и т.д.).
Как создать разреженный файл в Linux
В Linux процесс создания таких типов данных немного проще, поскольку существует несколько команд для их создания. Этот набор подойдет для всех файловых систем Linux.
Здесь можно использовать команду dd, либо truncate.
Первая команда имеет следующий вид:
dd if=/dev/zero of=file-sparse bs=1 count=0 seek=2G Копировать
Где file-sparse – имя, и в конце указан его размер, можно задать в байтах, мегабайтах и т.д.
Вторая команда проще, она имеет такой вид:
truncate -s2G file-sparse Копировать
Где значение s – указывает размер, после которого идет имя.
По сравнению с Windows, в Linux при создании такого файла одной из команд, он будет «разреженным» по умолчанию.
Для преобразования обычного в разреженный, есть отдельная команда:
cp —sparse=always ./025.jpg ./0251.jpg Копировать
Где 025.jpg – первое имя обычного.
0251.jpg – и второе имя разреженного.
Как увеличить
Если вам нужно увеличить уже существующий файл воспользуйтесь первой командой, здесь замените имя и укажите нужный размер.
dd if=/dev/zero of=025.jpg bs=1 count=0 seek=2G Копировать
Это увеличит его размер до 2 Гб.
Для проверки размера выполним такую команду:
du -h —apparent-size 025.jpg Копировать
Разреженные файлы в ApFS
По сути, данный набор команд подходит и для файловой системы apple – ApFS, так как Linux и MacOS используют в своей основе архитектуру ядра Unix, они обе предоставляют доступ к Unix-командам и оболочке Bash.
Запустите терминал и выполните любую из команд, которую я использовал в Linux.
В MacOS Catalina работает только первая команда, и размер нужно указывать в байтах, иначе в результате команда выведет ошибку.
sudo dd if=/dev/zero of=sparse_APFS bs=1 count=0 seek=1000000000 Копировать
Файловая система ApFS при соблюдении определенных условий создает разреженные файлы по умолчанию, поэтому для увеличения любого файла можно использовать команду:
dd if=/dev/zero of=187.jpg bs=1 count=0 seek=500000000 Копировать
Зададим размер, к примеру, 500Мб, в MacOS размер нужно указывать в байтах.
В свойствах можно увидеть, что его размер увеличился до 500 Mb.
Восстановление таких типов данных
Если вы случайно удалили или отформатировали диск с важными данными, и они оказались разреженными? То, для их восстановления воспользуйтесь программой Hetman Partition или RAID Recovery. Наша программа поддерживает данный тип файлов во всех представленных в этом видео операционных и файловых системах. Скачайте установите и запустите программу, просканируйте носитель.
Как видите программа без труда находит существующие и удаленные разреженные файлы и отображает их содержимое. Открыв файл в HEX-редакторе можно убедиться, что он полностью заполнен нулями.
Программа нашла ранее удаленные данные на диске с файловой системой NTFS, REFS, BtrFS, Ext3, Ext4 и ApFS. Осталось лишь нажать кнопку Восстановить.
По завершению процесса все нужные данные будут лежать в указанной папке. Смотрим свойства, файлы восстановлены в полном объёме.
Заключение
Перед использованием этого функционала в любых ОС вам крайне важно узнать все их преимущества и недостатки. Знание этих особенностей гарантировано позволит вам избежать потенциальных проблем в будущем.
Автор: Dmytriy Zhura, Технический писатель
Дмитрий Жура – автор и один из IT-инженеров компании Hetman Software. Имеет почти 10 летний опыт работы в IT-сфере: администрирование и настройка серверов, установка операционных систем и различного программного обеспечения, настройка сети, информационная безопасность, внедрения и консультация по использованию специализированного ПО. Является экспертом в области восстановления данных, файловых систем, устройств хранения данных и RAID массивов. Подробнее
Btrfs for Windows от Paragon Software
Все сразу
Функции
- Доступ на чтение к томам Linux Btrfs с ПК
- Быстрый старт после установки
- Автомонтирование разделов Linux при запуске
- Управление через командную строку Windows CMD и из области уведомлений
- Поддержка дисков Linux LVM
- Безопасное извлечение
Ресурсы
Скачать руководство пользователя для Paragon Btrfs for Windows от Paragon Software
Связаться с отделом продаж
По вопросам приобретения лицензии Btrfs for Windows от Paragon Software вы можете связаться с нами, нажав на кнопку
или
Получите быструю консультацию по телефону
Головной офис (Германия)
Только для корпоративных клиентов!
+49-761-59018-201
Пн – Пт
Офис в России
Только для корпоративных клиентов!
+7 (495) 789-67-17
Пн – Пт
Мы предлагаем
Наши страницы
Присоединяйтесь
Copyright © 1994–2021
Paragon Technologie GmbH.
Apple, логотип Apple, iOS, iPhone, iPad, iPad Pro, Mac, MacBook, MacBook Pro, macOS и iMac являются торговыми марками Apple Inc., зарегистрированными в США и других странах.
Windows®, логотип Windows®, NTFS & exFAT являются торговыми марками корпорации Microsoft, зарегистрированными в США и других странах.
Файловая система btrfs для windows
WinBtrfs — an open-source btrfs driver for Windows
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
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 XP onwards. It is also included as part of the free operating system ReactOS.
If your Btrfs filesystem is on a MD software RAID device created by Linux, you will also need WinMD to get this to appear under Windows.
See also Quibble, an experimental bootloader allowing Windows to boot from Btrfs, and Ntfs2btrfs, a tool which allows in-place conversion of NTFS filesystems.
First, a disclaimer:
You use this software at your own risk. I take no responsibility for any damage it may do to your filesystem. It ought to be suitable for day-to-day use, but make sure you take backups anyway.
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 source code as you will, and I’d appreciate a note (mark@harmstone.com) if you come up with anything nifty.
See at the end of this document for copyright details of third-party code that’s included here.
I’ve been developing this driver for fun, and in the hopes that someone out there will find it useful. But if you want to provide some pecuniary encouragement, it’d be very much appreciated:
- Reading and writing of Btrfs filesystems
- Basic RAID: RAID0, RAID1, and RAID10
- Advanced RAID: RAID5 and RAID6
- Caching
- Discovery of Btrfs partitions, even if Windows would normally ignore them
- Getting and setting of Access Control Lists (ACLs), using the xattr security.NTACL
- Alternate Data Streams (e.g. :Zone.Identifier is stored as the xattr user.Zone.Identifier)
- Mappings from Linux users to Windows ones (see below)
- Symlinks and other reparse points
- Shell extension to identify and create subvolumes, including snapshots
- Hard links
- Sparse files
- Free-space cache
- Preallocation
- Asynchronous reading and writing
- Partition-less Btrfs volumes
- Per-volume registry mount options (see below)
- zlib compression
- LZO compression
- LXSS («Ubuntu on Windows») support
- Balancing (including resuming balances started on Linux)
- Device addition and removal
- Creation of new filesystems with mkbtrfs.exe and ubtrfs.dll
- Scrubbing
- TRIM/DISCARD
- Reflink copy
- Subvol send and receive
- Degraded mounts
- Free space tree (compat_ro flag free_space_cache )
- Shrinking and expanding
- Passthrough of permissions etc. for LXSS
- Zstd compression
- Windows 10 case-sensitive directory flag
- Oplocks
- Metadata UUID incompat flag (Linux 5.0)
- Three- and four-disk RAID1 (Linux 5.5)
- New checksum types (xxhash, sha256, blake2) (Linux 5.5)
- Defragmentation
- Support for Btrfs quotas
- Windows 10 reserved storage
- Full transaction log support
- Support for Windows transactions (TxF)
To install the driver, download and extract the latest release, right-click btrfs.inf, and choose Install. The driver is signed, so should work out of the box on modern versions of Windows.
If you using Windows 10 and have Secure Boot enabled, you may have to make a Registry change in order for the driver to be loaded — see below.
There’s also a Chocolatey package available — if you have Chocolatey installed, try running choco install winbtrfs .
If you want to uninstall, from a command prompt run:
You may need to give the full path to btrfs.inf.
You can also 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 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.
To compile with Visual C++ 2019, open the directory and let CMake do its thing. If you have the Windows DDK installed correctly, it should just work.
To compile with GCC on Linux, you will need a cross-compiler set up, for either i686-w64-mingw32 or x86_64-w64-mingw32 . Create a build directory, then use either mingw-x86.cmake or mingw-amd64.cmake as CMake toolchain files to generate your Makefile.
The user mappings are stored in the registry key HKLM\SYSTEM\CurrentControlSet\services\btrfs\Mappings. Create a DWORD with the 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 to a certain group. The setgid flag also works as on Linux.
LXSS («Ubuntu on Windows» / «Windows Subsystem for Linux»)
The driver will passthrough Linux metadata to recent versions of LXSS, but you will have to let Windows know that you wish to do this. From a Bash prompt on Windows, edit /etc/wsl.conf to look like the following:
It will then take effect next time you reboot. Yes, you should be able to chroot into an actual Linux installation, if you wish.
The DLL file shellbtrfs.dll provides the GUI interface, but it can also be used with rundll32.exe to carry out some tasks from the command line, which may be useful if you wish to schedule something to run periodically.
Bear in mind that rundll32 provides no mechanism to return any error codes, so any of these commands may fail silently.
rundll32.exe shellbtrfs.dll,ReflinkCopy This also accepts wildcards, and any number of source files.
The following commands need various privileges, and so must be run as Administrator to work:
rundll32.exe shellbtrfs.dll,SendSubvol [-p
] [-c ] The -p and -c flags are as btrfs send on Linux. You can specify any number of clone subvolumes.
On the releases page, there’s zip files to download containing the PDBs. Or you can try the symbols server http://symbols.burntcomma.com/ — in windbg, set your symbol path to something like this:
- The filenames are weird! or
- I get strange errors on certain files or directories!
The driver assumes that all filenames are encoded in UTF-8. This should be the default on most setups nowadays — if you’re not using UTF-8, it’s probably worth looking into converting your files.
- How do I get this working with Secure Boot turned on?
For the very latest versions of Windows 10, Microsoft introduced more onerous requirements for signing, which seemingly aren’t available for open-source drivers.
To work around this, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CI\Policy in Regedit, create a new DWORD value called UpgradedSystem and set to 1, and reboot.
Or you could always just turn off Secure Boot in your BIOS settings.
- The root of the drive isn’t case-sensitive in LXSS
This is something Microsoft hardcoded into LXSS, presumably to stop people hosing their systems by running mkdir /mnt/c/WiNdOwS .
- How do I change the drive letter?
With the shell extension installed, right-click the drive in Explorer, click Properties, and go to the Btrfs tab. There should be a button which allows you to change the drive letter.
- How do I format a partition as Btrfs?
Use the included command line program mkbtrfs.exe. We can’t add Btrfs to Windows’ own dialog box, unfortunately, as its list of filesystems has been hardcoded. You can also run format /fs:btrfs , if you don’t need to set any Btrfs-specific options.
- I can’t reformat a mounted Btrfs filesystem
If Windows’ Format dialog box refuses to appear, try running format.com with the /fs flag, e.g. format /fs:ntfs D: .
- I can’t mount a Synology NAS
Synology seems to use LVM for its block devices. Until somebody writes an LVM driver for Windows, you’re out of luck.
- I can’t mount a Thecus NAS
Thecus uses Linux’s MD raid for its block devices. You will need to install WinMD as well.
- The drive doesn’t show up
On very old versions of Windows (XP, Server 2003?), Windows ignores Linux partitions entirely. If this is the case for you, try running fdisk on Linux and changing your partition type from 83 to 7.
- Fixed deadlock on high load
- Fixed free space issue when installing Genshin Impact
- Fixed issue when copying files with wildcards in command prompt
- Increased speed of directory lookups
- Fixed race condition when booting with Quibble
- No longer need to restart Windows after initial installation
- Forced maximum file name to 255 UTF-8 characters, to match Linux driver
- Fixed issue where directories could be created with trailing backslash
- Fixed potential deadlock when Windows calls NtCreateSection during flush
- Miscellaneous bug fixes
- Fixed text display issue in shell extension
- Added support for mingw 8
- Fixed LXSS permissions not working in new versions of Windows
- Fixed issue where truncating an inline file wouldn’t change its size
- Fixed crash with Quibble where driver would try to use AVX2 before Windows had enabled it
- Fixed issue when running compressed EXEs
- Changed build system to cmake
- Upgraded zstd to version 1.4.5
- Added support for FSCTL_GET_RETRIEVAL_POINTERS
- Miscellaneous bug fixes
- Fixed crash when sending file change notifications
- Improved symlink handling with LXSS
- Added support for undocumented flag SL_IGNORE_READONLY_ATTRIBUTE
- Fixed corruption caused by edge case, where address allocated and freed in same flush
- Improved handling of free space tree
- Improved handling of very full volumes
- Fixed spurious warnings raised by GCC 10 static analyser
- Replaced multiplications and divisions with bit shift operations where appropriate
- Fixed combobox stylings in shell extension
- Added more fixes for booting from Btrfs on Windows 10
- Fixed occasional deadlock when deleting or closing files on Windows 10 1909
- Fixed crash when reading large ADSes
- Fixed occasional crash when writing files on RAID5/6
- Miscellaneous bug fixes
- Fixed crash when reading beyond end of file
- Fixed spurious checksum errors when doing unaligned read
- Added support for metadata_uuid incompat flag (Linux 5.0)
- Added support for three- and four-disk RAID1 (Linux 5.5)
- Added support for new checksum types: xxhash, sha256, blake2 (Linux 5.5)
- Greatly increased checksumming speed
- Greatly increased compression and decompression speed
- Fixed bug causing incorrect free-space reporting when data is DUP
- Fixed issue creating directories on LXSS when case=dir option set
- Added experimental (i.e. untested) ARM support (thanks to DjArt for this)
- Added fixes for booting from Btrfs on Windows 10
- Volumes will now get remounted if changed while Windows is asleep or hibernating
- Fixed corruption when mounting volume that hasn’t been unmounted cleanly by Linux
- Fixed crash when deleting subvolume
- More fixes for booting from Btrfs
- Added virtual $Root directory (see «NoRootDir» below)
- Added support for Windows XP
- Added support for renaming alternative data streams
- Added oplock support
- Fixed potential deadlock on boot
- Fixed possible crash on shutdown
- Fixed a bunch of memory leaks
- Many other miscellaneous bug fixes
- Added fragmentation percentage to property sheet
- Added support for Windows Server 2003 and Windows Vista
- Added pagefile support
- Improved support for file locking
- Added support for booting from Btrfs on Windows Server 2003 (see https://www.youtube.com/watch?v=-5E2CHmHEUs)
- Fixed issue where driver could open same inode twice
- Other miscellaneous bug fixes
- Added support for new rename and delete functions introduced to Windows 10
- Added support for Windows 10’s flag for case-sensitive directories
- Changed free-space calculation method to be more like that of the Linux driver
- Added more support for 128-bit file IDs
- Fixed bug causing outdated root items
- Fixed bug preventing writing to VHDs
- Reverted commit affecting the creation of streams
- Dramatic speed increase when opening many small files, such as with a Git repository
- Fixed crash on surprise removals of removable devices
- Added ability to change drive letters easily
- No longer creates free-space cache for very small chunks, so as not to confuse the Linux driver
- Fixed corruption when very large file created and then immediately deleted
- Minor bug fixes
- Support for Zstd compression
- Passthrough of Linux metadata to LXSS
- Refactored shell extension
- Fixed memory leaks
- Many other bug fixes
- Fixed deadlock
- Binaries now signed
- Minor bug fixes
- 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
- Reflink copy
- Sending and receiving subvolumes
- Group mappings (see Mappings section above)
- Added commands for scripting etc. (see Commands section above)
- Fixed an issue preventing mounting on non-PNP devices, such as VeraCrypt
- Fixed an issue preventing new versions of LXSS from working
- Fixed problem with the ordering of extent refs, which caused problems on Linux but wasn’t picked up by btrfs check
- Added support for reading compressed inline extents
- Many miscellaneous bug fixes
- Scrubbing
- TRIM/DISCARD
- Better handling of multi-device volumes
- Performance increases when reading from RAID filesystems
- No longer lies about being NTFS, except when it has to
- Volumes will now go readonly if there is an unrecoverable error, rather than blue-screening
- Filesystems can now be created with Windows’ inbuilt format.com
- Zlib upgraded to version 1.2.11
- Miscellaneous performance increases
- Miscellaneous bug fixes
- Volume property sheet, for:
- Balances
- Adding and removing devices
- Showing disk usage, i.e. the equivalent to btrfs fi usage
- Checksums now calculated in parallel where appropriate
- Creation of new filesystems, with mkbtrfs.exe
- Plug and play support for RAID devices
- Disk usage now correctly allocated to processes in taskmgr
- Performance increases
- Miscellaneous bug fixes
- Support for RAID5/6 (incompat flag raid56 )
- Seeding support
- LXSS («Ubuntu on Windows») support
- Support for Windows Extended Attributes
- Improved removable device support
- Better snapshot support
- Recovery from RAID checksum errors
- Fixed issue where creating a lot of new files was taking a long time
- Miscellaneous speed increases and bug fixes
- Compression support (both zlib and lzo)
- Mixed groups support
- No-holes support
- Added inode property sheet to shell extension
- Many more mount options (see below)
- Better support for removable devices
- Page file support
- Many miscellaneous bug fixes
- Massive speed increases (from «sluggish» to «blistering»)
- Massive stability improvements
- RAID support: RAID0, RAID1, and RAID10
- Asynchronous reading and writing
- Partition-less Btrfs volumes
- Windows sparse file support
- Object ID support
- Beginnings of per-volume mount options
- Security improvements
- Notification improvements
- Miscellaneous bug fixes
- Subvolume creation and deletion
- Snapshots
- Preallocation
- Reparse points
- Hard links
- Plug and play
- Free-space cache
- Fix problems preventing volume from being shared over the network
- Miscellaneous bug fixes
- Bug fixes:
- Fixed crashes when metadata blocks were SINGLE, such as on SSDs
- Fixed crash when splitting an internal tree
- Fixed tree traversal failing when first item in tree had been deleted
- Fixed emptying out of whole tree (probably only relevant to checksum tree)
- Fixed «incorrect local backref count» message appearing in btrfs check
- Miscellaneous other fixes
- Added beginnings of shell extension, which currently only changes the icon of subvolumes
- Bug fix release:
- Check memory allocations succeed
- Check tree items are the size we’re expecting
- Added rollbacks, so failed operations are completely undone
- Fixed driver claiming all unrecognized partitions (thanks Pierre Schweitzer)
- Fixed deadlock within CcCopyRead
- Fixed changing properties of a JPEG within Explorer
- Lie about FS type, so UAC works
- Many, many miscellaneous bug fixes
- Rudimentary security support
- Debug log support (see below)
WinBtrfs has three levels of debug messages: errors and FIXMEs, warnings, and traces. The release version of the driver only displays the errors and FIXMEs, which it logs via DbgPrint . You can view these messages via the Microsoft program DebugView, available at https://technet.microsoft.com/en-gb/sysinternals/debugview.
If you want to report a problem, it’d be of great help if you could also attach a full debug log. To do this, you will need to use the debug versions of the drivers; copy the files in Debug\x64 or Debug\x86 into x64 or x86. You will also need to set the registry entries in HKLM\SYSTEM\CurrentControlSet\Services\btrfs:
- DebugLogLevel (DWORD): 0 for no messages, 1 for errors and FIXMEs, 2 for warnings also, and 3 for absolutely everything, including traces.
- LogDevice (string, optional): the serial device you want to output to, such as \Device\Serial0 . This is probably only useful on virtual machines.
- LogFile (string, optional): the file you wish to output to, if LogDevice isn’t set. Bear in mind this is a kernel filename, so you’ll have to prefix it with «\??\» (e.g., «\??\C:\btrfs.log»). It probably goes without saying, but don’t store this on a volume the driver itself is using, or you’ll cause an infinite loop.
The driver will create subkeys in the registry under HKLM\SYSTEM\CurrentControlSet\Services\btrfs for each mounted filesystem, named after its UUID. If you’re unsure which UUID refers to which volume, you can check using btrfs fi show on Linux. You can add per-volume mount options to this subkey, which will take effect on reboot. If a value is set in the key above this, it will use this by default.
Ignore (DWORD): set this to 1 to tell the driver not to attempt loading this filesystem. With the Readonly flag, this is probably redundant.
Readonly (DWORD): set this to 1 to tell the driver not to allow writing to this volume. This is the equivalent of the ro flag on Linux.
Compress (DWORD): set this to 1 to tell the driver to write files as compressed by default. This is the equivalent of the compress flag on Linux.
CompressForce (DWORD): set this to 1 to force compression, i.e. to ignore the nocompress inode flag and even attempt compression of incompressible files. This isn’t a good idea, but is the equivalent of the compress-force flag on Linux.
CompressType (DWORD): set this to 1 to prefer zlib compression, 2 to prefer lzo compression, or 3 to prefer zstd compression. The default is 0, which uses zstd or lzo compression if the incompat flags are set, and zlib otherwise.
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 compress files. You might want to fiddle with this if you have a fast CPU but a slow disk, or vice versa. The default is 3, which is the hard-coded value on Linux.
MaxInline (DWORD): the maximum size that will be allowed for «inline» files, i.e. those stored in the metadata. The default is 2048, which is also the default on modern versions of Linux — the parameter is called max_inline there. It will be clipped to the maximum value, which unless you’ve changed your node size will be a shade under 16 KB.
SubvolId (QWORD): the ID of the subvolume that we will attempt to mount as the root. If it doesn’t exist, this parameter will be silently ignored. The subvolume ID can be found on the inode property sheet; it’s in hex there, as opposed to decimal on the Linux tools. The default is whatever has been set via btrfs subvolume set-default ; or, failing that, subvolume 5. The equivalent parameter on Linux is 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.
ZstdLevel (DWORD): Zstd compression level, default 3.
NoTrim (DWORD): set this to 1 to disable TRIM support.
AllowDegraded (DWORD): set this to 1 to allow mounting a degraded volume, i.e. one with a device missing. You are strongly advised not to enable this unless you need to.
NoRootDir (DWORD): if you have changed your default subvolume, either natively or by a registry option, there will be a hidden directory called $Root which points to where the root would normally be. Set this value to 1 to prevent this appearing.
I’d appreciate any feedback you might have, positive or negative: mark@harmstone.com.
This code contains portions of the following software:
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
This software is provided ‘as-is’, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source distribution.
WinBtrfs contains portions of an early version of lzo, which is copyright 1996 Markus Oberhumer. Modern versions are licensed under the GPL, but this was licensed under the LGPL, so I believe it is okay to use.
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name Facebook nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS «AS IS» AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.