Skip to content

Instantly share code, notes, and snippets.

@Sid110307
Last active June 2, 2025 17:42
Show Gist options
  • Select an option

  • Save Sid110307/ae450ed5562246ab811f3c91803a4a26 to your computer and use it in GitHub Desktop.

Select an option

Save Sid110307/ae450ed5562246ab811f3c91803a4a26 to your computer and use it in GitHub Desktop.
Commands for chroot
# Entering root
sudo su

# Initializing mounts
mkdir -p /mnt/chroot/boot/efi
mount /dev/sdb4 /mnt/chroot
mount /dev/sdb1 /mnt/chroot/boot
mount /dev/sdb3 /mnt/chroot/boot/efi
for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt/chroot$i; done
mount /dev/sdb5 /mnt/chroot/home

# Starting chroot
chroot /mnt/chroot
. /home/sid/.bash_aliases
init-chroot

# Cleanup (at the end)
umount /mnt/chroot/{boot/efi,boot,dev,proc,}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment