Score:0

Access my Ubuntu from a flash drive

sa flag

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.

Score:0
cn flag
raj

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.)

Ilya avatar
sa flag
Thank you. It worked but unfortunately it didn't resolve my main problem.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.