Fuse файловая система windows

Время на прочтение3 мин

Количество просмотров21K

Одной из приятных черт философии Unix, которую унаследовала Linux, является модульная организация файловой системы. И это, на самом деле, очень хорошо, так как в типичной установке ОС могут понадобиться различные файловые системы, вроде ext4, reiserfs, btrfs, или даже сетевые файловые системы — вроде nfs. Кроме того, в Linux существуют и виртуальные файловые системы, вроде /sys и /dev, которые помогают Linux сделать так, чтобы всё в ней выглядело бы как файл. Слабая сторона средств работы с файловыми системами в Linux заключается в том, что для создания механизмов, обеспечивающих работу файловой системы, нужно вносить изменения в ядро, или, как минимум, создавать загружаемые модули. Это, правда, не так уж и сложно, но, всё же, немного сложнее, чем разработка обычных программ. Решить эту проблему призван интерфейс FUSE (Filesystem in USErspace — файловая система в пользовательском пространстве). В частности, речь идёт о модуле файловой системы, который позволяет создавать новые файловые системы путём написания вполне обычного кода.

Мои любимые файловые системы пользовательского пространства

Существует несколько FUSE, которые способны принести тем, кто их применяет, реальную пользу. Вот некоторые из моих любимых:

  • sshfs — монтирует удалённую файловую систему, используя лишь ssh-доступ.
  • rclone — позволяет организовывать доступ ко многим удалённым файловым системам и осуществлять их монтирование.
  • tagsistant — файловая система, основанная на тегах, облегчающая работу с большим количеством файлов.
  • fuse-zip — позволяет монтировать zip-файлы в виде файловых систем.
  • gitfs — позволяет монтировать в виде файловых систем git-репозитории.

Есть и множество других FUSE. Разнообразие подобных файловых систем позволяет использовать их в самых разных сценариях. Например — и для организации локальной работы с файлами, и для привлечения к работе с данными мощностей облачных провайдеров.

А как насчёт Windows?

FUSE в Linux — это весьма полезная штука. А есть ли что-то подобное в Windows? Да, нечто такое есть и в Windows. Называется оно WinFsp и выглядит как интересный механизм для работы с файловыми системами. Правда, прямой совместимости с FUSE у него нет. Но имеются слои совместимости с FUSE (один — для версии 2.8, и ещё один — для версии 3.2), которые упрощают портирование существующего FUSE-кода на WinFsp.

Это — достаточно новый проект такого рода. Но существует ещё один подобный проект — Dokan, авторы которого говорят о наличии интерфейсов к его API для FUSE. Правда, если верить бенчмаркам, выполненным в рамках проекта WinFsp, оказывается, что WinFsp отличается более высокой производительностью.

Итоги

Если имеется какая-нибудь FUSE, которая вам очень нравится, то она, вероятно, является опенсорсной. А если она вам и правда нравится — вы можете попытаться портировать её на Windows. Если вы не используете Windows, но хотите написать собственную FUSE для этой платформы, вышеописанные проекты дадут вам достаточно простые механизмы для переноса ваших трудов на Windows.

Например, у вас может быть некая система для логирования данных. Вы решили, что хотите представить результаты её работы в виде файловой системы. Сделать это не так уж и сложно. Так, например, имеются некоторые структуры данных, которые нужно заполнить, причём, заполнять нужно далеко не все эти структуры. Нужно написать функции, которые будут использоваться в виде инструментов для чтения и записи данных, представляющих директории и файлы. Вот — пример, написанный на C. А вот — C++-обёртка, которая позволит создать файловую систему, написав меньше кода, чем при выборе C. В этом примере имеется всего четыре простых функции. Так что — если вам нужна собственная файловая система пользовательского пространства — вы, что для Linux, что для Windows, вполне можете создать её своими силами.

Возникала ли у вас когда-нибудь необходимость в создании собственной файловой системы?

From Wikipedia, the free encyclopedia

Filesystem in Userspace

Stable release

3.17.2[1] 
/ 23 April 2025; 20 days ago

Written in C
Operating system Unix, Unix-like
Type File system driver
License GPL for Linux kernel part, LGPL for Libfuse, Simplified BSD on FreeBSD, ISC license on OpenBSD; proprietary for macOS
Website github.com/libfuse/libfuse

Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a bridge to the actual kernel interfaces.

FUSE is available for Linux, FreeBSD, OpenBSD, NetBSD (as puffs), OpenSolaris, Minix 3, macOS,[2] MorphOS (as filesysbox.library), and Windows.[3]

FUSE is free software originally released under the terms of the GNU General Public License and the GNU Lesser General Public License.

The FUSE system was originally part of AVFS (A Virtual Filesystem), a filesystem implementation heavily influenced by the translator concept of the GNU Hurd.[4] It superseded Linux Userland Filesystem, and provided a translational interface using lufis in libfuse1.

FUSE was originally released under the terms of the GNU General Public License and the GNU Lesser General Public License, later also reimplemented as part of the FreeBSD base system[5] and released under the terms of Simplified BSD license. An ISC-licensed re-implementation by Sylvestre Gallon was released in March 2013,[6] and incorporated into OpenBSD in June 2013.[7]

FUSE was merged into the mainstream Linux kernel tree in kernel version 2.6.14.[8]

The userspace side of FUSE, the libfuse library, generally followed the pace of Linux kernel development while maintaining «best effort» compatibility with BSD descendants. This is possible because the kernel FUSE reports its own «feature levels», or versions. The exception is the FUSE fork for macOS, OSXFUSE, which has too many differences for sharing a library.[9] A break in libfuse history is libfuse3, which includes some incompatible improvements in the interface and performance, compared to the older libfuse2 now under maintenance mode.[10]

As the kernel-userspace protocol of FUSE is versioned and public, a programmer can choose to use a different piece of code in place of libfuse and still communicate with the kernel’s FUSE facilities. On the other hand, libfuse and its many ports provide a portable high-level interface that may be implemented on a system without a «FUSE» facility.

Operation and usage

[edit]

A flow-chart diagram showing how FUSE works: Request from userspace to list files (ls -l /tmp/fuse) gets redirected by the Kernel through VFS to FUSE. FUSE then executes the registered handler program (./hello) and passes it the request (ls -l /tmp/fuse). The handler program returns a response back to FUSE which is then redirected to the userspace program that originally made the request.

To implement a new file system, a handler program linked to the supplied libfuse library needs to be written. The main purpose of this program is to specify how the file system is to respond to read/write/stat requests. The program is also used to mount the new file system. At the time the file system is mounted, the handler is registered with the kernel. If a user now issues read/write/stat requests for this newly mounted file system, the kernel forwards these IO-requests to the handler and then sends the handler’s response back to the user.

Unmounting a FUSE-based file system with the fusermount command

FUSE is particularly useful for writing virtual file systems. Unlike traditional file systems that essentially work with data on mass storage, virtual filesystems don’t actually store data themselves. They act as a view or translation of an existing file system or storage device.

In principle, any resource available to a FUSE implementation can be exported as a file system.

On-disk file systems

[edit]

Conventional on-disk file systems can be implemented in user space with FUSE, e.g. for compatibility or licensing reasons.

  • Linear Tape File System: Allows files stored on magnetic tape to be accessed in a similar fashion to those on disk or removable flash drives.
  • NTFS-3G and Captive NTFS, allowing access to NTFS filesystems.
  • retro-fuse: retro-fuse is a user-space filesystem that provides a way to mount filesystems created by ancient Unix systems on modern OSes. The current version of retro-fuse supports mounting filesystems created by Fifth, Sixth and Seventh Edition of Research Unix from Bell Labs, as well as 2.9BSD and 2.11BSD based systems.

Layering file systems

[edit]

FUSE filesystems can create a view of an underlying file system, transforming the files in some way.

  • EncFS: Encrypted virtual filesystem
  • FuseCompress, gzipfs, Fuse-ZIP, CompFUSEd: Compressed virtual filesystems
  • Archive filesystems may also perform this task

Archive and backup file systems

[edit]

FUSE filesystems can expose the contents of archives or backup sets without having to first extract them.

  • archivemount
  • Atlas (Rubrik backup software): Immutable, distributed filesystem used by Rubrik Cloud Data Management data protection applications
  • Borg (backup software): Deduplicating backup program that allows backup archives to be mounted as FUSE filesystems.
  • Restic: Free, fast, efficient and secure backup software uses FUSE to be able to browse all of your backup snapshots as a regular file system
  • SPFS A file system for Spectrum Protect, designed to mount the backup server filespace anywhere on your server, and use the features included from the backup server (encryption, de-duplication, compression, filtering etc). This is a WORM file system.

