Skip to main content

Filesystem Layout

Reference map of every significant directory in an ADL installation, covering the Android, Termux, proot-distro, and Ubuntu layers.

Overviewโ€‹

An ADL installation stacks four filesystem layers. Each layer has its own root, and paths that look identical may resolve to different physical locations depending on which context you are in.

โ„น๏ธPath context matters

/usr/bin inside the proot Ubuntu environment is not the same as $PREFIX/bin in Termux. Commands, libraries, and config files are distinct between contexts. Always confirm which shell you are in before modifying files.

Termux Filesystemโ€‹

Termux operates entirely within the Android app sandbox. The base path is /data/data/com.termux/files/. The environment variable $PREFIX points to the usr/ subtree.

PathEnv VariableDescription
/data/data/com.termux/files/home/$HOMEUser home directory for the Termux shell
/data/data/com.termux/files/usr/$PREFIXRoot of the Termux Unix-like filesystem
$PREFIX/bin/--Executables installed by pkg
$PREFIX/lib/--Shared libraries
$PREFIX/etc/--Configuration files (Termux-level)
$PREFIX/var/--Variable data, logs, proot-distro rootfs storage
$PREFIX/share/--Architecture-independent data, man pages, fonts
$PREFIX/tmp/$TMPDIRTemporary files; cleared on app restart
โš ๏ธWarning

Do not manually move or rename $PREFIX. Termux hard-codes this path at build time. Altering it will break package management and most installed tools.

proot-distro Filesystemโ€‹

proot-distro stores each installed distribution as a full rootfs directory tree under $PREFIX/var/lib/proot-distro/.

PathDescription
$PREFIX/var/lib/proot-distro/proot-distro base directory
$PREFIX/var/lib/proot-distro/installed-rootfs/Parent of all installed distro roots
$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu/Ubuntu rootfs (default ADL distro)
$PREFIX/var/lib/proot-distro/dlcache/Downloaded tarballs cache

When you run proot-distro login ubuntu, proot remaps the Ubuntu rootfs directory to / inside the session. Every path below is relative to that remapped root.

Ubuntu Filesystem Inside prootโ€‹

Inside the proot Ubuntu session the filesystem follows standard Linux FHS conventions.

PathDescription
/Root of the Ubuntu filesystem (physically $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu/)
/binEssential user binaries (symlink to /usr/bin on modern Ubuntu)
/etcSystem-wide configuration files
/homeNon-root user home directories
/rootHome directory for the root user
/usrSecondary hierarchy: binaries, libraries, headers
/usr/binMost user commands
/usr/libLibraries for /usr/bin binaries
/usr/shareArchitecture-independent data
/varVariable data: logs, caches, spool
/tmpTemporary files; writable by all users
/optOptional add-on software (manually installed tools)
โœ…๐Ÿ’ก Installing packages inside proot

Use apt (not pkg) when inside the Ubuntu proot session. The two package managers maintain separate databases and separate binary paths.

Shared Storageโ€‹

Running termux-setup-storage in the Termux shell creates symlinks under ~/storage/ that point to common Android directories. These links are accessible from both the Termux context and, if bind-mounted, from inside the proot session.

SymlinkAndroid PathContents
~/storage/shared//storage/emulated/0/Internal storage root
~/storage/downloads//storage/emulated/0/Download/Browser and app downloads
~/storage/dcim//storage/emulated/0/DCIM/Camera photos and videos
~/storage/music//storage/emulated/0/Music/Music files
~/storage/pictures//storage/emulated/0/Pictures/Screenshots, saved images
~/storage/movies//storage/emulated/0/Movies/Video files
โ„น๏ธNote

You must grant Termux storage permission in Android settings before running termux-setup-storage. The command will prompt for permission on first run.

Configuration File Locationsโ€‹

Key configuration files and where to find them in each context.

Config AreaPathContext
Bash (Termux)~/.bashrc, ~/.profileTermux
Bash (Ubuntu)/root/.bashrc, /root/.profileUbuntu proot
Termux properties~/.termux/termux.propertiesTermux
Termux font~/.termux/font.ttfTermux
Termux color scheme~/.termux/colors.propertiesTermux
XFCE4 desktop~/.config/xfce4/Ubuntu proot
XFCE4 panel~/.config/xfce4/panel/Ubuntu proot
XFCE4 terminal~/.config/xfce4/terminal/Ubuntu proot
proot-distro config$PREFIX/etc/proot-distro/Termux
VNC server~/.vnc/Ubuntu proot
VNC password~/.vnc/passwdUbuntu proot
VNC startup script~/.vnc/xstartupUbuntu proot
PulseAudio~/.config/pulse/, /etc/pulse/Ubuntu proot
User fonts~/.local/share/fonts/Ubuntu proot
System fonts/usr/share/fonts/Ubuntu proot
GTK themes~/.themes/, /usr/share/themes/Ubuntu proot
Icon themes~/.icons/, /usr/share/icons/Ubuntu proot

Important Paths Quick Referenceโ€‹

Single-table summary of the most referenced paths across all contexts.

PathDescriptionContext
/data/data/com.termux/files/home/Termux user homeTermux
/data/data/com.termux/files/usr/Termux prefix ($PREFIX)Termux
$PREFIX/bin/Termux-installed binariesTermux
$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu/Ubuntu rootfs on diskTermux
/Ubuntu root (inside proot)Ubuntu
/usr/bin/Ubuntu user binariesUbuntu
/etc/Ubuntu system configUbuntu
/root/Ubuntu root homeUbuntu
~/.config/xfce4/XFCE desktop configUbuntu
~/.vnc/VNC server configUbuntu
~/storage/shared/Android internal storageShared
~/storage/downloads/Android downloadsShared

Where to Store User Filesโ€‹

โญBest Practice

Keep personal projects and documents in a location accessible to both Termux and the proot Ubuntu session.

Recommended locations:

  • Inside the Ubuntu home directory (/root/ or /home/<user>/ within proot) for projects that only need Ubuntu tools. These files physically reside under the rootfs path in Termux.
  • Shared storage (~/storage/shared/) for files you also need from Android apps (file managers, media players, document editors). Be aware that Android may impose file-type restrictions on certain directories.
  • Termux home ($HOME in Termux) for scripts and dotfiles that must run before entering proot.
โš ๏ธBackup considerations

The Ubuntu rootfs directory is large and changes frequently. If you uninstall proot-distro or reset the distribution with proot-distro reset, all files inside the rootfs are deleted. Store irreplaceable data on shared storage or back it up externally.