Guide to Rescuing Ubuntu VPS Boot Using SystemRescue and Restoring GRUB

VPTS Team Content has been moderated
Published date:11/8/2026 Update:12/8/2026 Views:177 Reviews: 4.7/5176reviews
VPTS on

Procedure for rescuing an unbootable Ubuntu VPS due to missing GRUB or /boot directory using SystemRescue 13.01, applicable to GPT disks running Legacy BIOS.

Guide VPS UbuntuSystemRescueGRUBLinuxVPS rescue

Ubuntu VPS may fail to boot after partition, kernel, or GRUB corruption. In the event that the system loses the entire folder/boot, only re-runningupdate-grubis usually not enough because the machine no longer has a kernel and initramfs to load the operating system.

This article guides the rescue procedure usingSystemRescue 13.01, based on a successful recovery case with Ubuntu 24.04 LTS, VirtIO disk/dev/vda, GPT partition table, and Legacy BIOS firmware.

1. Scope of Application

The procedure below is written for the following sample structure. If your VPS has a different structure, replace it with the correct device name and corresponding GRUB installation method.

ComponentsSample caseWhen other systems
System drive/dev/vdaCan be/dev/sdaor/dev/nvme0n1
Root filesystem/dev/vda1, ext4, label rootSelect the correct target partition/etc/os-release
FirmwareLegacy BIOSIf UEFI, do not use targeti386-pc
Partition tableGPTMBR drive requires no partitionbios_grub
Operating systemUbuntu 24.04 LTSRHEL, AlmaLinux, and Rocky Linux use different GRUB command names

2. Boot VPS from ISO SystemRescue

  1. Attach filesystemrescue-13.01-amd64.isointo the VPS from the provider's control panel.
  2. Move CD/DVD/ISO to the top of the boot order.
  3. SelectBoot SystemRescue using default options.
  4. Wait for the prompt[root@sysrescue ~]#. SystemRescue will automatically log in as root.

3. Identify Drive, Root Partition, and Firmware

Before changing any data, use the following read-only commands to confirm drive names, filesystems, UUIDs, and firmware mode:

lsblk -f lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS fdisk -l /dev/vda test -d /sys/firmware/efi && echo UEFI || echo BIOS

In the sample case, the results to be identified include:

  • /dev/vda25 GiB capacity is the VirtIO drive of the VPS.
  • /dev/vda1use ext4, labelrootand contains Ubuntu.
  • Disklabel type: gptconfirm that the drive uses GPT.
  • ResultBIOSconfirm that the ISO is booting in Legacy BIOS mode.

Next, mount the root partition and verify the correct operating system:

mount /dev/vda1 /mnt cat /mnt/etc/os-release cat /mnt/etc/fstab ls -lah /mnt/boot

In the sample case,/etc/os-releasereturns Ubuntu 24.04.4 LTS, while/mnt/bootalertNo such file or directory. This indicates that the boot directory is missing.

4. Create BIOS Boot Partition on GPT Drive

Legacy BIOS combined with GPT requires a small partition of typeEF02for GRUB to savecore.img. In the sample case, the root partition starts at sector4096, therefore, the free space from sector can be used2048to4095, equivalent to 1 MiB.

4.1. Back Up GPT Partition Table

sgdisk --backup=/mnt/root/vda-gpt-before-grub.bin /dev/vda

Upon success, the command returnsThe operation has completed successfully.. Keep this backup file until you have confirmed that the VPS is running stably.

4.2. Create BIOS Boot Partition

sgdisk -n 2:2048:4095 -t 2:ef02 -c 2:bios_grub /dev/vda partprobe /dev/vda lsblk -o NAME,SIZE,FSTYPE,PARTTYPE,PARTLABEL

5. Recreate /boot, Bind Mount and Chroot

Only recreate the directory/bootafter ensuring this is not a separate partition in/etc/fstab. Then bind mount the necessary filesystems and switch to the faulty operating system usingchroot.

mkdir -p /mnt/boot mount --rbind /dev /mnt/dev mount --make-rslave /mnt/dev mount -t proc proc /mnt/proc mount --rbind /sys /mnt/sys mount --make-rslave /mnt/sys mount --rbind /run /mnt/run mount --make-rslave /mnt/run chroot /mnt /bin/bash

Inside chroot, check networking, update the package list, and identify the installed kernel:

apt-get update dpkg -l 'linux-image*'

Prefixiimeans the package has been installed. Sample case haslinux-image-6.8.0-111-generic, but the files in/bootis missing, so this exact kernel package needs to be reinstalled.

6. Restore Kernel and Initramfs

Replace the kernel version in the command below if the resultdpkg -lon your VPS differs from the sample:

DEBIAN_FRONTEND=noninteractive apt-get install --reinstall -y linux-image-6.8.0-111-generic grub-pc grub-pc-bin update-initramfs -u -k 6.8.0-111-generic

