0

I recently transferred a DD image of my Vultr VPS to my home computer. I used a Debian VirtualBox VM to make a new virtual disk, mount the DD image, rsync all the files from DD image to new virtual disk. I've edited /etc/fstab with the new UUID for the root file system and edited /etc/networking/interfaces with the new interface on the virtual disk. Then I detached it from this VM.

I made a brand new VirtualBox VM and attached this newly-created virtual disk and assumed it would boot. It doesn't. All I get is a blinking cursor on a black screen. Nothing else happens. I even rsync'd /boot from the working Debian VirtualBox VM. Still just a blinking cursor.

Is there something obvious that I'm missing? Any thoughts? Thanks for your input.

pkSML
  • 466

2 Answers2

2

There is.

Before the concept of a file system exists in the boot process, something needs to load a piece of code, that is able to understand a file system - this is called the bootloader and typically sits in the first few sectors of the disk or in a special folder on a special UEFI-Partition.

In your case it is most likely GRUB, which needs to be installed on the new image (again: outside of the root file system!)

Boot from a live Linux System with recovery mode and (re-)install Grub on your virtual disk.

Eugen Rieck
  • 20,637
0

Thanks to @Eugen Rieck's answer, I got it working!

Also thanks to https://unix.stackexchange.com/questions/191218/how-to-install-grub-on-a-new-drive and how do I fix a wrong UUID in grub.cfg?

The solution:

  • I booted into GParted Live and ran a terminal session.
  • sudo mount /dev/sda1 /mnt
  • sudo /mnt/usr/sbin/grub-install /dev/sda --skip-fs-probe --boot-directory=/mnt/boot
  • sudo sed -i 's/OLD-UUID/NEW-UUID/g' /mnt/boot/grub/grub.cfg (I got the old UUID from the grub.cfg file. It's listed several times, hence the global replacement with sed. And the new UUID comes from blkid.)
pkSML
  • 466