Terminal in Recovery mode

I am running macOS 11.7.10 on MBP

Terminal runs fine all commands are installed in the zsh shell.


When I am in Recovery mode, the shell shows bash and many commands are missing. I have tried to reset the Path without success, I tried to change the shell to zsh without success.


I cannot go into the bash_profile because the nano-command is missing.

I spent quite some hours on the issue but no success.

When I look into the Volumes, is says Recovery volume= zero bytes Bash_profile= zero bytes.


I am at the end of my knowledge and I would like to have help/advise for the following:

  1. what is the physical location of the Recovery volume?
  2. Is there another way to reset the Path from the command-line?

I am not acquainted with Chroot or ViM. Could any one please try to advise?

MacBook Pro 15″

Posted on Mar 13, 2024 3:41 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 13, 2024 10:36 PM

Lance.scs wrote:

I am talking about the bin/bash or zsh profile folder bc that is where the references are.
But funny enough I found the physical recovery volume with ‘zero bytes’ the same with the zsh and bash profile.
That is where I got lost so please correct me if I am wrong.

I understand, but you are booted to an installer located on a virtual disk and all running in memory. You can only do a very limited number of things here even if you can access the other utilities on the main full macOS boot volume.


The macOS recovery environment (online or USB) consists of dozens of virtual volumes of various sizes and some may report zero bytes.


Beginning with macOS 10.15 Catalina, macOS now has a much more complex disk layout where the "Macintosh HD" volume is now two completely separate APFS volumes tied together behind the scenes so they appear as the traditional single "Macintosh HD" volume we've known for decades. There is now a read-only signed & sealed system volume containing the macOS system files & applications which is on a volume called "Macintosh HD". The second volume is a writable volume containing just your home user folder(s) and customized system preference files & system logs on a volume called "Data" (sometimes on older versions of macOS 10.15, "Macintosh HD - Data").


Most times macOS will not automatically mount both volumes so you may only see one of them. If you happen to boot to an older version of macOS, then that older version of macOS will not combine them together even if that OS is aware of the new drive layout & relationships. Usually you will need to manually mount the "Data" volume.


I think the biggest problem you are having in understanding the macOS installer environment is that you think it is like Single User Mode where you are booting into a command line environment of the full OS, but without the GUI interface. Recovery Mode is its own very limited & restricted environment that appears like a Single User Mode boot environment, but they are not the same. Even if you are booting into the local recovery mode, you are in effect booting from external media....at least that is the best way to think about it. Yes the local source of the boot files may be located on internal drive, but it is really acting like you booted from an external macOS USB installer....they are equivalent.


The macOS installer environment whether local recovery mode, Internet recovery mode, or bootable USB installer, is its own stand alone independent & limited OS environment. You will not be able to do very much with it. I don't know what commands you hope to access here, but if they are macOS specific, then they will only try to affect changes to the installer environment and not the main macOS boot volume. You will do better, if you actually tell us what is wrong with your macOS installation and what specifically you need to accomplish to fix it such as what do you need to modify on the main boot volume?


Your best option if your laptop supports it, and if macOS Big Sur still supports it, is to try booting into the old Single User Mode using Command + S. This boots to the main macOS boot volume and drops you into the command line after only loading a very small bit of macOS. This is what I think you really want & need assuming it can boot from the main macOS volume. Make sure to read the information on the screen since it provides instructions on how to mount the file system in write mode since it defaults to read-only mode.


If you actually describe the problem you have booting your Mac, then we may be able to assist you in resolving the boot issues or we may determine the issue is hardware related. There are a lot of very smart, talented, and creative contributors on this forum who have a lot of experience dealing with various macOS boot issues.

Similar questions

8 replies
Question marked as Top-ranking reply

Mar 13, 2024 10:36 PM in response to Lance.scs

Lance.scs wrote:

I am talking about the bin/bash or zsh profile folder bc that is where the references are.
But funny enough I found the physical recovery volume with ‘zero bytes’ the same with the zsh and bash profile.
That is where I got lost so please correct me if I am wrong.

I understand, but you are booted to an installer located on a virtual disk and all running in memory. You can only do a very limited number of things here even if you can access the other utilities on the main full macOS boot volume.


The macOS recovery environment (online or USB) consists of dozens of virtual volumes of various sizes and some may report zero bytes.


Beginning with macOS 10.15 Catalina, macOS now has a much more complex disk layout where the "Macintosh HD" volume is now two completely separate APFS volumes tied together behind the scenes so they appear as the traditional single "Macintosh HD" volume we've known for decades. There is now a read-only signed & sealed system volume containing the macOS system files & applications which is on a volume called "Macintosh HD". The second volume is a writable volume containing just your home user folder(s) and customized system preference files & system logs on a volume called "Data" (sometimes on older versions of macOS 10.15, "Macintosh HD - Data").


Most times macOS will not automatically mount both volumes so you may only see one of them. If you happen to boot to an older version of macOS, then that older version of macOS will not combine them together even if that OS is aware of the new drive layout & relationships. Usually you will need to manually mount the "Data" volume.


I think the biggest problem you are having in understanding the macOS installer environment is that you think it is like Single User Mode where you are booting into a command line environment of the full OS, but without the GUI interface. Recovery Mode is its own very limited & restricted environment that appears like a Single User Mode boot environment, but they are not the same. Even if you are booting into the local recovery mode, you are in effect booting from external media....at least that is the best way to think about it. Yes the local source of the boot files may be located on internal drive, but it is really acting like you booted from an external macOS USB installer....they are equivalent.


The macOS installer environment whether local recovery mode, Internet recovery mode, or bootable USB installer, is its own stand alone independent & limited OS environment. You will not be able to do very much with it. I don't know what commands you hope to access here, but if they are macOS specific, then they will only try to affect changes to the installer environment and not the main macOS boot volume. You will do better, if you actually tell us what is wrong with your macOS installation and what specifically you need to accomplish to fix it such as what do you need to modify on the main boot volume?


Your best option if your laptop supports it, and if macOS Big Sur still supports it, is to try booting into the old Single User Mode using Command + S. This boots to the main macOS boot volume and drops you into the command line after only loading a very small bit of macOS. This is what I think you really want & need assuming it can boot from the main macOS volume. Make sure to read the information on the screen since it provides instructions on how to mount the file system in write mode since it defaults to read-only mode.


If you actually describe the problem you have booting your Mac, then we may be able to assist you in resolving the boot issues or we may determine the issue is hardware related. There are a lot of very smart, talented, and creative contributors on this forum who have a lot of experience dealing with various macOS boot issues.

Mar 13, 2024 11:18 PM in response to HWTech

Thank you for the long and detailed explanation.

Sorry that I have not been very clear. Let me try again:

  1. I don't have a problem, the machine is working well.
  2. It is just when I had to disable SIP to remove some stubborn files, I noted that many commands were not recognized and, being as I am, this had to be sorted.
  3. That is when I tried to change the shell, which didn't work, clear the screen which didn't work, etc

Following the several replies including and most importantly your reply, I came to understand that this is the normal limited way of Terminal in Recovery mode.

4, Having said that, I come tot he conclusion that all the searching, re-installing and questions to the community were actually unnecessary.

My apologies because I should have searched first what the Recovery mode entails and what Terminal can do and cannot do.

Mar 13, 2024 5:58 PM in response to Lance.scs

The macOS installer has only the most basic command & utilities available. These commands & utilities are located on the installer's virtual volumes. You can try to use the commands from the main OS instead of the installer, but you will need to reference the full path of the missing items located on the internal drive. Depending on the command & utility, they may need to make reference to other utilities & libraries. You probably won't be able to use any macOS specific utilities since they may have too many ties to the main OS to work. Plus they tend to reference preference files located on the boot drive so it probably won't affect the preference files you want on the main boot drive.





Lance.scs wrote:

I need to see what’s inside the profile folder.

What do you mean by this? What profile folder?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal in Recovery mode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.