QuoteChanging root is commonly done for performing system maintenance on systems where booting and/or logging in is no longer possible. Common examples are:
- Reinstalling the bootloader.
Using chroot
First, mount the temporary API filesystems:# sudo mount /dev/sda5 /mnt
# cd /mnt
# mount -t proc /proc proc/
# mount -t sysfs /sys sys/
# mount --rbind /dev dev/
# mount --rbind /run run/
Finally, to change root into /location/of/new/root using a bash shell:# chroot /mnt /bin/bash
Quoteapt install extlinux
extlinux --install / --device /dev/sda5
vi /syslinux.cfg
prompt 0
timeout 1
default a
label a
kernel /boot/vmlinuz-4.15.0-45-generic
append initrd=/boot/initrd.img-4.15.0-45-generic root=/dev/sda5
prompt 0
timeout 1
default a
label a
kernel /boot/vmlinuz-4.15.0-45-generic
append initrd=/boot/initrd.img-4.15.0-45-generic root=/dev/sda5