LinuxCommandLibrary

grub-mount

Mount a GRUB image for filesystem access

TLDR

Mount a block device or file system image to a mount point

$ grub-mount [/dev/sdXY] [/mnt]
copy

Mount an entire disk image's second partition, -r specifies the partition number in the image
$ grub-mount [[-r|--root]] [2] [disk.img] [/mnt]
copy

Mount an encrypted device and prompt for a passphrase
$ grub-mount [[-C|--crypto]] [/dev/sdXY] [/mnt]
copy

Load a ZFS encryption key from a file
$ grub-mount [[-K|--zfs-key]] /[path/to/zfs.key] [/dev/sdX] [/mnt]
copy

Show debugging output for a matching category
$ grub-mount [[-d|--debug]] [string] [image] [/mnt]
copy

Enable verbose output
$ grub-mount [[-v|--verbose]] [image] [/mnt]
copy

Display help
$ grub-mount [[-?|--help]]
copy

Display version
$ grub-mount --version
copy

SYNOPSIS

grub-mount [OPTION...] DEVICE MOUNT_DIR

PARAMETERS

-d, --directory=DIR
    use GRUB modules under DIR [default: /usr/lib/grub]

-m, --memdisk=MEMDISK
    use MEMDISK image for /boot/grub access

--device-map=FILE
    read FILE as GRUB device map

--no-blocklist
    disable blocklist probing

--no-floor
    disable floor device mapper

-o, --options=OPTS
    pass OPTS to FUSE mount

-r, --read-only
    mount read-only (default)

-v, --verbose
    enable verbose output

-h, --help
    display help

-V, --version
    print version

DESCRIPTION

grub-mount is a utility from the GRUB 2 bootloader package that mounts devices or filesystem images using FUSE, leveraging GRUB's native filesystem drivers. This enables access to boot partitions, disk images, or embedded filesystems recognized by GRUB, such as ext2/3/4, FAT, NTFS (read-only), BTRFS, XFS, ISO9660, and others, without relying on kernel modules.

It is especially useful for debugging GRUB boot issues, inspecting /boot/grub contents, recovering data from GRUB-compatible images, or testing filesystem integrity in a userspace environment. Unlike standard mount, it ensures compatibility with GRUB's exact drivers, avoiding kernel-FS mismatches.

Usage involves specifying a source device (e.g., /dev/sda1, a raw image file) and a target directory. Mounts default to read-only and are FUSE-based, allowing non-root access if FUSE is configured. The tool loads GRUB modules dynamically from specified directories.

Requires libfuse2 or libfuse3 and GRUB modules. Unmount with fusermount -u. Supports device maps for complex setups like virtual disks.

CAVEATS

Requires FUSE libraries and privileges (root or user FUSE config). Read-only by default; writable risky. Limited to GRUB-supported FS. Unmount with fusermount -u; ignores kernel mounts.

EXAMPLE

grub-mount /dev/sda1 /mnt/boot
grub-mount -v disk.img /mnt/image

FS SUPPORT

ext2/3/4, fat, ntfs (ro), btrfs, xfs, hfsplus, udf, iso9660; depends on modules

HISTORY

Added in GRUB 2.00 (2012) to extend GRUB utilities for userspace filesystem access, evolving from GRUB Legacy tools. Enhanced in later GRUB 2.x for more FS support and FUSE3 compatibility.

SEE ALSO

Copied to clipboard