- BTFS एक BitTorrent फ़ाइल सिस्टम है, जो
.torrent फ़ाइल या magnet link को फ़ाइल ट्री में read-only directory की तरह mount करके इस्तेमाल करने देता है
- फ़ाइल का कंटेंट तब on-demand डाउनलोड होता है जब application उसे पढ़ता है, और
ls, cat, cp जैसे सामान्य tools उम्मीद के मुताबिक काम करते हैं
vlc, mplayer जैसे application भी बिना बदलाव के चल सकते हैं, इसलिए torrent content को सामान्य फ़ाइल की तरह संभाला जा सकता है
- Debian/Ubuntu, Arch Linux, Gentoo, Fedora, Fedora OSTree, OpenSUSE, macOS पर package install करने के तरीके दिए गए हैं
- Linux dependencies हैं fuse3, libtorrent, libcurl, और source build
autoreconf, configure, make flow का उपयोग करता है
BTFS क्या करता है
- BTFS
.torrent फ़ाइल या magnet link को mount करके उसे फ़ाइल ट्री के भीतर read-only directory की तरह इस्तेमाल करने देता है
- फ़ाइल का कंटेंट तब on-demand डाउनलोड होता है जब application वास्तव में उसे पढ़ता है
- सामान्य file system tools वैसे ही काम करते हैं
- applications भी बिना बदलाव के इस्तेमाल किए जा सकते हैं
बेसिक उपयोग प्रवाह
- एक mount directory बनाएं, torrent फ़ाइल को जोड़ें, फिर directory के अंदर की फ़ाइलों को सामान्य फ़ाइलों की तरह चलाएं
$ mkdir mnt
$ btfs video.torrent mnt
$ cd mnt
$ vlc video.mp4
- unmount और exit
fusermount से किया जाता है
$ fusermount -u mnt
पैकेज इंस्टॉल
- Debian/Ubuntu में
apt-get से install करें
# apt-get install btfs
- Arch Linux में
pacman से install करें
# pacman -S btfs
- Gentoo में
emerge से install करें
# emerge -av btfs
- Fedora में
dnf से fuse-btfs package install करें
# dnf install fuse-btfs
- Fedora OSTree में
rpm-ostree से fuse-btfs install करें
$ rpm-ostree install fuse-btfs
- OpenSUSE में
zypper से install करें
# zypper install btfs
- macOS में
brew का उपयोग करें
$ brew install btfs
Linux dependencies
- Linux में ज़रूरी dependencies इस प्रकार हैं
- fuse3: Ubuntu 22.04 में
fuse3
- libtorrent: Ubuntu 22.04 में
libtorrent-rasterbar8
- libcurl: Ubuntu 22.04 में
libcurl4
source build
- हाल के Debian/Ubuntu में पहले build dependencies install करें, फिर repository clone करके
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
- अगर install भी करना हो, तो अतिरिक्त रूप से
make install चलाएं
$ make install
- macOS build में
brew से dependencies install करने के बाद वही build flow इस्तेमाल करें
$ 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 में भी install की ज़रूरत हो तो
make install चलाएं
$ make install
1 टिप्पणियां
Hacker News की राय
अच्छा होगा अगर इसके साथ जोड़ी में एक server program भी हो। मेरा मतलब है, जो torrent file generator, tracker और simple file server—तीनों की भूमिका निभाए
बड़े संगठनों में server पर भारी मात्रा में public data रखा जा सकता है, data बदलने पर हर बार torrent बनाए जा सकते हैं,
.torrentfiles को HTTP से serve करते हुए tracker की भूमिका भी निभाई जा सकती है। FUSE client में बस इतना simple logic wrap करना होगा कि वह server के नए torrents detect करके उन्हें reload/mount कर देकाफी पहले मैंने बैंकों के लिए एक Linux distribution बनाया था। यह Ubuntu NetBoot पर आधारित था और branch desktops के लिए केवल minimal packages रखे गए थे; branches में server नहीं था, इसलिए distribution self-seeding करता था। अगर switch पर wake-on-lan और PXE ही configured हों, तो एक machine से building के अंदर सैकड़ों machines को काफी कम समय में clone किया जा सकता था, और नए clones भी seed बन सकते थे
internally हम nginx से custom Ubuntu repository serve करते थे और tftp/inetd व wackamole चलाते थे। machine install होने पर वह “server” से torrent लेकर transmission में add करती थी, और completion के बाद वह machine भी seed बन जाती थी और wackamole, inetd, nginx, tracker आदि शुरू कर देती थी। शुरुआत में 10 machines को reliably seed करते थे, और जब सब ऊपर आ जातीं तो और machines को wake करते थे
बैंक की सैकड़ों branches में कुछ ही हफ्तों में 8000 machines पर image deploy किया; delay का ज्यादातर कारण change management और phased rollout plan था। असल में सबसे मुश्किल काम था existing Linux build के जरिए हर branch में पहला seed download कराना और उनमें से एक को seed machine के रूप में इस्तेमाल कराना। 350 से ज्यादा branches में कमजोर links पर काम हुआ, कुछ तो 256kbps ISDN पर थीं
मैंने इसे वास्तव में इस्तेमाल नहीं किया है, इसलिए नहीं पता कि AWS resulting
.torrentमें अपना tracker डालता है या नहींइस tool को BitTorrent v2 की नई features use करने के लिए upgrade किया जाना चाहिए
https://blog.libtorrent.org/2020/09/bittorrent-v2/
खास तौर पर Merkle hash tree अहम है, जो per-file hash tree और directory structure संभव बनाता है
तब मैं बड़े files ज्यादा आसानी से delete कर सकूंगा, यह जानते हुए कि वही copy बाद में आसानी से फिर से मिल सकती है। पहले IPFS से कुछ ऐसा करने की कोशिश की थी, लेकिन ठीक से नहीं हुआ और duplicate files भी नहीं मिल पाए
काश ऐसा BTFS हो जो “damaged” media files को ठीक कर दे। जैसे किसी disk में scratch के कारण कुछ हिस्से missing हों, या मेरे चुने हुए codec options अच्छे न रहे हों, तो केवल damaged हिस्से download करके smooth तरीके से recover कर दे
http://www.accuraterip.com/
मैं हमेशा unnecessary files delete कर देता हूं, इसलिए partial torrent form की जरूरत होगी
पता नहीं NNTP file system implementation सही से काम करता है या नहीं, लेकिन nzbfs भी है: https://github.com/danielfullmer/nzbfs
यह ज्यादा इस्तेमाल नहीं होता, यह देखकर हैरानी हुई, इसलिए पोस्ट कर रहा हूं। क्या virtual machines या operating systems को BTFS पर overlay के रूप में नहीं बनाया जा सकता? यह एक दिलचस्प दिशा लगती है
boot के समय initrd read-only overlayfs के रूप में mount होता है। configuration public कर रखी है: https://github.com/jhvst/nix-config
बाद में PXE router setup सहित IPFS process का documentation https://github.com/majbacka-labs/nixos.fi पर लिखने की योजना है। जो लोग इस process को आजमाना चाहते हैं, उनके लिए Flake setup वाला एक छोटा public build server भी चला सकता हूं
https://github.com/uber/kraken
https://cernvm.cern.ch/fs/
Internet Archive के कंटेंट तक पहुँचने के लिए यह एकदम सही क्लाइंट है। IA के हर item के साथ IA के web seed वाला torrent अपने-आप जुड़ा होता है। Big Buck Bunny से टेस्ट कर सकते हैं
btfshttps://archive.org/download/BigBuckBunny_124/BigBuckBunny_1...mountpointROM bundles या magazine archives में यह अक्सर दिखता है। अगर items 1000 से ज़्यादा हों, तो torrent में आम तौर पर सिर्फ शुरुआती लगभग 200 ही होते हैं
btplay https://archive.org/download/BigBuckBunny_124/…संबंधित पोस्ट:
BTFS – mount any .torrent file or magnet link as directory - https://news.ycombinator.com/item?id=23576063 - June 2020 (121 comments)
BitTorrent file system - https://news.ycombinator.com/item?id=10826154 - Jan 2016 (33 comments)
आगे बढ़कर, अच्छा होगा कि डेटा को full-text search index वाले sqlite file के रूप में store किया जाए। तब जरूरत पड़ने पर torrents में full-text search किया जा सकता है: https://github.com/bittorrent/sqltorrent
4 साल पहले की चर्चा:
https://news.ycombinator.com/item?id=23576063
2020 के 121 comments वाले पुराने thread में saurik का top-level comment इस स्थिति को लेकर मेरी भावना को अच्छी तरह summarize करता है: https://news.ycombinator.com/item?id=23580334
मतलब BTFS, IPFS का “एक बार में एक CID” वाला version है
IPFS शानदार है, लेकिन रोजमर्रा के इस्तेमाल लायक बनने के लिए मुझे लगता है कि कम-से-कम तीन क्षेत्रों में बड़ी प्रगति चाहिए। पहला, local node proxy चलाने की जरूरत नहीं होनी चाहिए। मैंने सुना है कि Brave में WebTorrent support built-in है, लेकिन मैं Brave इस्तेमाल नहीं करता, इसलिए नहीं जानता कि यह सिर्फ नाम में WebTorrent है या सच में वैसा है
दूसरा, swarm/peer resolution latency “web3 cryptocurrency शरारत” जैसी ही दर्दनाक है, और उसी delay की वजह से browsing पुराने 14.4k modem वाले दौर जैसी लगती है
तीसरा, IPFS Wikipedia, game releases, MDN content जैसे कम बदलने वाले लेकिन बेहद popular content के लिए बेहतरीन है। लेकिन अगर git repository browse करने की सोचें, तो “tip” या “main” को updated version में बदलना काफी झंझट भरा है। मेरी जानकारी में latest CID resolve करने का तरीका सिर्फ IPNS है, और DNS ऐसा mechanism है जो failures के समय उलझने वाले कई factors में से एक आसानी से बन जाता है
मुझे पता है कि submitted file system के बजाय दूसरे file system पर मैंने कुछ ज़्यादा ही लंबा लिख दिया, लेकिन जहाँ मुझे BTFS install करने की संभावना कम लगती है, वहीं इस idea में interested लोगों के लिए IPFS के बारे में और पढ़ना worthwhile है। बस इसकी मौजूदा limitations ध्यान में रखना बेहतर होगा
https://github.com/anacrolix/torrent में 2013 से FUSE driver था। अब उसे हटाने के शुरुआती चरण में हैं
WebDAV, third-party FUSE, HTTP wrappers सभी मिलते-जुलते काम कर रहे हैं। यानी magnet links, info hashes और torrent files को immutable file system की तरह serve करना। BitTorrent v2 support फिलहाल master में मौजूद है