In the rescue environment, some warnings may appear, but they do not necessarily cause the process to fail:

  • MD subsystem is not loadedor warningmdadm.confwhen VPS does not use RAID.
  • DBus warning because systemd is not fully running inside chroot.
  • Kernel configuration file missing warning, as long as it is ultimately generatedvmlinuzandinitrd.img.

7. Reinstall GRUB and Create Boot Menu

grub-install --target=i386-pc --recheck /dev/vda update-grub ls -lh /boot

Directory/bootmust have at least:

  • vmlinuz-6.8.0-111-generic
  • initrd.img-6.8.0-111-generic
  • Directory/boot/grub

8. Exit Chroot, Unmount ISO, and Reboot

exit sync umount -R /mnt poweroff
  1. Eject or unmount the SystemRescue ISO in the VPS control panel.
  2. Keep firmware atLegacy BIOS, do not switch to UEFI.
  3. Set the hard drive as the first boot device and power on the VPS.
  4. After Ubuntu boots up, run the verification commands below.
uname -r lsblk systemctl --failed

Common Errors During VPS Boot Rescue

Problem opening /dev/v for reading

Device name was truncated due to a narrow console window. Please re-enter and ensure the drive name ends completely with/dev/vda. The command line wrapping automatically on the screen does not affect anything, as long as you do not press Enter in the middle of a drive name.

grub-install: embedding is not possible

GPT drive running BIOS without partitionsbios_grub, or the kernel has not recognized the newly created partition. Check again withlsblk, runpartprobe /dev/vdathen try again.

update-grub cannot find Linux image

You have not restored the correct kernel package. Identify the version usingdpkg -l 'linux-image*', reinstall the exact package with the statusii, then rerunupdate-initramfsandupdate-grub.

apt-get update reports a DNS error

Check network connectivity in the rescue environment and configure valid DNS for chroot. Do not reboot if the kernel has not yet appeared in/boot.

VPS keeps booting into SystemRescue after reboot

The ISO is still attached or prioritized before the hard drive in the boot order. Please eject the ISO and choose to boot from disk.

Shortened Command Sheet Matching the Sample Case

mount /dev/vda1 /mnt sgdisk --backup=/mnt/root/vda-gpt-before-grub.bin /dev/vda sgdisk -n 2:2048:4095 -t 2:ef02 -c 2:bios_grub /dev/vda partprobe /dev/vda mkdir -p /mnt/boot mount --rbind /dev /mnt/dev mount --make-rslave /mnt/dev mount -t proc proc /mnt/proc mount --rbind /sys /mnt/sys mount --make-rslave /mnt/sys mount --rbind /run /mnt/run mount --make-rslave /mnt/run chroot /mnt /bin/bash
apt-get update DEBIAN_FRONTEND=noninteractive apt-get install --reinstall -y linux-image-6.8.0-111-generic grub-pc grub-pc-bin update-initramfs -u -k 6.8.0-111-generic grub-install --target=i386-pc --recheck /dev/vda update-grub ls -lh /boot exit sync umount -R /mnt poweroff

Frequently asked questions

Can this guide be used for UEFI VPS?

No. This article applies to GPT running Legacy BIOS and usinggrub-install target i386-pc. UEFI VPS needs to identify and correctly mount the EFI System Partition, then install GRUB in UEFI mode.

Can GRUB be installed to /dev/vda1?

No. In the sample structure, GRUB must be installed to the entire drive/dev/vda.

Do I need to format the bios_grub partition?

No. The EF02 partition is reserved exclusively for GRUB to storecore.img, do not format and do not mount.

When can the SystemRescue ISO be unmounted?

Only unmount the ISO aftergrub-installandupdate-grubsuccessfully, while/bootalready availablevmlinuz, initrd.imgand the foldergrub.

VPTS – Comprehensive Digital Infrastructure Solutions Provider

VPTS is a digital infrastructure solution provider in Vietnam, serving deployment, operation, and data storage needs for individuals, developers, and enterprises. The service ecosystem includesVietnam VPS, International VPS, VPS Anti DDoS, Hosting cPanel, dedicated server, Rack rental, Proxy IPv4/IPv6, S3 MinIOandCloud Storage.

Besides providing infrastructure resources, VPTS also focuses on assisting customers with deployment, configuration, and practical troubleshooting. Content on the VPTS Blog is drawn from common scenarios in operating VPS, servers, and online systems, helping readers understand root causes and apply clear solutions.

VPTS – Stable infrastructure, flexible solutions, and continuous partnership throughout operations.

VPTS Team Contact Information

Conclusion

When Ubuntu VPS loses GRUB or loses data in/boot, SystemRescue allows you to check disks, chroot into the system, recover the kernel, and reinstall the bootloader without needing a fresh OS install. The most critical factor is correctly identifying the firmware, partition table, root partition, and free sector space before modifying the GPT.

If the VPS structure does not match the sample case or the data on the machine is high-value, you should take a snapshot and contact technical support before proceeding.