- BTFS는
.torrent 파일이나 magnet link를 파일 트리의 읽기 전용 디렉터리처럼 마운트해 사용하는 비트토렌트 파일 시스템임
- 파일 내용은 애플리케이션이 읽을 때 온디맨드로 다운로드되며,
ls, cat, cp 같은 일반 도구가 예상대로 동작함
vlc, mplayer 같은 애플리케이션도 변경 없이 동작할 수 있어, 토렌트 콘텐츠를 일반 파일처럼 다룰 수 있음
- Debian/Ubuntu, Arch Linux, Gentoo, Fedora, Fedora OSTree, OpenSUSE, macOS에서 패키지 설치 방법을 제공함
- Linux 의존성은 fuse3, libtorrent, libcurl이며, 소스 빌드는
autoreconf, configure, make 흐름을 사용함
BTFS가 하는 일
- BTFS는
.torrent 파일 또는 magnet link를 마운트해 파일 트리 안의 읽기 전용 디렉터리처럼 사용할 수 있게 함
- 파일 내용은 애플리케이션이 실제로 읽을 때 온디맨드 다운로드됨
- 일반 파일 시스템 도구가 그대로 동작함
- 애플리케이션도 변경 없이 사용할 수 있음
기본 사용 흐름
- 마운트 디렉터리를 만들고 토렌트 파일을 연결한 뒤, 디렉터리 안의 파일을 일반 파일처럼 실행함
$ mkdir mnt
$ btfs video.torrent mnt
$ cd mnt
$ vlc video.mp4
- 마운트 해제와 종료는
fusermount로 수행함
$ fusermount -u mnt
패키지 설치
- Debian/Ubuntu에서는
apt-get으로 설치함
# apt-get install btfs
- Arch Linux에서는
pacman으로 설치함
# pacman -S btfs
# emerge -av btfs
- Fedora에서는
dnf로 fuse-btfs 패키지를 설치함
# dnf install fuse-btfs
- Fedora OSTree에서는
rpm-ostree로 fuse-btfs를 설치함
$ rpm-ostree install fuse-btfs
# zypper install btfs
$ brew install btfs
Linux 의존성
- Linux에서 필요한 의존성은 다음과 같음
- fuse3: Ubuntu 22.04에서는
fuse3
- libtorrent: Ubuntu 22.04에서는
libtorrent-rasterbar8
- libcurl: Ubuntu 22.04에서는
libcurl4
소스 빌드
- 최근 Debian/Ubuntu에서는 빌드 의존성을 설치한 뒤 저장소를 클론하고
autoreconf, configure, make를 실행함
$ sudo apt-get install autoconf automake libfuse3-dev libtorrent-rasterbar-dev libcurl4-openssl-dev g++
$ git clone https://github.com/johang/btfs.git btfs
$ cd btfs
$ autoreconf -i
$ ./configure
$ make
- 설치까지 원하면
make install을 추가로 실행함
$ make install
- macOS 빌드는
brew로 의존성을 설치한 뒤 같은 빌드 흐름을 사용함
$ brew install --cask macfuse libtorrent-rasterbar autoconf automake pkg-config
$ git clone https://github.com/johang/btfs.git btfs
$ cd btfs
$ autoreconf -i
$ ./configure
$ make
- macOS에서도 설치가 필요하면
make install을 실행함
$ make install