Is there The Way to get into Single User Mode w/o rebooting?
Like with old-days-UNIX when you can just send a command to init
and you're staring at black text screen with shell for your own use. ;)
Solution 1:
Depending on your needs, try changing the log in window to ask for a user name and then enter >console as the user.
This likely was removed at 10.10 so you’d need to boot to recovery or ssh in or use a terminal app if this legacy init type bypass isn’t what you seek.
- http://osxdaily.com/2018/09/02/access-login-console-terminal-mac/
Also, this isn’t true root single user mode, that needs to happen early in the boot process on modern macOS.
Solution 2:
Theory
In a nutshell, there's a documented in man launchctl
way to accomplish such a switch into Single Mode w/o kernel reboot. It can be deployed, for e. g., from Terminal window with a SHELL-command:
sudo launchctl reboot userspace -s
Practice
El Capitan
I tested it in El Capitan on a Macbook Air 2015 where it worked. But I also have report from a user that his attempts on El Capitan were unsuccessful though. The only difference I can think of is Retina which requires different graphics mode or somesuch. I don't have Macbook with Retina running El Capitan, so for the time being I can't tell anything more in support of such a version.
High Sierra, Mojave
My tries with High Sierra were showing that this functionality is no longer working (compared to El Capitan). Again, may be it's due Retina, it's not clear. Mojave doesn't have it working also.
Thorough explanation by a contributor¹
There is a way to get back down to single user mode from an up und running macOS without doing a full reboot by running
sudo launchctl reboot userspace -s
This will relaunch just the userspace part of macOS without restarting the Darwin kernel and is equivalent to changing the runlevel on old-day-UNIXes.
For additional details see man launchctl
:
reboot [system|userspace|halt|logout|apps|reroot ]
Instructs launchd to begin tearing down userspace. With no argu-
ment given or with the system argument given, launchd will make
the reboot(2) system call when userspace has been completely
torn down. With the halt argument given, launchd will make the
reboot(2) system call when userspace has been completely torn
down and pass the RB_HALT flag, halting the system and not ini-
tiating a reboot.
With the userspace argument given, launchd will re-exec itself
when userspace has been torn down and bring userspace back up.
This is useful for rebooting the system quickly under conditions
where kernel data structures or hardware do not need to be re-
initialized.
-s When rebooting the machine (either a full reboot or
userspace reboot), brings the subsequent boot session
up in single-user mode.
This means that on a technical level sudo launchctl reboot userspace -s
doesn't call reboot(2)
and therefore provides a way to switch to single user mode without a reboot.
Also the Wikipedia article on Single user mode says:
In OS X El Capitan and later releases of macOS, the mode can be reversed to single user mode with the command
sudo launchctl reboot userspace -s
in Terminal, and the system can be fully rebooted in single-user mode with the commandsudo launchctl reboot system -s
.
1 — Courtesy of @nohillside