rar2fs: Mount RAR Archives as File Systems
rar2fs is a FUSE based file system that can mount a source RAR archive/volume or a directory containing any number of RAR archives and read the contents as regular files on-the-fly. Non-archived files located in the source directory are handled transparently.
rar2fs Installation (ubuntu)
apt install libfuse-dev
git clone https://github.com/hasse69/rar2fs.git /tmp/rar2fs
wget -q http://www.rarlab.com/rar/unrarsrc-5.4.5.tar.gz -P /tmp/rar2fs/
tar -zxf /tmp/rar2fs/unrarsrc-5.4.5.tar.gz -C /tmp/rar2fs
make -j$(($(nproc)+1)) -l$(($(nproc)+2)) -C /tmp/rar2fs/unrar
make install-lib -C /tmp/rar2fs/unrar
autoreconf -f -i /tmp/rar2fs/unrar
cd /tmp/rar2fs/; ./configure --with-unrar-lib=/tmp/rar2fs/unrar
make -j$(($(nproc)+1)) -l$(($(nproc)+2)) -C /tmp/rar2fs
make install -C /tmp/rar2fs
rm -rf /tmp/rar2fs
```
#!/bin/bash
# Install necessary dependencies
apt install wget2 libfuse libfuse-dev signify meson python3-looseversion python3-pytest -y
# Download and install rar
wget2 https://www.rarlab.com/rar/rarlinux-x64-701.tar.gz -P /tmp/
tar -xvzf /tmp/rarlinux-x64-701.tar.gz -C /tmp/
cd /tmp/rar
make -j$(($(nproc)+1)) -l$(($(nproc)+2)) -f makefile
# Download and install unrar
wget2 https://www.rarlab.com/rar/unrarsrc-7.0.8.tar.gz -P /tmp/
tar -xvzf /tmp/unrarsrc-7.0.8.tar.gz -C /tmp/
cd /tmp/unrar
make lib -j$(($(nproc) + 1)) -l$(($(nproc) + 2))
make install-lib -f makefile
# Clone, configure, and install rar2fs
git clone https://github.com/hasse69/rar2fs.git /tmp/rar2fs
cd /tmp/rar2fs
autoreconf -f -i
CONFIG_SHELL=/bin/bash ./configure --with-unrar=/tmp/unrar/
make -j$(($(nproc)+1)) -l$(($(nproc)+2))
make install
# Clone, configure, and install libfuse
wget2 https://github.com/libfuse/libfuse/releases/download/fuse-3.16.2/fuse-3.16.2.tar.gz -P /tmp/
tar -xvzf /tmp/fuse-3.16.2.tar.gz -C /tmp/
cd /tmp/fuse-3.16.2
mkdir build
cd $_
meson configure -D disable-mtab=true
meson setup --reconfigure ../
ninja
python3 -m pytest test/
ninja install
```
!!! "Mount rar-archives"
```bash
mkdir ~/rar2fs
rar2fs -o allow_other ~/downloads ~/rar2fs
```
Unmount rar2fs
fusermount -u ~/rar2fs
Automount rar folders
printf '\n%s\n' fuse allow_other,--seek-length=1 0 0"
Enable users to fusermount
sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf