Hey!
All I get is “Booting from Hard Disk…” “error: symbol ‘grub_calloc’ not found” “Entering resuce mode…”
and then grub rescue>
I’ve tried everything, including booting from recovery and tried to reinstall grub and stuff but nothing works, im panicking cause destroying the droplet and creating a new one would mean I have to rebuild my mongoDB that has alot of data in it…
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi, First things first, if the environment configuration of your droplet is difficult to replicate, I recommend you to wait for a response from DO support team, and to not perform any action unless they instruct you to do that.
However, if you would like to get the risk, you can try to go through with it. So…
1. Using DO control panel, turn off your droplet and take its snapshot, just in case, to preserve your data.
2. Then, switch to recovery environment (Boot from Recovery ISO), turn your droplet on, and launch recovery console.
3. Choose from menu Mount Your Disk Image, and then enter Interactive Shell
4. Change root for your mounted disk. But before that, bind some system resources. Execute following commands
mount -o bind /dev /mnt/dev
mount -o bind /dev/pts /mnt/dev/pts
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
mount -o bind /run /mnt/run
chroot /mnt
Now, your are in your droplet’s root directory
5. Create GRUB config file.
/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
6. Check what your droplet’s disk is
fdisk -l
It will be a message displayed, looking like that:
Disk /dev/vda: 25 GiB, 26843545600 bytes, 52428800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8A3333D6-33B3-4335-985-A3522504889E1
Device Start End Sectors Size Type
/dev/vda1 6144 52428766 52422623 25G Linux filesystem
/dev/vda2 2048 4095 2048 1M BIOS boot
In that case, droplet’s disk is /dev/vda
7. Install GRUB on your disk (replace /dev/vda with your droplet’s disk)
/usr/sbin/grub-install /dev/vda
8. Exit your chrooted environment.
exit
9. Shutdown recovery environment
shutdown -h now
10. Turn on starting from your image hard drive, and turn on your droplet.
Let us know if it works, pls.
Tried to do it myself but it seems like the config is completely gone…
Hello, I’ve tried this solution but I’m stuck in chroot/mnt command. cant go further and in my grub rescue console, it shows me grub_calloc not found. Could anyone tell me how do I fix that issue?
Thanks in advance!!!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.