The server rebooted and didn't come back. It responds to ping but SSH on port 22 times out, or the console is stuck on emergency mode waiting for the root password. If this picture looks familiar, the problem is probably boot-related, not network-related, and the fix doesn't happen from inside the running operating system. You need to bring the server up in rescue mode, manually mount the main disk, remove the fault, and then return to a normal boot. This article is that exact path, with commands that actually run.
What server rescue mode actually brings up
In rescue mode, the server boots a small, independent operating system from the network or from a separate image, not from your disk. The main disk stays untouched and is only made available as a block device. That means your filesystem isn't mounted, no service is running from it, and no process has locked the files. This is exactly what makes rescue mode usable for repairs: you can edit /etc/fstab, reinstall the kernel, or change the root password, without the broken operating system getting in your way.
A point many people realize too late: in rescue mode, the server's IP is usually not the same as before, or the network interface comes up under a different name. If you're connecting to the old IP with an automated script and getting a timeout, first check the address and port announced in the panel.
Before anything else: find the correct disk name
The first command you run in rescue mode is this:
lsblk -f
The output looks something like this:
NAME FSTYPE LABEL UUID MOUNTPOINT
vda
└─vda1 ext4 4f9c1e2a-... /mnt
vdb swap 8a3b7d10-...
On virtual servers, vda or sda is usually the main disk and the root partition is vda1. If you have LVM, lsblk only shows vda2 and you need to go one step further:
vgscan
vgchange -ay
lvs
After vgchange -ay, the logical volume appears with a name like ubuntu-vg/ubuntu-lv, and that's what you need to mount. If you skip this step and go straight to mounting, you'll get the error special device /dev/mapper/... does not exist and think the disk is lost. It isn't.
Mounting the main disk and entering it
Create a mount point and attach the root partition:
mkdir -p /mnt/root
mount /dev/vda1 /mnt/root
If you get the message unknown filesystem type 'LVM2_member', it means you've mounted an LVM partition; go back to the vgchange step. If you see the error Structure needs cleaning or bad superblock, the filesystem is damaged and you need to repair it before mounting:
fsck -y /dev/vda1
On XFS filesystems, use xfs_repair /dev/vda1 instead of fsck; fsck doesn't work on XFS and only throws errors. This is one of those places where your filesystem choice makes a difference in the middle of a crisis.
After a successful mount, to be able to run commands inside the root environment, bind two critical paths:
mount --bind /dev /mnt/root/dev
mount --bind /proc /mnt/root/proc
mount --bind /sys /mnt/root/sys
chroot /mnt/root /bin/bash
From this moment, your prompt is inside the broken operating system. Every command you run affects that same disk.
Three common faults that keep the server from booting
1. fstab error and falling into emergency mode
If the system comes up in emergency mode after adding a new disk or changing a UUID, the culprit is almost always /etc/fstab. One wrong line is enough for systemd to fail to fully mount the root. Inside the chroot, open the file and comment out the suspicious line with #. To see the real UUID:
blkid
Then write the line with the correct value:
UUID=4f9c1e2a-... / ext4 errors=remount-ro 0 1
Don't forget the nofail option for data disks; without it, a missing secondary disk halts the entire boot.
2. Incomplete kernel or initramfs after an update
If the boot stops at Kernel panic - not syncing: VFS: Unable to mount root fs, the initramfs was probably not built with the correct modules. Inside the chroot:
ls /boot
update-initramfs -u -k all
update-grub
On RHEL-family distributions, the equivalent commands are dracut -f and grub2-mkconfig -o /boot/grub2/grub.cfg. If /boot is full, the initramfs build is left half-finished and the same error comes back; check with df -h /boot.
3. A service that locks up the boot
Sometimes the operating system is healthy, but a broken unit stalls the boot for minutes and you think the server is dead. Inside the chroot, see which unit is waiting:
systemctl list-jobs
systemctl status networking
If a service is stuck on a port that another service has taken, or has a circular dependency, temporarily remove it from the boot path with systemctl disable. You can see the correct unit structure and dependencies in the systemd unit file: sections, restart, and dependencies; it explains there why After= without Requires= doesn't lock up the boot but Requires= does.
Where people go wrong
The most common mistake is that in rescue mode, a person mounts the disk, fixes the file, and then reboots the server without umount. The result: the filesystem stays dirty, or worse, the changes weren't written from the cache and after a normal boot you find the file is still broken. The sign is that everything looked fine but the problem came back. The correct exit order is:
exit
umount -R /mnt/root
sync
reboot
Second mistake: someone runs fsck on a mounted filesystem. fsck on a mounted filesystem can actually corrupt data, not just warn. If you see the message filesystem is mounted, unmount first.
Returning to a normal boot and the checks after it
After the reboot, if the system comes up, the job isn't done. Check three things:
dmesg -T | tail -50to see disk or I/O errors at boot timesystemctl --failedto see units that didn't come updf -handfree -mto make sure the partitions are mounted correctly
If the server shows abnormal load after a normal boot, the problem wasn't the boot and you need to look elsewhere; the guide diagnosing the cause of high server load; a practical, step-by-step guide is the right path.
Let me also state one limitation plainly: rescue mode is for software failures, not hardware failures. If smartctl -a /dev/vda shows a high Reallocated_Sector_Ct error or the disk doesn't appear in lsblk at all, repairing the filesystem just wastes time. There, the priority is copying data, not repairing. If you've completely lost access to the server, read reinstalling the server and working with rescue mode; saving data when you've lost access.
For servers running on cloud infrastructure, rescue mode is usually enabled from the management panel and doesn't require physical presence; if you haven't chosen your server yet, cloud server gives you this capability right in the panel. For lighter workloads like WordPress sites, Linux hosting is usually a more sensible option than a full server, since the boot layer and operating system repair aren't your responsibility.
Frequently asked questions
How is server rescue mode different from a normal boot?
In rescue mode, the operating system comes up from a separate image and your main disk isn't mounted. That means no service runs from your disk and you can freely edit or repair system files. In a normal boot, those same files are in use and won't allow changes.
Why doesn't SSH connect to the old IP after enabling rescue mode?
Because in rescue mode, the guest operating system comes up with its own network settings and may have a different IP or port. Get the connection address and port from the server management panel, not from memory or an old script.
Will my data be erased with rescue mode?
Rescue mode itself doesn't touch the data. The real danger comes from wrong commands you run inside the chroot; for example, mkfs on the wrong partition or fsck on a mounted filesystem. Before any destructive command, make sure with lsblk -f which device you're working on.
After the repair, how do I make sure the problem won't come back?
Do a test reboot and after it comes up, check systemctl --failed and dmesg -T | tail -50. If you see disk errors or a failed unit, the root cause is still there and only its symptom has been hidden.