Remote/distributed file system clients

[edit]

  • CernVM-FS: A distributed read-only software distribution system, implemented as a POSIX filesystem in user space (FUSE) using HTTP transport, to deliver software in a fast and reliable fashion at global scale.
  • CloudStore (formerly, Kosmos filesystem): By mounting via FUSE, existing Linux utilities can interact with CloudStore
  • ExpanDrive: A commercial filesystem implementing SFTP/FTP/S3/Swift using FUSE
  • FTPFS
  • GlusterFS: Clustered Distributed Filesystem having ability to scale up to several petabytes.
  • goofys: A FUSE filesystem that allows access to Amazon S3/Microsoft Azure storage with an emphasis on performance.
  • google-drive-ocamlfuse is a FUSE filesystem for Google Drive, written in OCaml. It lets you mount your Google Drive on Linux.
  • IPFS: A peer-to-peer distributed file system that seeks to connect all computing devices with the same system of files.
  • JuiceFS: A distributed POSIX file system built on top of Redis and S3.
  • KBFS: A distributed filesystem with end-to-end encryption and a global namespace based on Keybase.io service that uses FUSE to create cryptographically secure file mounts.
  • Lustre Cluster filesystem will use FUSE to allow it to run in userspace, so that a FreeBSD port is possible.[11] However, the ZFS-Linux port of Lustre will be running ZFS’s DMU (Data Management Unit) in userspace.[12]
  • MinFS: MinFS is a fuse driver for Amazon S3 compatible object storage server. MinFS[13] lets you mount a remote bucket (from a S3 compatible object store), as if it were a local directory.
  • MooseFS: An open source distributed fault-tolerant file system available on every OS with FUSE implementation (Linux, FreeBSD, NetBSD, OpenSolaris, OS X), able to store petabytes of data spread over several servers visible as one resource.
  • Nexfs: A commercial Linux file system that combines Block, File, and S3 compatible Cloud & Object storage into a single pool of POSIX compatible storage.
  • ObjectiveFS: Distributed filesystem with object store backend (Amazon S3, Google Cloud Storage or S3-compatible object store) using FUSE
  • Rclone can mount a variety of remote / cloud storage with FUSE.
  • s3fs: Gives the ability to mount an S3 bucket as if it were a local file system.
  • Sector File System: Sector is a distributed file system designed for large amount of commodity computers. Sector uses FUSE to provide a mountable local file system interface.
  • SSHFS: Provides access to a remote filesystem through SSH.
  • Transmit: A commercial FTP client that also adds the ability to mount WebDAV, SFTP, FTP and Amazon S3 servers as disks in Finder, via MacFUSE.
  • WebDrive: A commercial filesystem implementing WebDAV, SFTP, FTP, FTPS and Amazon S3
  • WikipediaFS: View and edit Wikipedia articles as if they were real files
  • Wuala: Was a multi-platform, Java-based fully OS integrated distributed file system. Using FUSE, MacFUSE and CBFS Connect respectively for file system integration, in addition to a Java-based app accessible from any Java-enabled web browser (service discontinued in 2015).
  • IndexFS: A remote file aggregating filesystem with transparent CURL access to distributed files.
  • GVfs: The virtual filesystem for the GNOME desktop
  • rvault: A secure and authenticated store for secrets and small documents using envelope encryption with one-time password (OTP) authentication. It uses FUSE to expose the vault as a file system.
  • EaseFilter-Cloud-File-System: A Windows cloud file system for developers in user space, to implement the load balancing and cloud-based disaster recovery.
  • PUFFS, a similar framework with FUSE compatibility
  • 9P (protocol)
  • Installable File System
  • Dokan Library FUSE Windows compatibility
  • Windows Projected File System (ProjFS)
  1. ^ «Release 3.17.2». 23 April 2025. Retrieved 24 April 2025.
  2. ^ «Home — FUSE for OS X».
  3. ^ Zissimopoulos, Bill (2021-02-14), billziss-gh/winfsp, retrieved 2021-02-16
  4. ^ «Some technical advantages of the Hurd». May 15, 2011. Retrieved March 28, 2016.
  5. ^ «WhatsNew/FreeBSD10 — FreeBSD Wiki».
  6. ^ «openbsd dev — tech — Fuse (and sshfs) support for OpenBSD». Archived from the original on 2020-10-26. Retrieved 2013-07-14.
  7. ^ «‘CVS: cvs.openbsd.org: src’ — MARC».
  8. ^ «file-systems.fuse.devel — FUSE merged to 2.6.14! — msg#00021 — Recent Discussion OSDir.com». Archived from the original on 2016-04-20.
  9. ^ «libfuse/libfuse, the reference implementation of the Linux FUSE (Filesystem in Userspace) interface». libfuse. 9 January 2020. Retrieved 9 January 2020.
  10. ^ «libfuse3 ChangeLog». GitHub. Retrieved 9 January 2020.
  11. ^ «Lustre FreeBSD». Archived from the original on 2008-03-12. Retrieved 2008-03-02.
  12. ^ «Architecture ZFS for Lustre». Sun Microsystems. Archived from the original on 2009-01-22. Retrieved 2008-03-02.
  13. ^ «minio/minfs». GitHub. Retrieved 12 April 2018.
  • Official website
  • Develop your own filesystem with FUSE by Sumit Singh
  • List of FUSE filesystems
  • Documentation/filesystems/fuse.txt documentation in Linux source tree
  • WinFSP, a FUSE-like system for Windows (a FUSE compatibility layer is provided for Cygwin)
  • Crossmeta FUSE, Port of FUSE to Windows (commercial software)

