7

I have two partitions on my PC, each with Ubuntu 20.04 installed (separately). One of them has gone south, something related to graphics drivers and maybe also the bootloader. Is it possible to change things for the malfunctioning version from the one that still works? Such as uninstalling certain things, or changing the graphics driver? (I do not seem able to enter recovery mode, maybe because this is an old Macbook Air.)

I'm relatively new to Ubuntu so would appreciate baby step style guidance.

[UPDATE: the first answer below is exactly what I was looking for. I don't think the other answer that has been suggested as a "duplicate" is helpful. It's tangential, that's all.]

5

2 Answers 2

9

If you're able to boot to another Ubuntu system, you can chroot to your root partition.

Check which partition you're using for your broken installation. I'll use /dev/sdb3 in this example. Replace the value of the root variable below:

root=/dev/sdb3
cd /
sudo mkdir /mnt/repair
sudo mount "$root" /mnt/repair
sudo mount -t proc proc /mnt/repair/proc
sudo mount -t sysfs sys /mnt/repair/sys
sudo mount -o bind /dev /mnt/repair/dev

You may need to mount /boot and /boot/efi. Simply use sudo mount /dev/sdb2 /mnt/repair/boot where /dev/sdb2 is the boot partition.

Now, to chroot, use this:

sudo chroot /mnt/repair

You're now logged in as root in your broken Ubuntu installation. You can now do anything you want to repair your system.

Once you're done, use the following commands to clean up:

# Make sure there are no processes running in your chroot session
# Then, exit
exit
sudo umount /mnt/repair/{proc,sys,dev}
sudo umount /mnt/repair

Reference

0
0

Could you boot into the working one? If so, you can mount the partition of the malfunctioning one like:

sudo mount /dev/sda1 /mnt
cd /mnt

then delete something that could possibly causing the problems under /mnt.

1
  • 3
    How willyou delete graphic drivers or other packages in this way ? You cannot use apt or other tools.
    – Soren A
    Jan 29, 2021 at 6:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .