LinuxCommandLibrary

archivemount

Mount archives as virtual filesystems

TLDR

Mount an archive to a specific mountpoint

$ archivemount [path/to/archive] [path/to/mount_point]
copy

SYNOPSIS

archivemount [options] archive mountpoint

PARAMETERS

archive
    The path to the archive file you want to mount.

mountpoint
    The directory where the archive will be mounted.

-o options
    FUSE mount options. See the mount(8) manual page for details. Some useful options are `ro` (mount read-only), `allow_other` (allow other users to access the mount), and `uid`/`gid` (set the user/group ID for all files in the archive).

-u
    Unmount the archive from the specified mountpoint.

-V
    Display the version number and exit.

-d
    Enable debug mode.

DESCRIPTION

archivemount allows you to mount archive files (like tar, zip, rar, etc.) as virtual file systems.
This means you can access the contents of the archive as if they were regular files and directories, without needing to extract them first.
It uses libarchive to handle various archive formats, providing a convenient way to browse and manipulate archived data.
This can be particularly useful for accessing specific files within large archives or for scripting automation tasks that require access to archive contents without full extraction.
After mounting, you can use standard file system utilities (like ls, cp, cat, etc.) to interact with the archive's contents.
Unmounting is done via the fusermount command or by specifying the '-u' option of archivemount.

CAVEATS

Requires FUSE (Filesystem in Userspace) to be installed and configured. The performance might be slower compared to directly accessing extracted files, especially for large archives. Writes to the mounted archive may not be supported, depending on the archive format and the underlying libarchive capabilities.

EXAMPLE USAGE

To mount an archive 'myarchive.tar.gz' at the mountpoint '/mnt/archive':
archivemount myarchive.tar.gz /mnt/archive

To unmount the archive:
fusermount -u /mnt/archive or archivemount -u myarchive.tar.gz /mnt/archive

PERMISSIONS

When mounting the archive, file ownership and permissions within the mounted file system are determined by the FUSE options and the underlying archive metadata. Use the '-o uid=' and '-o gid=' options to control the user and group ownership of the files in the archive.

HISTORY

archivemount leverages FUSE to provide a user-friendly way to interact with archive files.
Its development aimed to simplify the process of accessing archived data without the overhead of extracting the entire archive.
It depends on libarchive for its archive format support, which is a widely used library for handling various archive types.

SEE ALSO

tar(1), zip(1), rar(1), fusermount(1), mount(8), umount(8)

Copied to clipboard