WinFuse · FUSE for the Windows kernel

Download

WinFuse is a suite of software components that allows FUSE file systems to run on Windows. Both Windows and Linux (WSL1) FUSE file systems are supported. Windows FUSE file systems are supported via a kernel driver that exposes the FUSE protocol via DeviceIoControl and a port of the libfuse library compiled as a Windows DLL. Linux FUSE file systems are expected to run in the WSL1 environment and are supported via a kernel driver that exposes /dev/fuse.

ARCHITECTURE

Structural Diagram

The following component diagram shows the WinFuse project components and their relations to the Windows OS (NTOS), WSL (LXCORE) and components that are provided by other projects.

Component Diagram

The components and their interfaces are:

  • The winfsp component which is provided by the WinFsp project.
    • The component is an NTOS File System Driver (FSD).
    • The component provides an FSP_FSCTL_TRANSACT DeviceIoControl interface.
    • The component is responsible for loading the winfuse component.
  • The winfuse component which is provided by the WinFuse project (this project).
    • The component is an NTOS driver.
    • The component provides an FUSE_FSCTL_TRANSACT DeviceIoControl interface.
    • The component connects to the FSP_FSCTL_TRANSACT interface. WinFsp file system requests retrieved via this interface are translated to FUSE file system requests and become available via FUSE_FSCTL_TRANSACT.
  • The wslfuse component which is provided by the WinFuse project (this project).
    • The component is an LXCORE driver.
    • The component provides a /dev/fuse Linux interface.
    • The component connects to the FSP_FSCTL_TRANSACT interface. WinFsp file system requests retrieved via this interface are translated to FUSE file system requests and become available via /dev/fuse.
  • The lxldr component which is provided by the LxDK project.
    • The component is an LXCORE driver.
    • The component is responsible for loading the wslfuse component.
  • The file system (FS) components which are user-mode programs provided by third parties.
    • A Windows WinFsp file system connects to the FSP_FSCTL_TRANSACT interface.
    • A Windows FUSE file system connects to the FUSE_FSCTL_TRANSACT interface.
    • A Linux FUSE file system connects to the /dev/fuse interface.

Behavioral Diagrams

The following sequence diagrams show how the WinFuse project components interact with other components in two scenarios: (1) I/O handled by a Windows FUSE file system, and (2) I/O handled by a Linux FUSE file system.

I/O handled by a Windows FUSE file system:

Windows FS Sequence Diagram

  • The I/O originates with one of:
    • A Windows process which uses a familiar API like ReadFile or WriteFile.
    • A WSL (Linux) process which uses an API like read(2) or write(2) that LXCORE translates into the equivalent NtReadFile or NtWriteFile.
  • The Windows OS (NTOS) packages this I/O into an IRP (I/O Request Packet) and routes it to the winfsp FSD.
  • The winfsp FSD posts the request into an internal I/O queue. This request is retrieved at a later time and in a different process context via an FSP_FSCTL_TRANSACT (issued via DeviceIoControl) by the winfuse driver.
  • The winfuse driver translates the request to equivalent FUSE requests, which are then retrieved via an FUSE_FSCTL_TRANSACT (issued via DeviceIoControl) by the Windows FUSE file system.
  • The Windows FUSE file system processes the request and prepares a response, which it sends to the winfuse driver via another FUSE_FSCTL_TRANSACT.
  • The winfuse driver processes the FUSE response and it may issue additional FUSE requests or it may translate it to a final WinFsp response, which it sends to the winfsp FSD via another FSP_FSCTL_TRANSACT.
  • The winfsp FSD completes the corresponding I/O, which allows the Originating Process to resume and retrieve the response.

I/O handled by a Linux FUSE file system:

Linux FS Sequence Diagram

This case is similar to the previous case except that the winfuse driver is replaced by the wslfuse driver that exposes the FUSE protocol via the /dev/fuse interface that the Linux FUSE file system understands.

Материал из Пингвиньи радостей

Перейти к: навигация, поиск

Статья о FUSE

FUSE (File system in userspace, файловая система в пространстве пользователя) это механизм, позволяющий обычному пользователю подключать различные объекты как специфичные файловые системы в собственном пространстве (например на жёстком диске в каталоге $HOME).

Так в качестве файловых систем могут быть подсоединены ресурсы Википедии (MediaWiki), Ssh/HTTP/FTP серверов, ISO/ZIP файлы и множество других объектов.
Кроме того могут быть изменены свойства отдельных папок, например изменены правила наследования прав, или установлено сжатие, или добавлено шифрование, или включена проверка на вирусы и тому подобное.
Подключение объекта как части файловой системы позволяет осуществлять доступ к нему через скрипты и любые (а не специфичные) файловые программы.
Для автоматического подключения/отключения пользовательских файловых систем по требованию (аналогично autofs) может быть использован пакет afuse.
Пример (авто)монтирования FUSE-файловых систем при старте операционной среды приведён в статье Fstab.

В таблице приведены ссылки на статьи по данной теме, размещённые в настоящий википедии.

ссылка краткое описание
Fuse-utils пакет для создания файловых систем FUSE
Afuse автомонтирование файловой системы FUSE в пользовательском пространстве
Avfs создание файловой системы из файлов с архивами, в том числе через интернет
Clamfs создание файловой системы защищённой антивирусом clamav
Curlftpfs создание файловой системы для доступа на ftp-сервер
Bindfs создание файловой системы с установкой произвольных правил доступа к ней
Wikipediafs создание файловой системы со статьям википедии на движке Mediawiki
Fusesmb создание файловой системы с SAMBA-ресурсами локальной сети
Smbnetfs создание файловой системы с SAMBA-ресурсами локальной сети
Djmount создание файловой системы с ресурсами Dlna-сервера
Sshfs создание файловой системы с ресурсами ssh-сервера
Encfs создание зашифрованной файловой системы поверх другой
Virtualbox-ose-fuse создание файловой системы из виртуальных жёстких дисков Virtualbox
Obexfs создание файловой системы через OBEX
Fuse-convmvfs создание файловой системы с автоматическим декодированием имён файлов и папок из одной кодировки в другую
Httpfs2 создание файловой системы из http или https URLS
Fuse-zip создание файловой системы из ZIP файла
Fuse-convmvfs создание зеркальной файловой системы от одной кодировки символов к другой

Литература

  • wikipedia.org: Filesystem in Userspace
  • FUSE
  • Побег за пределы ядра. Обзор файловых систем, основанных на fuse

Справочная информация

  • 02.03.2012: FUSE: создание статьи в википедии

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows 2008 r2 создание образа системы windows
  • Windows shop 50 cent
  • Отключить onedrive windows 10 gpo
  • Microsoft windows performance analyzer
  • Windows 10 почему проснулся