0

I have the following situation: My main Ubuntu that is installed on PC's ssd won't boot because of 'dev/sdb2 clean' black screen I can't get through.

I installed a new test Ubuntu on my flash drive. I can now at least access my main Ubuntu's files from this Test Ubuntu as a partition but my question is How can I access my Main Ubuntu's console so that I can interact with it, e.g to run sudo apt-get purge nvidia* and try to fix my main Ubuntu boot problem.

1 Answer 1

0

Your main Ubuntu system is not running (because there can be only one OS running at a time, and you are running your test Ubuntu system and not the main one), so there is no console you can access.

To perform the operation you mentioned (sudo apt-get purge nvidia*) you don't have to "access console of your main Ubuntu" (which makes no sense), but need to change root of your filesystem. Normally, when you access your main Ubuntu partition from test system, it is mounted under some path, which means, the root of your partition is accessible under /some/path/name (you have to determine what is the actual pathname, I just use some placeholder), and the directory that would normally be /etc if your main Ubuntu were running, is accessible under /some/path/name/etc (the same for other directories like /bin, /usr etc.)

You must identify what is the actual /some/path/name mentioned above and type the following command which changes root to that path:

sudo chroot /some/path/name

Changing root means that the partition that was previously available under /some/path/name will now be visible as the actual root of your filesystem (/), as if you were running your main Ubuntu system (while you're actually still running the test system). So the /etc directory from your main Ubuntu will now actually be /etc, and so on. In that state, commands that modify various system files like apt-get, will modify files on your main Ubuntu system and not on the test one - which is probably what you need.

(BTW. if you type exit when working in changed root, you return to your original state, where your main Ubuntu system partition is again available under /some/path/name. You should do this when you are done.)

1
  • Thank you. It worked but unfortunately it didn't resolve my main problem.
    – Ilya
    Commented Oct 12, 2022 at 13:59

You must log in to answer this question.

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