⚡ Commands: reboot & shutdown (Power Management)
In the Linux world, especially on a DIY system like Arch Linux, power commands are more than just "turning it off." They are signals sent to the system init (systemd) to safely close your Java IDE, sync your file buffers to the SSD, and unmount your partitions.
1. The "Why"
- Kernel Updates: After a
pacman -Syuupdates your kernel, you must reboot to start using the new version. - System Hangs: If your Hyprland session freezes, switching to a TTY (
Ctrl+Alt+F3) and typing a reboot command is safer than pulling the power plug. - Remote Management: When you are connected via SSH to your server, these are the only ways to power it down.
2. The shutdown Command
This is the most flexible tool. It allows you to schedule when the system goes down and send warnings to other logged-in users.
- Shut down immediately:
sudo shutdown now - Reboot immediately:
sudo shutdown -r now - Schedule a shutdown:
sudo shutdown +10 "Saving your work, system shutting down in 10 minutes!"(The message appears in the terminals of all logged-in users.) - Cancel a scheduled shutdown:
sudo shutdown -c
3. The Modern systemctl Way
On Arch, reboot and poweroff are actually just shortcuts (symbolic links) to systemctl. Many users prefer these because they are shorter.
- Power Off:
systemctl poweroff - Reboot:
systemctl reboot - Suspend (Sleep):
systemctl suspend - Hibernate:
systemctl hibernate
4. Comparison of Power States
| State | Command | What Happens? |
|---|---|---|
| Poweroff | poweroff |
All processes killed, disks unmounted, power cut. |
| Reboot | reboot |
System stops everything, then tells the motherboard to start again. |
| Suspend | suspend |
Moves state to RAM. Fast wake-up, but uses a tiny bit of battery. |
| Hibernate | hibernate |
Moves state to Swap (SSD). No power used, but slower to wake up. |
5. Troubleshooting: The "Magic SysRq" Key
Sometimes, a system is so frozen that even the reboot command won't work. Before you hit the physical reset button , try the REISUB method.
This is a series of kernel-level commands that safely reboots the system even during a hard freeze.
- Hold
Alt+SysRq(usually thePrint Screenkey). - While holding them, slowly type: R E I S U B
Raw (take control of keyboard) -> End (kill processes) -> Illuminated (kill everything else) -> Sync (flush data to disk) -> Unmount (make disks read-only) -> Boot (reboot).
6. Pro-Tips
- Update Discipline: On Arch, if you notice your USB drives aren't mounting or your GPU is acting weird after an update, it’s usually because you updated the kernel but haven't rebooted yet.
- Scheduled Tasks: If you are running a long simulation at night, you can chain commands:
python3 simulate.py && systemctl poweroff. This turns off the PC automatically when the math is done. - Fastboot: If your Arch boot is slow, use
systemd-analyze blameafter a reboot to see which service is slowing you down.
7. Summary Reference
| Goal | Command |
|---|---|
| Instant Power Off | poweroff or shutdown now |
| Instant Reboot | reboot |
| Cancel Shutdown | shutdown -c |
| Reboot to BIOS | systemctl reboot --firmware-setup |