Mount after each reboot

June 10, 2025 ยท View on GitHub

TODO: How-to Instructions

Fixing Sudo

By default Android prevents suid usage under /data folder. This will prevent using sudo inside the rootfs. There is a few alternatives how this can be solved:

  1. fix-suid (automatic) The fix-suid feature is enabled automatically. It tries to remount /data with the correct suid and dev options, so sudo can work out of the box. If you want to disable this and use another method, you can run:
chroot-distro fix-suid <enable|disable>
  • enable : Forces enabling suid handling.
  • disable: Disables automatic remount logic.
  1. Image File Method
# Create image (adjust size as needed)
su -c truncate -S 15G /data/local/distros.img
su -c mke2fs -t ext4 /data/local/distros.img

# Mount after each reboot
su -c mount /data/local/distros.img /data/local/chroot-distro
  1. SD Card Method
    https://xdaforums.com/t/mount-ext4-formatted-sd-card.3769344/
1. Format SD card with ext4
2. Mount to `/data/local/chroot-distro`
3. Remount after each reboot

Overall Note:

  • Methods 2 & 3 are safer (prevent accidental command execution)
  • SD Card Method advantages:
    • Saves internal storage space
    • Reduces wear on internal storage
    • Extends device lifespan
    • Note: You can't use it for Android stuff (at least by default)

Custom Distribution Setup

  1. Add Distribution

    chroot-distro add <distro_name>
    
  2. Download Distribution

    chroot-distro download <distro_name> <download_link>
    
  3. Install Distribution

    chroot-distro install <distro_name>
    
  4. Login to Distribution

    chroot-distro login <distro_name>
    

chroot-distro on GNU/Linux

Install the chroot-distro script on your GNU/Linux system using the following commands:

curl "https://raw.githubusercontent.com/Magisk-Modules-Alt-Repo/chroot-distro/refs/heads/main/system/bin/chroot-distro" > /bin/chroot-distro
dos2unix /bin/chroot-distro && chmod +x /bin/chroot-distro
sed -i '1s/\/system//g' /bin/chroot-distro
sudo CHROOT_DISTRO_MOUNT=false chroot-distro android-bind disable && sudo CHROOT_DISTRO_MOUNT=false chroot-distro fix-suid disable

How to Delete chroot-distro

  1. Unmount all distros:
chroot-distro unmount all -a -f
  1. Check the installed distributions:
chroot-distro list
  1. Uninstall distributions one by one:
chroot-distro uninstall <distro>
  1. Remove the chroot-distro module.
  2. Permanently delete chroot-distro:
rm -r /data/local/chroot-distro