3 ms·
This inspired me to study the possibility of booting on one linux and then chrooting to another linux. Reason being that I cannot update the first one, it being
by timonoko 2y ago
This inspired me to study the possibility of booting on one linux and then chrooting to another linux. Reason being that I cannot update the first one, it being too old, but it has important janitorial purposes. With the help of ChatGPT I made this script, where everything seems to work including x-windowed programs.
sudo mount /dev/sdb2 /mnt
sudo xhost +local:
sudo mount --bind /tmp/.X11-unix /mnt/tmp/.X11-unix
sudo cp ~/.Xauthority /mnt/root/.Xauthority
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /dev/pts /mnt/dev/pts
sudo unshare --uts chroot /mnt su -l timonoko
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt/dev/pts
sudo umount -l /mnt/dev
sudo umount -l /mnt/tmp/.X11-unix
sudo umount -l /mnt