How to recover from a renamed /etc directory in Mac OS Monterey (causing inability to log in)
I have Monterey installed in a VMware Fusion Player virtual machine.
I followed your instructions and was able to rename /private/etc
to /private/xetc
.
When I boot Monterey in single user mode, I see the following output. The image shows instructions in the form of three three commands, which can be used to mount the data partition on an SEP-enabled device.
Note: For a beter view of the image, click on the image or open the image in a new window.
Below is the output from the mount
command. Only the sealed, read-only volume is mounted on /
. This is why the /private
folder is empty.
So, I followed the instructions shown in the first image and entered the following commands.
Note: These commands produced messages, which I chose to ignore.
/sbin/mount -P 1
/usr/libexec/init_data_protection
/sbin/mount -P 2
Below is the output from the mount
command. Now, the Data volume is mount on /System/Volumes/Data
.
Since this Data volume was tagged with the data role metadata flag when created and is in the same APFS Volume Group as the initially mounted volume, both volumes share the root (
/
) mount point. In other words, this Data volume is mounted twice.
Next, I made the repair by entering the following command.
mv /private/xetc /private/etc
Note: I could have also made the same repair by entering the longer version given below.
mv /System/Volumes/Data/private/xetc /System/Volumes/Data/private/etc
Finally, I entered the command below to boot to Monterey.
exit