podman-mount(1)

πŸ“¦
version 6.1.4 Β· 6 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’… podman-mount β€” bestie edition

okay so real quick: this is podman-mount(1), from the General Commands Manual, and it's literally the glow-up your container's root filesystem has been waiting for. let's get into it ✨


🌸 NAME 🌸

podman-mount β€” mount a working container's root filesystem. that's it, that's the whole vibe. πŸ’–


✨ SYNOPSIS ✨

podman mount [options] [container ...]

podman container mount [options] [container ...]

two ways to say the same thing, both iconic, pick your fighter 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: it mounts the root file system of the container(s) you specify somewhere the host can actually reach, and then it tells you where that spot is. that's the tea. β˜•

Now β€” if you run this command with no arguments at all, Podman is gonna list out every currently mounted container, and yes that includes external containers. what's an external container, you ask? it's a container sitting in container/storage that got put there by some tool that is not Podman. examples given: Buildah and CRI-O. they're valid, they're just not ours, no cap. πŸ’

⚠️ rootless mode tea: rootless mode only supports mounting the VFS driver, unless you're running Podman inside the user namespace via the podman unshare command. every other storage driver fails to mount. that's not a skill issue, that's just how it is, don't @ me. 😭

πŸ’« RETURN VALUE πŸ’«

  • the location of the mounted file system πŸŽ€
  • on error: an empty string and errno get returned. sad girl hours, fr fr. πŸ’€

πŸ‘‘ OPTIONS πŸ‘‘

  • --all, -a β€” mount all the podman containers. (external containers do not get mounted, they're not invited to this party πŸ™ˆ)
  • --format=format β€” print the mounted containers in the format you specify (json is the one mentioned here). ✨
  • --latest, -l β€” instead of typing out a container name or ID, just grab the last created container. 🫢
    • > ⚠️ heads up bestie: the last started container can be from other users of Podman on the host machine. sharing is caring but also sharing is chaos.
    • > also: this option is not available with the remote Podman client, which includes Mac and Windows machines (excluding WSL2). πŸ’…
  • --no-trunc β€” do not truncate the output (default false). let it be long, let it breathe, main character energy. πŸ’–

🌈 EXAMPLES 🌈

rootful mode, mounting a specific container πŸŽ€

# podman mount c831414b10a3
/var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged

look at that path. gorgeous. 😌

rootless mode: mounting only works from inside the user namespace πŸ’œ

$ podman unshare
# podman mount affectionate_mcnulty
/home/dwalsh/.local/share/containers/storage/overlay/4218326b9a80619aef005ff95067f76687ad975ce101c176598fb416f6186906/merged

shoutout to affectionate_mcnulty, she's doing great. 🧚

listing the currently mounted containers πŸ¦‹

podman mount
c831414b10a3 /var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
a7060253093b /var/lib/containers/storage/overlay/0ff7d7ca68bed1ace424f9df154d2dd7b5a125c19d887f17653cbcd5b6e30ba1/merged

two whole containers, thriving, no notes. ⭐

mounting multiple containers at once πŸ”₯

podman mount c831414b10a3 a7060253093b
/var/lib/containers/storage/overlay/f3ac502d97b5681989dff84dfedc8354239bcecbdc2692f9a639f4e080a02364/merged
/var/lib/containers/storage/overlay/0ff7d7ca68bed1ace424f9df154d2dd7b5a125c19d887f17653cbcd5b6e30ba1/merged

she ate and left no crumbs. πŸ“


🌟 SEE ALSO 🌟

podman(1), podman-unmount(1), podman-unshare(1), mount(8)

go read your friends too, they're all slay. πŸ’–


and that's the whole page bestie!! podman-mount(1), living in the General Commands Manual, signed off with podman-mount(1) at the bottom like a little autograph. stay mounted, stay unbothered. πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from