LinuxCommandLibrary

pct-mount

Mounts Proxmox container filesystem

TLDR

Mount the filesystem of a specific container

$ pct mount [100]
copy

SYNOPSIS

pct mount CTID MOUNTPOINT

PARAMETERS

CTID
    Numeric ID of the container to mount

MOUNTPOINT
    Absolute path to empty host directory for mounting

--help, -h
    Display help and exit

--quiet, -q
    Quieter output

--verbose, -v
    Verbose output

--skiplock
    Skip locks (use with caution)

DESCRIPTION

The pct mount command, part of the Proxmox Container Toolkit (pct), allows mounting the root filesystem of an LXC-based container to a specified directory on the host. This is essential for host-level access to container files without starting the container, aiding in debugging, repairs, backups, or chroot operations.

Typically, stop the container first with pct stop <CTID>, create an empty mountpoint directory (e.g., /mnt/ct-root), then run pct mount <CTID> /mnt/ct-root. Access files via the mountpoint, then unmount with pct unmount <CTID> before restarting.

It supports both privileged and unprivileged containers, handling storage backends like directory, LVM, ZFS, or Ceph. The mount uses bind mounts, preserving container permissions and namespaces. Useful for editing /etc/fstab, recovering data, or applying fixes.

Requires root privileges and Proxmox VE environment. Ensure the mountpoint is empty to avoid conflicts.

CAVEATS

Container must be stopped before mounting. Mountpoint must exist and be empty. Unmount before starting container to avoid corruption. Not for running containers. Unprivileged containers may show remapped UIDs/GIDs.

EXAMPLE

pct stop 101
mkdir /mnt/ct101
pct mount 101 /mnt/ct101
# Edit files in /mnt/ct101
pct unmount 101
pct start 101

STORAGE SUPPORT

Automatically detects and mounts container storage (dir, lvm, zfs, btrfs, cephfs, rbd). Use pct config <CTID> to verify rootfs path.

HISTORY

Introduced in Proxmox VE 1.x (circa 2010) as part of pct toolkit for LXC management. Evolved with Proxmox versions, supporting modern storage like ZFS/Ceph in v4+ (2016). Maintained by Proxmox Server Solutions GmbH.

SEE ALSO

pct(1), pct-unmount, lxc-mount(1), pct-stop(1)

Copied to clipboard